[PATCH v2 0/3] perf probe: Allow names to start with digits

Dominique Martinet posted 3 patches 2 weeks ago
There is a newer version of this series
tools/perf/tests/parse-events.c | 11 +++++++++--
tools/perf/tests/pmu-events.c   |  2 +-
tools/perf/util/evlist.c        |  3 ++-
tools/perf/util/evsel.c         | 20 +++++++++++++-------
tools/perf/util/evsel.h         |  4 ++--
tools/perf/util/metricgroup.c   |  3 ++-
tools/perf/util/parse-events.c  | 38 +++++++++++++++++++++++---------------
tools/perf/util/parse-events.h  |  9 ++++++---
tools/perf/util/parse-events.l  |  4 ++--
tools/perf/util/parse-events.y  |  2 +-
10 files changed, 61 insertions(+), 35 deletions(-)
[PATCH v2 0/3] perf probe: Allow names to start with digits
Posted by Dominique Martinet 2 weeks ago
This is a rebase of the patch orginally sent almost two years ago here:
https://lkml.kernel.org/r/20220612061508.1449636-1-asmadeus@codewreck.org

At the time I was asked to add tests, and Jiri whipped up something to
make the test pass even for probes that don't exist on most systems but
that ended up never being formatted or sent... I asked what happened of
it and got asked to send it myself, but obviously also totally forget
about it myself until I needed it again now.

I've taken the diff from that thread, adapted it a little bit to the
current master branch and checked things still fall in place -- I didn't
see any obvious problem.

Thanks!

Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
---
Changes in v2:
- update Jiri's email in commit tags
- (not a change, but after being brain-dead and Ian helpful
reply I'm confirming patch 3/3 works as expected)
- Link to v1: https://lore.kernel.org/r/20240407-perf_digit-v1-0-57ec37c63394@codewreck.org

---
Dominique Martinet (3):
      perf parse-events: pass parse_state to add_tracepoint
      perf parse-events: Add new 'fake_tp' parameter for tests
      perf parse: Allow names to start with digits

 tools/perf/tests/parse-events.c | 11 +++++++++--
 tools/perf/tests/pmu-events.c   |  2 +-
 tools/perf/util/evlist.c        |  3 ++-
 tools/perf/util/evsel.c         | 20 +++++++++++++-------
 tools/perf/util/evsel.h         |  4 ++--
 tools/perf/util/metricgroup.c   |  3 ++-
 tools/perf/util/parse-events.c  | 38 +++++++++++++++++++++++---------------
 tools/perf/util/parse-events.h  |  9 ++++++---
 tools/perf/util/parse-events.l  |  4 ++--
 tools/perf/util/parse-events.y  |  2 +-
 10 files changed, 61 insertions(+), 35 deletions(-)
---
base-commit: 7367539ad4b0f8f9b396baf02110962333719a48
change-id: 20240407-perf_digit-72445b5edb62

Best regards,
-- 
Dominique Martinet | Asmadeus
Re: [PATCH v2 0/3] perf probe: Allow names to start with digits
Posted by Ian Rogers 1 week, 3 days ago
On Sun, May 5, 2024 at 4:14 AM Dominique Martinet
<asmadeus@codewreck.org> wrote:
>
> This is a rebase of the patch orginally sent almost two years ago here:
> https://lkml.kernel.org/r/20220612061508.1449636-1-asmadeus@codewreck.org
>
> At the time I was asked to add tests, and Jiri whipped up something to
> make the test pass even for probes that don't exist on most systems but
> that ended up never being formatted or sent... I asked what happened of
> it and got asked to send it myself, but obviously also totally forget
> about it myself until I needed it again now.
>
> I've taken the diff from that thread, adapted it a little bit to the
> current master branch and checked things still fall in place -- I didn't
> see any obvious problem.
>
> Thanks!
>
> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>

Reviewed-by: Ian Rogers <irogers@google.com>

Note, this isn't applying cleanly to the perf-tools-next branch on:
https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/

Thanks,
Ian

> ---
> Changes in v2:
> - update Jiri's email in commit tags
> - (not a change, but after being brain-dead and Ian helpful
> reply I'm confirming patch 3/3 works as expected)
> - Link to v1: https://lore.kernel.org/r/20240407-perf_digit-v1-0-57ec37c63394@codewreck.org
>
> ---
> Dominique Martinet (3):
>       perf parse-events: pass parse_state to add_tracepoint
>       perf parse-events: Add new 'fake_tp' parameter for tests
>       perf parse: Allow names to start with digits
>
>  tools/perf/tests/parse-events.c | 11 +++++++++--
>  tools/perf/tests/pmu-events.c   |  2 +-
>  tools/perf/util/evlist.c        |  3 ++-
>  tools/perf/util/evsel.c         | 20 +++++++++++++-------
>  tools/perf/util/evsel.h         |  4 ++--
>  tools/perf/util/metricgroup.c   |  3 ++-
>  tools/perf/util/parse-events.c  | 38 +++++++++++++++++++++++---------------
>  tools/perf/util/parse-events.h  |  9 ++++++---
>  tools/perf/util/parse-events.l  |  4 ++--
>  tools/perf/util/parse-events.y  |  2 +-
>  10 files changed, 61 insertions(+), 35 deletions(-)
> ---
> base-commit: 7367539ad4b0f8f9b396baf02110962333719a48
> change-id: 20240407-perf_digit-72445b5edb62
>
> Best regards,
> --
> Dominique Martinet | Asmadeus
>
Re: [PATCH v2 1/3] perf parse-events: pass parse_state to add_tracepoint
Posted by Dominique Martinet 1 week, 3 days ago
Thanks for the review!

Ian Rogers wrote on Wed, May 08, 2024 at 02:37:16PM -0700:
> Nit: evsel__newtp_idx typo

Fixed in v3

> Fwiw, I think the idx value is possibly something to be done away
> with. We renumber the evsels here:
> https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/util/parse-events.c?h=perf-tools-next#n2077

(I'm not sure what's immediately actionable here, so I'll consider this
a higher level comment for later cleanup)

Ian Rogers wrote on Wed, May 08, 2024 at 03:47:29PM -0700:
> Note, this isn't applying cleanly to the perf-tools-next branch on:
> https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/

Thanks for this note, I've rebased on this branch for v3

-- 
Dominique Martinet | Asmadeus