aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>2015-11-05 21:45:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 22:34:48 -0500
commit76f8ec712aa94da9fbfc9c318edc89aa1e48006b (patch)
treef2d53b9eef5426a5171a78fc2c4d07cca560a775
parent4a981abd115d6ade5fe8a07d5ca1d1f987a0c2f7 (diff)
Doc/slub: document slabinfo-gnuplot.sh script
Add documentation on how to use slabinfo-gnuplot.sh script. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Acked-by: Christoph Lameter <cl@linux.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--Documentation/vm/slub.txt59
1 files changed, 59 insertions, 0 deletions
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt
index b0c6d1bbb434..699d8ea5c230 100644
--- a/Documentation/vm/slub.txt
+++ b/Documentation/vm/slub.txt
@@ -280,4 +280,63 @@ of other objects.
280 280
281 slub_debug=FZ,dentry 281 slub_debug=FZ,dentry
282 282
283Extended slabinfo mode and plotting
284-----------------------------------
285
286The slabinfo tool has a special 'extended' ('-X') mode that includes:
287 - Slabcache Totals
288 - Slabs sorted by size (up to -N <num> slabs, default 1)
289 - Slabs sorted by loss (up to -N <num> slabs, default 1)
290
291Additionally, in this mode slabinfo does not dynamically scale sizes (G/M/K)
292and reports everything in bytes (this functionality is also available to
293other slabinfo modes via '-B' option) which makes reporting more precise and
294accurate. Moreover, in some sense the `-X' mode also simplifies the analysis
295of slabs' behaviour, because its output can be plotted using the
296slabinfo-gnuplot.sh script. So it pushes the analysis from looking through
297the numbers (tons of numbers) to something easier -- visual analysis.
298
299To generate plots:
300a) collect slabinfo extended records, for example:
301
302 while [ 1 ]; do slabinfo -X >> FOO_STATS; sleep 1; done
303
304b) pass stats file(-s) to slabinfo-gnuplot.sh script:
305 slabinfo-gnuplot.sh FOO_STATS [FOO_STATS2 .. FOO_STATSN]
306
307The slabinfo-gnuplot.sh script will pre-processes the collected records
308and generates 3 png files (and 3 pre-processing cache files) per STATS
309file:
310 - Slabcache Totals: FOO_STATS-totals.png
311 - Slabs sorted by size: FOO_STATS-slabs-by-size.png
312 - Slabs sorted by loss: FOO_STATS-slabs-by-loss.png
313
314Another use case, when slabinfo-gnuplot can be useful, is when you need
315to compare slabs' behaviour "prior to" and "after" some code modification.
316To help you out there, slabinfo-gnuplot.sh script can 'merge' the
317`Slabcache Totals` sections from different measurements. To visually
318compare N plots:
319
320a) Collect as many STATS1, STATS2, .. STATSN files as you need
321 while [ 1 ]; do slabinfo -X >> STATS<X>; sleep 1; done
322
323b) Pre-process those STATS files
324 slabinfo-gnuplot.sh STATS1 STATS2 .. STATSN
325
326c) Execute slabinfo-gnuplot.sh in '-t' mode, passing all of the
327generated pre-processed *-totals
328 slabinfo-gnuplot.sh -t STATS1-totals STATS2-totals .. STATSN-totals
329
330This will produce a single plot (png file).
331
332Plots, expectedly, can be large so some fluctuations or small spikes
333can go unnoticed. To deal with that, `slabinfo-gnuplot.sh' has two
334options to 'zoom-in'/'zoom-out':
335 a) -s %d,%d overwrites the default image width and heigh
336 b) -r %d,%d specifies a range of samples to use (for example,
337 in `slabinfo -X >> FOO_STATS; sleep 1;' case, using
338 a "-r 40,60" range will plot only samples collected
339 between 40th and 60th seconds).
340
283Christoph Lameter, May 30, 2007 341Christoph Lameter, May 30, 2007
342Sergey Senozhatsky, October 23, 2015