]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - tools/perf/builtin-record.c
perf record: Add 'snapshot' control command
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 1 Sep 2020 09:37:57 +0000 (12:37 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 4 Sep 2020 17:38:15 +0000 (14:38 -0300)
commitd20aff1512f013fab79b8740427b7574569a9a2e
tree43c5261c26024130049b82902d24a0972baca09d
parenta8fcbd269b4340c36dbf99b4453bcbfe128d93fb
perf record: Add 'snapshot' control command

Add 'snapshot' control command to create an AUX area tracing snapshot
the same as if sending SIGUSR2. The advantage of the FIFO is that access
is governed by access to the FIFO.

Example:

  $ mkfifo perf.control
  $ mkfifo perf.ack
  $ cat perf.ack &
  [1] 15235
  $ sudo ~/bin/perf record --control fifo:perf.control,perf.ack -S -e intel_pt//u -- sleep 60 &
  [2] 15243
  $ ps -e | grep perf
   15244 pts/1    00:00:00 perf
  $ kill -USR2 15244
  bash: kill: (15244) - Operation not permitted
  $ echo snapshot > perf.control
  ack
  $

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/20200901093758.32293-6-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-record.txt
tools/perf/builtin-record.c
tools/perf/builtin-stat.c
tools/perf/util/evlist.c
tools/perf/util/evlist.h