perf tools: Add 'G' and 'H' modifiers to event parsing
PATCH 1/1 perf tools: Add 'G' and 'H' modifiers to event parsing
They were dropped during conversion of event parser.
tools/perf/util/parse-events.l +1 -1
@@ -54,7 +54,7 @@ num_dec [0-9]+ num_hex 0x[a-fA-F0-9]+ num_raw_hex [a-fA-F0-9]+ name [a-zA-Z_*?][a-zA-Z0-9_*?]* -modifier_event [ukhp]{1,5} +modifier_event [ukhpGH]{1,5} modifier_bp [rwx] %%
--
Gleb.
tools/perf/util/parse-events.l num_dec [0-9]+ · line 57
Quoted 2 lines · Gleb Natapov
tools/perf/util/parse-events.l +1
-1-modifier_event [ukhp]{1,5} +modifier_event [ukhpGH]{1,5}
You'd also need to increase the 5 to 7 I think, unless there's a clear exclusion with some of the other flags.
Hmm, as it stands I think the 5 is already too low: "ukhppp" is 6.
We should really write this as ['u'] ['k'] ['h'] ['G'] ['H'] ['p'{1,3}], not the combined thing.
Quoted 11 lines · Peter Zijlstra
tools/perf/util/parse-events.l num_dec [0-9]+ · line 57
Quoted 2 lines · Gleb Natapov
tools/perf/util/parse-events.l +1
-1-modifier_event [ukhp]{1,5} +modifier_event [ukhpGH]{1,5}You'd also need to increase the 5 to 7 I think, unless there's a clear exclusion with some of the other flags.
Hmm, as it stands I think the 5 is already too low: "ukhppp" is 6.
We should really write this as ['u'] ['k'] ['h'] ['G'] ['H'] ['p'{1,3}], not the combined thing.
If we will write them like that they all will have to be present for successful match of modifier_event, no?
--
Gleb.
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Peter Zijlstra
tools/perf/util/parse-events.l num_dec [0-9]+ · line 57
Quoted 2 lines · Gleb Natapov
tools/perf/util/parse-events.l +1
-1-modifier_event [ukhp]{1,5} +modifier_event [ukhpGH]{1,5}You'd also need to increase the 5 to 7 I think, unless there's a clear exclusion with some of the other flags.
Quoted 4 lines
Quoted 4 lines
Hmm, as it stands I think the 5 is already too low: "ukhppp" is 6.
We should really write this as ['u'] ['k'] ['h'] ['G'] ['H'] ['p'{1,3}], not the combined thing.
you mean to match them strictly in parser, right? because what we have now can match also stuff like 'uuu' 'kkuu' ...
So far it eludes me how to do that purely in flex and doing this via rules in bison seems like overkill.
I'd rather keep it the way we have and do the extra check in parse_events_modifier function.. unless someone comes up with flex regular expression that would do that (which is possible given my regex knowledge..)
also we need 8 characters for it, since this seems to be valid modifier: ukhGHppp
jirka
Quoted 20 lines · Jiri Olsa
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Peter Zijlstra
tools/perf/util/parse-events.l num_dec [0-9]+ · line 57
Quoted 2 lines · Gleb Natapov
tools/perf/util/parse-events.l +1
-1-modifier_event [ukhp]{1,5} +modifier_event [ukhpGH]{1,5}You'd also need to increase the 5 to 7 I think, unless there's a clear exclusion with some of the other flags.
Quoted 4 lines
Quoted 4 lines
Hmm, as it stands I think the 5 is already too low: "ukhppp" is 6.
We should really write this as ['u'] ['k'] ['h'] ['G'] ['H'] ['p'{1,3}], not the combined thing.
you mean to match them strictly in parser, right? because what we have now can match also stuff like 'uuu' 'kkuu' ...
So far it eludes me how to do that purely in flex and doing this via rules in bison seems like overkill.
Quoted 8 lines
I'd rather keep it the way we have and do the extra check in
parse_events_modifierfunction.. unless someone comes up with flex regular expression that would do that (which is possible given my regex knowledge..)also we need 8 characters for it, since this seems to be valid modifier: ukhGHppp
So want me to resend with 8 to fix missing GH for now? I can't think of proper regex either.
--
Gleb.
Quoted 26 lines · Gleb Natapov
Quoted 25 lines · Jiri Olsa
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Peter Zijlstra
tools/perf/util/parse-events.l num_dec [0-9]+ · line 57
Quoted 2 lines · Gleb Natapov
tools/perf/util/parse-events.l +1
-1-modifier_event [ukhp]{1,5} +modifier_event [ukhpGH]{1,5}You'd also need to increase the 5 to 7 I think, unless there's a clear exclusion with some of the other flags.
Quoted 4 lines
Quoted 4 lines
Hmm, as it stands I think the 5 is already too low: "ukhppp" is 6.
We should really write this as ['u'] ['k'] ['h'] ['G'] ['H'] ['p'{1,3}], not the combined thing.
you mean to match them strictly in parser, right? because what we have now can match also stuff like 'uuu' 'kkuu' ...
So far it eludes me how to do that purely in flex and doing this via rules in bison seems like overkill.
I'd rather keep it the way we have and do the extra check in
parse_events_modifierfunction.. unless someone comes up with flex regular expression that would do that (which is possible given my regex knowledge..)
Quoted 5 lines
Quoted 3 lines
also we need 8 characters for it, since this seems to be valid modifier: ukhGHppp
So want me to resend with 8 to fix missing GH for now? I can't think of proper regex either.
That would be great.. any chance you could add a test to the builtin-test.c? ;) Or just modify current one (one of the test__parse_events tests) to use those flags, should be straightforward..
thanks,
jirka