Skip to content

Commit

Permalink
perf tools: Parse tracepoints with '-' in system name
Browse files Browse the repository at this point in the history
Trace events potentially can have a '-' in their trace system name,
e.g. kvm on s390 defines kvm-s390:* tracepoints.
We could not parse them, because there was no rule for this:
  $ sudo ./perf top -e "kvm-s390:*"
  invalid or unsupported event: 'kvm-s390:*'

This patch adds an extra rule to event_legacy_tracepoint which handles
those cases. Without the patch, perf will not accept such tracepoints in
the -e option.

Signed-off-by: Alexander Yarygin <[email protected]>
Tested-by: Christian Borntraeger <[email protected]>
Acked-by: Christian Borntraeger <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Jiri Olsa <[email protected]>
  • Loading branch information
zpp0 authored and olsajiri committed Apr 29, 2014
1 parent e148c76 commit 2b9032e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tools/perf/util/parse-events.y
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,18 @@ PE_PREFIX_MEM PE_VALUE sep_dc
}

event_legacy_tracepoint:
PE_NAME '-' PE_NAME ':' PE_NAME
{
struct parse_events_evlist *data = _data;
struct list_head *list;
char sys_name[128];
snprintf(&sys_name, 128, "%s-%s", $1, $3);

ALLOC_LIST(list);
ABORT_ON(parse_events_add_tracepoint(list, &data->idx, &sys_name, $5));
$$ = list;
}
|
PE_NAME ':' PE_NAME
{
struct parse_events_evlist *data = _data;
Expand Down

0 comments on commit 2b9032e

Please sign in to comment.