linux-stable/tools/perf/Documentation
Hari Bathini d890a98c92 perf tools: Add 'cgroup_id' sort order keyword
This patch introduces a cgroup identifier entry field in perf report to
identify or distinguish data of different cgroups. It uses the device
number and inode number of cgroup namespace, included in perf data with
the new PERF_RECORD_NAMESPACES event, as cgroup identifier.

With the assumption that each container is created with it's own cgroup
namespace,  this allows assessment/analysis of multiple containers at
once.

A simple test for this would be to clone a few processes passing
SIGCHILD & CLONE_NEWCROUP flags to each of them, execute shell and run
different workloads  on each of those contexts,  while running perf
record command with --namespaces option.

Shown below is the output of perf report, sorted with cgroup identifier,
on perf.data generated with the above test scenario, clearly indicating
one context's considerable use of kernel memory in comparison with
others:

	$ perf report -s cgroup_id,sample --stdio
	#
	# Total Lost Samples: 0
	#
	# Samples: 5K of event 'kmem:kmalloc'
	# Event count (approx.): 5965
	#
	# Overhead  cgroup id (dev/inode)       Samples
	# ........  .....................  ............
	#
	    81.27%  3/0xeffffffb                   4848
	    16.24%  3/0xf00000d0                    969
	     1.16%  3/0xf00000ce                     69
	     0.82%  3/0xf00000cf                     49
	     0.50%  0/0x0                            30

While this is a start, there is further scope of improving this. For
example, instead of cgroup namespace's device and inode numbers, dev
and inode numbers of some or all namespaces may be used to distinguish
which processes are running in a given container context.

Also, scripts to map device and inode info to containers sounds
plausible for better tracing of containers.

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sargun Dhillon <sargun@sargun.me>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/148891933338.25309.756882900782042645.stgit@hbathini.in.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-03-14 15:17:37 -03:00
..
android.txt perf tools: Update android build documentation 2016-07-04 20:27:27 -03:00
asciidoc.conf
Build.txt perf build: Add build documentation 2015-02-12 17:53:00 -03:00
callchain-overhead-calculation.txt perf tools: Document --children option in more detail 2015-04-29 10:38:06 -03:00
examples.txt perf record: Remove -f/--force option 2013-07-08 17:37:25 -03:00
intel-bts.txt perf tools: Add Intel BTS support 2015-08-21 11:34:10 -03:00
intel-pt.txt perf intel-pt: Update documentation about context switch events 2016-11-11 13:18:52 -03:00
itrace.txt perf tools: Add support for skipping itrace instructions 2016-03-30 11:14:09 -03:00
jit-interface.txt perf symbols: Add description of JIT interface 2012-08-13 14:55:02 -03:00
jitdump-specification.txt perf jit: Add jitdump format specification document 2016-10-24 11:07:41 -03:00
Makefile tools: Move utilities.mak from perf to tools/scripts/ 2016-03-18 13:57:20 -03:00
manpage-1.72.xsl
manpage-base.xsl
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-suppress-sp.xsl
perf-annotate.txt perf annotate: Add -q/--quiet option 2017-02-20 11:47:18 -03:00
perf-archive.txt perf archive: Remove duplicated 'runs' in man page 2013-12-09 15:21:45 -03:00
perf-bench.txt perf bench mem: Rename 'routine' to 'function' 2015-10-19 16:10:25 -03:00
perf-buildid-cache.txt perf buildid-cache: Scan and import user SDT events to probe cache 2016-07-04 19:39:00 -03:00
perf-buildid-list.txt
perf-c2c.txt perf c2c report: Coalesce by default only by pid,iaddr 2017-01-20 16:52:56 -03:00
perf-config.txt perf diff: Add diff.compute config option 2017-02-13 14:29:37 -03:00
perf-data.txt perf data ctf: Add '--all' option for 'perf data convert' 2016-06-28 10:54:57 -03:00
perf-diff.txt perf diff: Add -q/--quiet option 2017-02-20 11:47:08 -03:00
perf-evlist.txt perf evlist: Add --trace-fields option to show trace fields 2016-01-08 14:23:02 -03:00
perf-ftrace.txt perf ftrace: Add support for -a and -C option 2017-03-03 19:07:17 -03:00
perf-help.txt
perf-inject.txt perf inject: Add jitdump mmap injection support 2016-02-05 09:46:45 -03:00
perf-kallsyms.txt perf kallsyms: Introduce tool to look for extended symbol information on the running kernel 2017-01-11 16:48:01 -03:00
perf-kmem.txt perf kmem: Add option to specify time window of interest 2016-12-01 13:03:02 -03:00
perf-kvm.txt perf tools: Configurable per thread proc map processing time out 2015-06-19 18:27:13 -03:00
perf-list.txt perf list: Support long jevents descriptions 2016-10-03 21:35:47 -03:00
perf-lock.txt perf lock: Account for lock average wait time 2013-10-09 11:24:01 -03:00
perf-mem.txt perf mem: Add --ldlat option 2016-06-15 10:35:27 -03:00
perf-probe.txt perf probe: Ignore vmlinux buildid if offline kernel is given 2016-09-01 09:44:14 -03:00
perf-record.txt perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info 2017-03-14 11:38:23 -03:00
perf-report.txt perf tools: Add 'cgroup_id' sort order keyword 2017-03-14 15:17:37 -03:00
perf-sched.txt perf sched timehist: Add --state option 2017-01-17 11:36:44 -03:00
perf-script-perl.txt perf Documentation: Fix typos in perf/Documentation 2014-10-15 17:39:02 -03:00
perf-script-python.txt perf Documentation: Fix typos in perf/Documentation 2014-10-15 17:39:02 -03:00
perf-script.txt perf script: Add script print support for namespace events 2017-03-14 15:17:36 -03:00
perf-stat.txt perf stat: Add -a as default target 2017-02-17 17:31:10 -03:00
perf-test.txt perf test: Add -F/--dont-fork option 2016-06-30 18:27:45 -03:00
perf-timechart.txt perf timechart: Add more options to IO mode 2014-07-10 00:22:54 +02:00
perf-top.txt perf tools: Explicitly document that --children is enabled by default 2016-12-07 12:00:35 -03:00
perf-trace.txt perf trace: Allow specifying list of syscalls and events in -e/--expr/--event 2017-01-11 16:48:01 -03:00
perf.data-file-format.txt perf tools: Update documentation info about quipper 2016-09-29 11:16:44 -03:00
perf.txt perf tools: Handle -h and -v options 2015-10-05 16:36:18 -03:00
perfconfig.example perf config: Show default report configuration in example and docs 2016-09-01 09:44:13 -03:00
tips.txt scripts/spelling.txt: add "an user" pattern and fix typo instances 2017-02-27 18:43:46 -08:00