diff options
author | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | 2015-11-05 21:45:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-05 22:34:48 -0500 |
commit | 76f8ec712aa94da9fbfc9c318edc89aa1e48006b (patch) | |
tree | f2d53b9eef5426a5171a78fc2c4d07cca560a775 | |
parent | 4a981abd115d6ade5fe8a07d5ca1d1f987a0c2f7 (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.txt | 59 |
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 | ||
283 | Extended slabinfo mode and plotting | ||
284 | ----------------------------------- | ||
285 | |||
286 | The 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 | |||
291 | Additionally, in this mode slabinfo does not dynamically scale sizes (G/M/K) | ||
292 | and reports everything in bytes (this functionality is also available to | ||
293 | other slabinfo modes via '-B' option) which makes reporting more precise and | ||
294 | accurate. Moreover, in some sense the `-X' mode also simplifies the analysis | ||
295 | of slabs' behaviour, because its output can be plotted using the | ||
296 | slabinfo-gnuplot.sh script. So it pushes the analysis from looking through | ||
297 | the numbers (tons of numbers) to something easier -- visual analysis. | ||
298 | |||
299 | To generate plots: | ||
300 | a) collect slabinfo extended records, for example: | ||
301 | |||
302 | while [ 1 ]; do slabinfo -X >> FOO_STATS; sleep 1; done | ||
303 | |||
304 | b) pass stats file(-s) to slabinfo-gnuplot.sh script: | ||
305 | slabinfo-gnuplot.sh FOO_STATS [FOO_STATS2 .. FOO_STATSN] | ||
306 | |||
307 | The slabinfo-gnuplot.sh script will pre-processes the collected records | ||
308 | and generates 3 png files (and 3 pre-processing cache files) per STATS | ||
309 | file: | ||
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 | |||
314 | Another use case, when slabinfo-gnuplot can be useful, is when you need | ||
315 | to compare slabs' behaviour "prior to" and "after" some code modification. | ||
316 | To help you out there, slabinfo-gnuplot.sh script can 'merge' the | ||
317 | `Slabcache Totals` sections from different measurements. To visually | ||
318 | compare N plots: | ||
319 | |||
320 | a) Collect as many STATS1, STATS2, .. STATSN files as you need | ||
321 | while [ 1 ]; do slabinfo -X >> STATS<X>; sleep 1; done | ||
322 | |||
323 | b) Pre-process those STATS files | ||
324 | slabinfo-gnuplot.sh STATS1 STATS2 .. STATSN | ||
325 | |||
326 | c) Execute slabinfo-gnuplot.sh in '-t' mode, passing all of the | ||
327 | generated pre-processed *-totals | ||
328 | slabinfo-gnuplot.sh -t STATS1-totals STATS2-totals .. STATSN-totals | ||
329 | |||
330 | This will produce a single plot (png file). | ||
331 | |||
332 | Plots, expectedly, can be large so some fluctuations or small spikes | ||
333 | can go unnoticed. To deal with that, `slabinfo-gnuplot.sh' has two | ||
334 | options 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 | |||
283 | Christoph Lameter, May 30, 2007 | 341 | Christoph Lameter, May 30, 2007 |
342 | Sergey Senozhatsky, October 23, 2015 | ||