|
@@ -4276,9 +4276,8 @@ out:
|
|
|
}
|
|
|
|
|
|
#ifdef CONFIG_SLABINFO
|
|
|
-int slabinfo_show(struct seq_file *m, void *p)
|
|
|
+void get_slabinfo(struct kmem_cache *cachep, struct slabinfo *sinfo)
|
|
|
{
|
|
|
- struct kmem_cache *cachep = list_entry(p, struct kmem_cache, list);
|
|
|
struct slab *slabp;
|
|
|
unsigned long active_objs;
|
|
|
unsigned long num_objs;
|
|
@@ -4333,13 +4332,20 @@ int slabinfo_show(struct seq_file *m, void *p)
|
|
|
if (error)
|
|
|
printk(KERN_ERR "slab: cache %s error: %s\n", name, error);
|
|
|
|
|
|
- seq_printf(m, "%-17s %6lu %6lu %6u %4u %4d",
|
|
|
- name, active_objs, num_objs, cachep->size,
|
|
|
- cachep->num, (1 << cachep->gfporder));
|
|
|
- seq_printf(m, " : tunables %4u %4u %4u",
|
|
|
- cachep->limit, cachep->batchcount, cachep->shared);
|
|
|
- seq_printf(m, " : slabdata %6lu %6lu %6lu",
|
|
|
- active_slabs, num_slabs, shared_avail);
|
|
|
+ sinfo->active_objs = active_objs;
|
|
|
+ sinfo->num_objs = num_objs;
|
|
|
+ sinfo->active_slabs = active_slabs;
|
|
|
+ sinfo->num_slabs = num_slabs;
|
|
|
+ sinfo->shared_avail = shared_avail;
|
|
|
+ sinfo->limit = cachep->limit;
|
|
|
+ sinfo->batchcount = cachep->batchcount;
|
|
|
+ sinfo->shared = cachep->shared;
|
|
|
+ sinfo->objects_per_slab = cachep->num;
|
|
|
+ sinfo->cache_order = cachep->gfporder;
|
|
|
+}
|
|
|
+
|
|
|
+void slabinfo_show_stats(struct seq_file *m, struct kmem_cache *cachep)
|
|
|
+{
|
|
|
#if STATS
|
|
|
{ /* list3 stats */
|
|
|
unsigned long high = cachep->high_mark;
|
|
@@ -4369,8 +4375,6 @@ int slabinfo_show(struct seq_file *m, void *p)
|
|
|
allochit, allocmiss, freehit, freemiss);
|
|
|
}
|
|
|
#endif
|
|
|
- seq_putc(m, '\n');
|
|
|
- return 0;
|
|
|
}
|
|
|
|
|
|
#define MAX_SLABINFO_WRITE 128
|