From 800c93ffaf943a8c6d7c90d4e0468b9431e3dd7a Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Mon, 18 Nov 2024 14:53:42 -0800 Subject: [PATCH] perf trace-event: Always build trace-event-info.c trace-event-info.c has no libtraceevent dependencies, always build it and use it in builtin-record and perf_event_attr printing. Reviewed-by: Namhyung Kim Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Athira Rajeev Cc: Ben Gainey Cc: Colin Ian King Cc: Dominique Martinet Cc: Ilkka Koskinen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Oliver Upton Cc: Paran Lee Cc: Peter Zijlstra Cc: Steinar H. Gunderson Cc: Steven Rostedt (VMware) Cc: Thomas Falcon Cc: Weilin Wang Cc: Yang Jihong Cc: Yang Li Cc: Ze Gao Cc: Zixian Cai Cc: zhaimingbing Link: https://lore.kernel.org/r/20241118225345.889810-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-record.c | 2 -- tools/perf/util/Build | 2 +- tools/perf/util/perf_event_attr_fprintf.c | 4 ---- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index f83252472921..0b637cea4850 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1748,10 +1748,8 @@ static void record__init_features(struct record *rec) if (rec->no_buildid) perf_header__clear_feat(&session->header, HEADER_BUILD_ID); -#ifdef HAVE_LIBTRACEEVENT if (!have_tracepoints(&rec->evlist->core.entries)) perf_header__clear_feat(&session->header, HEADER_TRACING_DATA); -#endif if (!rec->opts.branch_stack) perf_header__clear_feat(&session->header, HEADER_BRANCH_STACK); diff --git a/tools/perf/util/Build b/tools/perf/util/Build index be7d3bc7ee01..93315bcba7bc 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -86,7 +86,7 @@ perf-util-y += pmu-bison.o perf-util-y += hwmon_pmu.o perf-util-y += tool_pmu.o perf-util-y += svghelper.o -perf-util-$(CONFIG_LIBTRACEEVENT) += trace-event-info.o +perf-util-y += trace-event-info.o perf-util-y += trace-event-scripting.o perf-util-$(CONFIG_LIBTRACEEVENT) += trace-event.o perf-util-$(CONFIG_LIBTRACEEVENT) += trace-event-parse.o diff --git a/tools/perf/util/perf_event_attr_fprintf.c b/tools/perf/util/perf_event_attr_fprintf.c index 59fbbba79697..a73c74b99a3b 100644 --- a/tools/perf/util/perf_event_attr_fprintf.c +++ b/tools/perf/util/perf_event_attr_fprintf.c @@ -212,7 +212,6 @@ static void __p_config_hw_cache_id(char *buf, size_t size, u64 value) } } -#ifdef HAVE_LIBTRACEEVENT static void __p_config_tracepoint_id(char *buf, size_t size, u64 value) { char *str = tracepoint_id_to_name(value); @@ -220,7 +219,6 @@ static void __p_config_tracepoint_id(char *buf, size_t size, u64 value) print_id_hex(str); free(str); } -#endif static void __p_config_id(struct perf_pmu *pmu, char *buf, size_t size, u32 type, u64 value) { @@ -238,9 +236,7 @@ static void __p_config_id(struct perf_pmu *pmu, char *buf, size_t size, u32 type case PERF_TYPE_HW_CACHE: return __p_config_hw_cache_id(buf, size, value); case PERF_TYPE_TRACEPOINT: -#ifdef HAVE_LIBTRACEEVENT return __p_config_tracepoint_id(buf, size, value); -#endif case PERF_TYPE_RAW: case PERF_TYPE_BREAKPOINT: default: -- 2.50.1