diff options
author | Namhyung Kim <namhyung@kernel.org> | 2021-08-11 06:46:58 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2021-09-17 13:55:00 +0200 |
commit | 41b740b6e8a994e5830daa5e15785522874f7456 (patch) | |
tree | f3c9a6d337e2972a6dbe35830bb27a04651a02d4 /tools/perf/util/synthetic-events.h | |
parent | perf tools: Allow controlling synthesizing PERF_RECORD_ metadata events durin... (diff) | |
download | linux-41b740b6e8a994e5830daa5e15785522874f7456.tar.xz linux-41b740b6e8a994e5830daa5e15785522874f7456.zip |
perf record: Add --synth option
Add an option to control the synthesizing behavior.
--synth <no|all|task|mmap|cgroup>
Fine-tune event synthesis: default=all
This can be useful when we know it doesn't need some synthesis like
in a specific usecase and/or when using pipe:
$ perf record -a --all-cgroups --synth cgroup -o- sleep 1 | \
> perf report -i- -s cgroup
Committer notes:
Added a clarification to the man page entry for --synth that this is
about pre-existing threads.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https //lore.kernel.org/r/20210811044658.1313391-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/synthetic-events.h')
-rw-r--r-- | tools/perf/util/synthetic-events.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/util/synthetic-events.h b/tools/perf/util/synthetic-events.h index 44f72d56ca4d..c931433bacbf 100644 --- a/tools/perf/util/synthetic-events.h +++ b/tools/perf/util/synthetic-events.h @@ -27,6 +27,18 @@ struct target; union perf_event; +enum perf_record_synth { + PERF_SYNTH_TASK = 1 << 0, + PERF_SYNTH_MMAP = 1 << 1, + PERF_SYNTH_CGROUP = 1 << 2, + + /* last element */ + PERF_SYNTH_MAX = 1 << 3, +}; +#define PERF_SYNTH_ALL (PERF_SYNTH_MAX - 1) + +int parse_synth_opt(char *str); + typedef int (*perf_event__handler_t)(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine); |