perf evswitch: Move switch logic to use in other tools
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 15 Aug 2019 14:00:11 +0000 (11:00 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 15 Aug 2019 15:24:31 +0000 (12:24 -0300)
commit8829e56fa050998164e496d380cd69186ae9b8d0
treec7ea46f40b3d52bd171555b6ad87d90785081081
parentd2360442725fd29b3189887476c57059854a398c
perf evswitch: Move switch logic to use in other tools

Now other tools that want switching can use an evswitch for that, just
set it up and add it to the PERF_RECORD_SAMPLE processing function.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: William Cohen <wcohen@redhat.com>
Link: https://lkml.kernel.org/n/tip-b1trj1q97qwfv251l66q3noj@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-script.c
tools/perf/util/Build
tools/perf/util/evswitch.c [new file with mode: 0644]
tools/perf/util/evswitch.h