perf/tool: Fix usage of trace events with '-' in trace system name.
A message that is not in the archive (sent off-list or not yet received): 87fvm411yi.wl%[email protected]
Christian Borntraeger
Acked-byQuoted 7 lines · Alexander Yarygin
Trace events potentially can have a '-' in their trace system name, e.g. kvm on s390 defines kvm-s390:* tracepoints.
tools/perfcould not parse them, because there was no rule for this:$ sudo ./perf top -e "kvm-s390:*" invalid or unsupported event: 'kvm-s390:*'
Quoted 7 lines
This patch allows to '-' to be a part of
PE_NAMEtoken, so tracepoints with '-' can be parsed by theevent_legacy_tracepointrule. Without the patch, perf will not accept such tracepoints in the -e option.Signed-off-by Alexander Yarygin <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>
When doing a V2, you should remove my Signed-off-by. ;-)
But at least we can now add my
Ingo, Peter, Paul,
If you agree with this solution, I would like to have this in the next merge window - maybe cc stable if we consider perf stable relevant.
Christian
Quoted 18 lines
--- tools/perf/util/parse-events.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/parse-events.l +1
-1@@ -199,7 +199,7 @@ r{num_raw_hex} { return raw(yyscanner); } {num_hex} { return value(yyscanner, 16); } {modifier_event} { return str(yyscanner, PE_MODIFIER_EVENT); } -{name} { return str(yyscanner, PE_NAME); } +{name_minus} { return str(yyscanner, PE_NAME); } "/" { BEGIN(config); return '/'; } - { return '-'; } , { BEGIN(event); return ','; }