From: Arnaldo Carvalho de Melo Date: Mon, 17 Jan 2011 16:25:06 +0000 (-0200) Subject: perf tools: Fix handling of wildcards in tracepoint event selectors X-Git-Tag: v5.15~26676^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=dd9a9ad5e1e94894433110ccbf492ed60d75ffcb;p=mirror_ubuntu-kernels.git perf tools: Fix handling of wildcards in tracepoint event selectors It wasn't accounting the ':' when consuming bytes in the the event selector string, so parse_events() would fail in this test: if (!(*str == 0 || *str == ',' || isspace(*str))) return -1; as *str would be pointing to '*', the last character in the '-e' arg in: $ perf record -q -a -D -e sched:sched_* | perf script -i - -s perf-script.py Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Tom Zanussi LKML-Reference: Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 5cb6f4bde905..1f4cfe5d32fc 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -555,7 +555,7 @@ static enum event_result parse_tracepoint_event(const char **strp, if (evt_length >= MAX_EVENT_LENGTH) return EVT_FAILED; if (strpbrk(evt_name, "*?")) { - *strp += strlen(sys_name) + evt_length; + *strp += strlen(sys_name) + evt_length + 1; /* 1 == the ':' */ return parse_multiple_tracepoint_event(sys_name, evt_name, flags); } else {