aboutsummaryrefslogtreecommitdiffstats
path: root/tools/vm
diff options
context:
space:
mode:
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>2015-11-05 21:45:17 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 22:34:48 -0500
commit2b10075539d334b4732a07857672972fe971f7df (patch)
treefc16ae1930bcc6e97299f76e04945a0f550d73fd /tools/vm
parentcd918c557439c8f0750f64883367aeff264b5fd8 (diff)
tools/vm/slabinfo: use getopt no_argument/optional_argument
This patchset adds 'extended' slabinfo mode that provides additional information: -- totals summary -- slabs sorted by size -- slabs sorted by loss (waste) The patches also introduces several new slabinfo options to limit the number of slabs reported, sort slabs by loss (waste); and some fixes. Extended output example (slabinfo -X -N 2): Slabcache Totals ---------------- Slabcaches : 91 Aliases : 119->69 Active: 63 Memory used: 199798784 # Loss : 10689376 MRatio: 5% # Objects : 324301 # PartObj: 18151 ORatio: 5% Per Cache Average Min Max Total ---------------------------------------------------------------------------- #Objects 5147 1 89068 324301 #Slabs 199 1 3886 12537 #PartSlab 12 0 240 778 %PartSlab 32% 0% 100% 6% PartObjs 5 0 4569 18151 % PartObj 26% 0% 100% 5% Memory 3171409 8192 127336448 199798784 Used 3001736 160 121429728 189109408 Loss 169672 0 5906720 10689376 Per Object Average Min Max ----------------------------------------------------------- Memory 585 8 8192 User 583 8 8192 Loss 2 0 64 Slabs sorted by size -------------------- Name Objects Objsize Space Slabs/Part/Cpu O/S O %Fr %Ef Flg ext4_inode_cache 69948 1736 127336448 3871/0/15 18 3 0 95 a dentry 89068 288 26058752 3164/0/17 28 1 0 98 a Slabs sorted by loss -------------------- Name Objects Objsize Loss Slabs/Part/Cpu O/S O %Fr %Ef Flg ext4_inode_cache 69948 1736 5906720 3871/0/15 18 3 0 95 a inode_cache 11628 864 537472 642/0/4 18 2 0 94 a The last patch in the series addresses Linus' comment from http://marc.info/?l=linux-mm&m=144148518703321&w=2 (well, it's been some time. sorry.) gnuplot script takes the slabinfo records file, where every record is a `slabinfo -X' output. So the basic workflow is, for example, as follows: while [ 1 ]; do slabinfo -X -N 2 >> stats; sleep 1; done ^C slabinfo-gnuplot.sh stats The last command will produce 3 png files (and 3 stats files) -- graph of slabinfo totals -- graph of slabs by size -- graph of slabs by loss It's also possible to select a range of records for plotting (a range of collected slabinfo outputs) via `-r 10,100` (for example); and compare totals from several measurements (to visially compare slabs behaviour (10,50 range)) using pre-parsed totals files: slabinfo-gnuplot.sh -r 10,50 -t stats-totals1 .. stats-totals2 This also, technically, supports ktest. Upload new slabinfo to target, collect the stats and give the resulting stats file to slabinfo-gnuplot This patch (of 8): Use getopt constants in `struct option' ->has_arg instead of numerical representations. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/vm')
-rw-r--r--tools/vm/slabinfo.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c
index 808d5a9d5dcf..258ed014729d 100644
--- a/tools/vm/slabinfo.c
+++ b/tools/vm/slabinfo.c
@@ -1268,23 +1268,23 @@ static void output_slabs(void)
1268} 1268}
1269 1269
1270struct option opts[] = { 1270struct option opts[] = {
1271 { "aliases", 0, NULL, 'a' }, 1271 { "aliases", no_argument, NULL, 'a' },
1272 { "activity", 0, NULL, 'A' }, 1272 { "activity", no_argument, NULL, 'A' },
1273 { "debug", 2, NULL, 'd' }, 1273 { "debug", optional_argument, NULL, 'd' },
1274 { "display-activity", 0, NULL, 'D' }, 1274 { "display-activity", no_argument, NULL, 'D' },
1275 { "empty", 0, NULL, 'e' }, 1275 { "empty", no_argument, NULL, 'e' },
1276 { "first-alias", 0, NULL, 'f' }, 1276 { "first-alias", no_argument, NULL, 'f' },
1277 { "help", 0, NULL, 'h' }, 1277 { "help", no_argument, NULL, 'h' },
1278 { "inverted", 0, NULL, 'i'}, 1278 { "inverted", no_argument, NULL, 'i'},
1279 { "numa", 0, NULL, 'n' }, 1279 { "numa", no_argument, NULL, 'n' },
1280 { "ops", 0, NULL, 'o' }, 1280 { "ops", no_argument, NULL, 'o' },
1281 { "report", 0, NULL, 'r' }, 1281 { "report", no_argument, NULL, 'r' },
1282 { "shrink", 0, NULL, 's' }, 1282 { "shrink", no_argument, NULL, 's' },
1283 { "slabs", 0, NULL, 'l' }, 1283 { "slabs", no_argument, NULL, 'l' },
1284 { "track", 0, NULL, 't'}, 1284 { "track", no_argument, NULL, 't'},
1285 { "validate", 0, NULL, 'v' }, 1285 { "validate", no_argument, NULL, 'v' },
1286 { "zero", 0, NULL, 'z' }, 1286 { "zero", no_argument, NULL, 'z' },
1287 { "1ref", 0, NULL, '1'}, 1287 { "1ref", no_argument, NULL, '1'},
1288 { NULL, 0, NULL, 0 } 1288 { NULL, 0, NULL, 0 }
1289}; 1289};
1290 1290