mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-04-29 12:28:27 +02:00
perf annotate: Use perf_tool__init()
Use perf_tool__init() so that more uses of 'struct perf_tool' can be const and not relying on perf_tool__fill_defaults(). Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: Ilkka Koskinen <ilkka@os.amperecomputing.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@arm.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: John Garry <john.g.garry@oracle.com> Cc: Jonathan Cameron <jonathan.cameron@huawei.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Leo Yan <leo.yan@linux.dev> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Nick Terrell <terrelln@fb.com> Cc: Oliver Upton <oliver.upton@linux.dev> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Song Liu <song@kernel.org> Cc: Sun Haiyong <sunhaiyong@loongson.cn> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: Will Deacon <will@kernel.org> Cc: Yanteng Si <siyanteng@loongson.cn> Cc: Yicong Yang <yangyicong@hisilicon.com> Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20240812204720.631678-18-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
071b117e75
commit
d48940cabc
@@ -696,28 +696,7 @@ static const char * const annotate_usage[] = {
|
||||
|
||||
int cmd_annotate(int argc, const char **argv)
|
||||
{
|
||||
struct perf_annotate annotate = {
|
||||
.tool = {
|
||||
.sample = process_sample_event,
|
||||
.mmap = perf_event__process_mmap,
|
||||
.mmap2 = perf_event__process_mmap2,
|
||||
.comm = perf_event__process_comm,
|
||||
.exit = perf_event__process_exit,
|
||||
.fork = perf_event__process_fork,
|
||||
.namespaces = perf_event__process_namespaces,
|
||||
.attr = perf_event__process_attr,
|
||||
.build_id = perf_event__process_build_id,
|
||||
#ifdef HAVE_LIBTRACEEVENT
|
||||
.tracing_data = perf_event__process_tracing_data,
|
||||
#endif
|
||||
.id_index = perf_event__process_id_index,
|
||||
.auxtrace_info = perf_event__process_auxtrace_info,
|
||||
.auxtrace = perf_event__process_auxtrace,
|
||||
.feature = process_feature_event,
|
||||
.ordered_events = true,
|
||||
.ordering_requires_timestamps = true,
|
||||
},
|
||||
};
|
||||
struct perf_annotate annotate = {};
|
||||
struct perf_data data = {
|
||||
.mode = PERF_DATA_MODE_READ,
|
||||
};
|
||||
@@ -876,6 +855,25 @@ int cmd_annotate(int argc, const char **argv)
|
||||
|
||||
data.path = input_name;
|
||||
|
||||
perf_tool__init(&annotate.tool, /*ordered_events=*/true);
|
||||
annotate.tool.sample = process_sample_event;
|
||||
annotate.tool.mmap = perf_event__process_mmap;
|
||||
annotate.tool.mmap2 = perf_event__process_mmap2;
|
||||
annotate.tool.comm = perf_event__process_comm;
|
||||
annotate.tool.exit = perf_event__process_exit;
|
||||
annotate.tool.fork = perf_event__process_fork;
|
||||
annotate.tool.namespaces = perf_event__process_namespaces;
|
||||
annotate.tool.attr = perf_event__process_attr;
|
||||
annotate.tool.build_id = perf_event__process_build_id;
|
||||
#ifdef HAVE_LIBTRACEEVENT
|
||||
annotate.tool.tracing_data = perf_event__process_tracing_data;
|
||||
#endif
|
||||
annotate.tool.id_index = perf_event__process_id_index;
|
||||
annotate.tool.auxtrace_info = perf_event__process_auxtrace_info;
|
||||
annotate.tool.auxtrace = perf_event__process_auxtrace;
|
||||
annotate.tool.feature = process_feature_event;
|
||||
annotate.tool.ordering_requires_timestamps = true;
|
||||
|
||||
annotate.session = perf_session__new(&data, &annotate.tool);
|
||||
if (IS_ERR(annotate.session))
|
||||
return PTR_ERR(annotate.session);
|
||||
|
||||
Reference in New Issue
Block a user