summaryrefslogtreecommitdiff
path: root/tools/perf/util/parse-events.h
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2024-05-10 01:24:31 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2024-05-10 16:49:26 +0300
commita2a6604e1c5836ff4121f170af1328c6a141cca4 (patch)
treec62b71d2ca7df1656db9e465d359f5d95bfd5a51 /tools/perf/util/parse-events.h
parent11a42964850b5b6f866f64b0157e6e99b4d7ab9d (diff)
downloadlinux-a2a6604e1c5836ff4121f170af1328c6a141cca4.tar.xz
perf parse-events: Add new 'fake_tp' parameter for tests
The next commit will allow tracepoints starting with digits, but most systems do not have any available by default so tests should skip the actual "check if it exists in /sys/kernel/debug/tracing" step. In order to do that, add a new boolean flag specifying if we should actually "format" the probe or not. Originally-by: Jiri Olsa <jolsa@kernel.org> Reviewed-by: Ian Rogers <irogers@google.com> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20240510-perf_digit-v4-2-db1553f3233b@codewreck.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.h')
-rw-r--r--tools/perf/util/parse-events.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index c06984bd3af8..f2baa69fff98 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -32,14 +32,14 @@ int parse_events_option_new_evlist(const struct option *opt, const char *str, in
__attribute__((nonnull(1, 2, 4)))
int __parse_events(struct evlist *evlist, const char *str, const char *pmu_filter,
struct parse_events_error *error, struct perf_pmu *fake_pmu,
- bool warn_if_reordered);
+ bool warn_if_reordered, bool fake_tp);
__attribute__((nonnull(1, 2, 3)))
static inline int parse_events(struct evlist *evlist, const char *str,
struct parse_events_error *err)
{
return __parse_events(evlist, str, /*pmu_filter=*/NULL, err, /*fake_pmu=*/NULL,
- /*warn_if_reordered=*/true);
+ /*warn_if_reordered=*/true, /*fake_tp=*/false);
}
int parse_event(struct evlist *evlist, const char *str);
@@ -152,6 +152,8 @@ struct parse_events_state {
int stoken;
/* Special fake PMU marker for testing. */
struct perf_pmu *fake_pmu;
+ /* Skip actual tracepoint processing for testing. */
+ bool fake_tp;
/* If non-null, when wildcard matching only match the given PMU. */
const char *pmu_filter;
/* Should PE_LEGACY_NAME tokens be generated for config terms? */