perf tools: Add evlist__add_sched_switch()
authorNamhyung Kim <namhyung@kernel.org>
Mon, 3 Oct 2022 20:46:46 +0000 (13:46 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 6 Oct 2022 11:03:53 +0000 (08:03 -0300)
commit182bb594e0678b3ceac99f4ec3daa5d22ea3d0ce
tree4ae7c492eaae49cb79ce36696357f1027d3e4dc6
parent60ea006f72512fd7c36f16cdbe91f4fc284f8115
perf tools: Add evlist__add_sched_switch()

Add a help to create a system-wide sched_switch event.  One merit is
that it sets the system-wide bit before adding it to evlist so that
the libperf can handle the cpu and thread maps correctly.

Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20221003204647.1481128-5-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/x86/util/intel-pt.c
tools/perf/tests/switch-tracking.c
tools/perf/util/evlist.c
tools/perf/util/evlist.h