Skip to content

Commit 5ceb579

Browse files
martinetdacmel
authored andcommitted
perf parse: Allow tracepoint names to start with digits
Tracepoints can start with digits, although we don't have many of these: $ rg -g '*.h' '\bTRACE_EVENT\([0-9]' net/mac802154/trace.h 53:TRACE_EVENT(802154_drv_return_int, ... net/ieee802154/trace.h 66:TRACE_EVENT(802154_rdev_add_virtual_intf, ... include/trace/events/9p.h 124:TRACE_EVENT(9p_client_req, ... Just allow names to start with digits too so e.g. "perf trace -e '9p:*'" works Reviewed-by: Ian Rogers <irogers@google.com> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org> Tested-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> 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-3-db1553f3233b@codewreck.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent a2a6604 commit 5ceb579

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tools/perf/tests/parse-events.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,6 +2269,13 @@ static const struct evlist_test test__events[] = {
22692269
.check = test__checkevent_breakpoint_2_events,
22702270
/* 3 */
22712271
},
2272+
#ifdef HAVE_LIBTRACEEVENT
2273+
{
2274+
.name = "9p:9p_client_req",
2275+
.check = test__checkevent_tracepoint,
2276+
/* 4 */
2277+
},
2278+
#endif
22722279
};
22732280

22742281
static const struct evlist_test test__events_pmu[] = {

tools/perf/util/parse-events.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ event [^,{}/]+
242242
num_dec [0-9]+
243243
num_hex 0x[a-fA-F0-9]{1,16}
244244
num_raw_hex [a-fA-F0-9]{1,16}
245-
name [a-zA-Z_*?\[\]][a-zA-Z0-9_*?.\[\]!\-]*
246-
name_tag [\'][a-zA-Z_*?\[\]][a-zA-Z0-9_*?\-,\.\[\]:=]*[\']
245+
name [a-zA-Z0-9_*?\[\]][a-zA-Z0-9_*?.\[\]!\-]*
246+
name_tag [\'][a-zA-Z0-9_*?\[\]][a-zA-Z0-9_*?\-,\.\[\]:=]*[\']
247247
name_minus [a-zA-Z_*?][a-zA-Z0-9\-_*?.:]*
248248
drv_cfg_term [a-zA-Z0-9_\.]+(=[a-zA-Z0-9_*?\.:]+)?
249249
/*

0 commit comments

Comments
 (0)