[PATCH v2] vdso: Improve cmd_vdso_check to check all dynamic relocations

2022-12-21 Thread Fangrui Song
The actual intention is that no dynamic relocation exists. However, some GNU ld ports produce unneeded R_*_NONE. (If a port fails to determine the exact .rel[a].dyn size, the trailing zeros become R_*_NONE relocations. E.g. ld's powerpc port recently fixed https://sourceware.org/bugzilla/show_bug.

[PATCH v2 9/9] perf jevents: Add model list option

2022-12-21 Thread Ian Rogers
This allows the set of generated jevents events and metrics be limited to a subset of the model names. Appropriate if trying to minimize the binary size where only a set of models are possible. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/Build | 3 ++- tools/perf/pmu-events/jevents.

[PATCH v2 8/9] perf jevents: Generate metrics and events as separate tables

2022-12-21 Thread Ian Rogers
Turn a perf json event into an event, metric or both. This reduces the number of events needed to scan to find an event or metric. As events no longer need the relatively seldom used metric fields, 4 bytes is saved per event. This reduces the big C string's size by 335kb (14.8%) on x86. Signed-off

[PATCH v2 7/9] perf pmu-events: Introduce pmu_metrics_table

2022-12-21 Thread Ian Rogers
Add a metrics table that is just a cast from pmu_events_table. This changes the APIs so that event and metric usage of the underlying table is different. Later changes will separate the tables. This introduction fixes a NO_JEVENTS=1 regression on: 68: Parse and process metrics

[PATCH v2 6/9] perf jevents: Combine table prefix and suffix writing

2022-12-21 Thread Ian Rogers
Combine into a single function to simplify, in a later change, writing metrics separately. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 36 +--- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/tools/perf/pmu-events/jevents.py b/tool

[PATCH v2 5/9] perf stat: Remove evsel metric_name/expr

2022-12-21 Thread Ian Rogers
Metrics are their own unit and these variables held broken metrics previously and now just hold the value NULL. Remove code that used these variables. Signed-off-by: Ian Rogers --- tools/perf/builtin-stat.c | 1 - tools/perf/util/cgroup.c | 1 - tools/perf/util/evsel.c | 2 -

[PATCH v2 4/9] perf pmu-events: Separate metric out of pmu_event

2022-12-21 Thread Ian Rogers
Previously both events and metrics were encoded in struct pmu_event. Create a new pmu_metric that has the metric related variables and remove these from pmu_event. Add iterators for pmu_metric and use in places that metrics are desired rather than events. Note, this change removes the setting of e

[PATCH v2 3/9] perf jevents: Rewrite metrics in the same file with each other

2022-12-21 Thread Ian Rogers
Rewrite metrics within the same file in terms of each other. For example, on Power8 other_stall_cpi is rewritten from: "PM_CMPLU_STALL / PM_RUN_INST_CMPL - PM_CMPLU_STALL_BRU_CRU / PM_RUN_INST_CMPL - PM_CMPLU_STALL_FXU / PM_RUN_INST_CMPL - PM_CMPLU_STALL_VSU / PM_RUN_INST_CMPL - PM_CMPLU_STALL_L

[PATCH v2 2/9] perf jevents metric: Add ability to rewrite metrics in terms of others

2022-12-21 Thread Ian Rogers
Add RewriteMetricsInTermsOfOthers that iterates over pairs of names and expressions trying to replace an expression, within the current expression, with its name. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/metric.py | 73 +++- tools/perf/pmu-events/metric_te

[PATCH v2 1/9] perf jevents metric: Correct Function equality

2022-12-21 Thread Ian Rogers
rhs may not be defined, say for source_count, so add a guard. Signed-off-by: Ian Rogers --- tools/perf/pmu-events/metric.py | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/pmu-events/metric.py b/tools/perf/pmu-events/metric.py index 4797ed4fd817..2f2fd220e843

[PATCH v2 0/9] jevents/pmu-events improvements

2022-12-21 Thread Ian Rogers
Add an optimization to jevents using the metric code, rewrite metrics in terms of each other in order to minimize size and improve readability. For example, on Power8 other_stall_cpi is rewritten from: "PM_CMPLU_STALL / PM_RUN_INST_CMPL - PM_CMPLU_STALL_BRU_CRU / PM_RUN_INST_CMPL - PM_CMPLU_STALL_

Re: [PATCH v12 0/6] implement getrandom() in vDSO

2022-12-21 Thread Eric Biggers
On Wed, Dec 21, 2022 at 03:25:49PM +0100, Jason A. Donenfeld wrote: > On Tue, Dec 20, 2022 at 08:13:14PM +, Eric Biggers wrote: > > On Tue, Dec 20, 2022 at 05:17:52PM +, Christophe Leroy wrote: > > > Hi Jason, > > > > > > Le 12/12/2022 à 19:53, Jason A. Donenfeld a écrit : > > > > Changes

Re: [PATCH v12 0/6] implement getrandom() in vDSO

2022-12-21 Thread Jason A. Donenfeld
On Tue, Dec 20, 2022 at 08:13:14PM +, Eric Biggers wrote: > On Tue, Dec 20, 2022 at 05:17:52PM +, Christophe Leroy wrote: > > Hi Jason, > > > > Le 12/12/2022 à 19:53, Jason A. Donenfeld a écrit : > > > Changes v11->v12: > > > > > > - In order to avoid mlock()ing pages, and

Re: [PATCH v12 0/6] implement getrandom() in vDSO

2022-12-21 Thread Jason A. Donenfeld
On Tue, Dec 20, 2022 at 05:17:52PM +, Christophe Leroy wrote: > I would have liked to give it a try on powerpc, but the series > conflicts. I tried both on v6.1 and on linus/master from now: I'll send a rebased v+1 shortly. Jason

Re: [PATCH] cputime: remove cputime_to_nsecs fallback

2022-12-21 Thread Alexander Gordeev
On Tue, Dec 20, 2022 at 05:07:05PM +1000, Nicholas Piggin wrote: > The archs that use cputime_to_nsecs() internally provide their own > definition and don't need the fallback. cputime_to_usecs() unused except > in this fallback, and is not defined anywhere. > > This removes the final remnant of th