perf ftrace: Move out common code from __cmd_ftrace
authorNamhyung Kim <namhyung@kernel.org>
Wed, 15 Dec 2021 18:51:51 +0000 (10:51 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 16 Dec 2021 15:18:12 +0000 (12:18 -0300)
commita9b8ae8ae347941fefd6596f62586b13ae032e4b
tree1fabb636b69062139b9dfa7cc01e451788172994
parent416e15ad17f84358ba3eca6b82378be97c793c62
perf ftrace: Move out common code from __cmd_ftrace

The signal setup code and evlist__prepare_workload() can be used for
other subcommands.  Let's move them out of the __cmd_ftrace().  Then
it doesn't need to pass argc and argv.

On the other hand, select_tracer() is specific to the 'trace'
subcommand so it'd better moving it into the __cmd_ftrace().

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Cc: Changbin Du <changbin.du@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20211215185154.360314-3-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-ftrace.c