tools/mm/slabinfo.c

Source file repositories/reference/linux-study-clean/tools/mm/slabinfo.c

File Facts

System
Linux kernel
Corpus path
tools/mm/slabinfo.c
Extension
.c
Size
38937 bytes
Lines
1548
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct slabinfo {
	char *name;
	int alias;
	int refs;
	int aliases, align, cache_dma, cpu_slabs, destroy_by_rcu;
	unsigned int hwcache_align, object_size, objs_per_slab;
	unsigned int sanity_checks, slab_size, store_user, trace;
	int order, poison, reclaim_account, red_zone;
	unsigned long partial, objects, slabs, objects_partial, total_objects;
	unsigned long alloc_fastpath, alloc_slowpath;
	unsigned long free_fastpath, free_slowpath;
	unsigned long free_frozen, free_add_partial, free_remove_partial;
	unsigned long alloc_from_partial, alloc_slab, free_slab, alloc_refill;
	unsigned long cpuslab_flush, deactivate_full, deactivate_empty;
	unsigned long deactivate_to_head, deactivate_to_tail;
	unsigned long deactivate_remote_frees, order_fallback;
	unsigned long cmpxchg_double_cpu_fail, cmpxchg_double_fail;
	unsigned long alloc_node_mismatch, deactivate_bypass;
	unsigned long cpu_partial_alloc, cpu_partial_free;
	int numa[MAX_NODES];
	int numa_partial[MAX_NODES];
} slabinfo[MAX_SLABS];

struct aliasinfo {
	char *name;
	char *ref;
	struct slabinfo *slab;
} aliasinfo[MAX_ALIASES];

int slabs;
int actual_slabs;
int aliases;
int alias_targets;
int highest_node;

char buffer[4096];

int show_empty;
int show_report;
int show_alias;
int show_slab;
int skip_zero = 1;
int show_numa;
int show_track;
int show_first_alias;
int validate;
int shrink;
int show_inverted;
int show_single_ref;
int show_totals;
int sort_size;
int sort_active;
int set_debug;
int show_ops;
int sort_partial;
int show_activity;
int output_lines = -1;
int sort_loss;
int extended_totals;
int show_bytes;
int unreclaim_only;

/* Debug options */
int sanity;
int redzone;
int poison;
int tracking;
int tracing;

int page_size;

regex_t pattern;

static void fatal(const char *x, ...)
{
	va_list ap;

	va_start(ap, x);
	vfprintf(stderr, x, ap);
	va_end(ap);
	exit(EXIT_FAILURE);
}

static void usage(void)
{
	printf("slabinfo 4/15/2011. (c) 2007 sgi/(c) 2011 Linux Foundation.\n\n"
		"slabinfo [-aABDefhilLnoPrsStTUvXz1] [N=K] [-dafzput] [slab-regexp]\n"
		"-a|--aliases           Show aliases\n"
		"-A|--activity          Most active slabs first\n"
		"-B|--Bytes             Show size in bytes\n"

Annotation

Implementation Notes