lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZG0RgAjiqQHoVXQR@kernel.org>
Date:   Tue, 23 May 2023 16:18:24 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Ian Rogers <irogers@...gle.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Kan Liang <kan.liang@...ux.intel.com>,
        Zhengjun Xing <zhengjun.xing@...ux.intel.com>,
        John Garry <john.g.garry@...cle.com>,
        Kajol Jain <kjain@...ux.ibm.com>,
        Thomas Richter <tmricht@...ux.ibm.com>,
        linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org
Subject: Re: [PATCH v3 14/15] perf jevents: Add support for metricgroup
 descriptions

Em Tue, May 23, 2023 at 08:58:25AM -0700, Ian Rogers escreveu:
> On Tue, May 23, 2023 at 8:16 AM Arnaldo Carvalho de Melo
> <acme@...nel.org> wrote:
> >
> > Em Wed, May 17, 2023 at 10:38:03AM -0700, Ian Rogers escreveu:
> > > Metrics have a field where the groups they belong to are listed like
> > > the following from
> > > tools/perf/pmu-events/arch/x86/skylakex/skx-metrics.json:
> > >
> > >         "MetricGroup": "PGO;TmaL1;TopdownL1;tma_L1_group",
> > >         "MetricName": "tma_frontend_bound",
> >
> >   LD      /tmp/build/perf-tools-next/util/perf-in.o
> >   LD      /tmp/build/perf-tools-next/perf-in.o
> >   CC      /tmp/build/perf-tools-next/pmu-events/pmu-events.o
> > In file included from /var/home/acme/git/perf-tools-next/tools/include/linux/bitmap.h:9,
> >                  from /var/home/acme/git/perf-tools-next/tools/perf/util/header.h:10,
> >                  from /tmp/build/perf-tools-next/pmu-events/pmu-events.c:3:
> > /tmp/build/perf-tools-next/pmu-events/pmu-events.c: In function ‘describe_metricgroup’:
> > /var/home/acme/git/perf-tools-next/tools/include/linux/kernel.h:102:25: error: overflow in conversion from ‘long unsigned int’ to ‘int’ changes value from ‘18446744073709551615’ to ‘-1’ [-Werror=overflow]
> >   102 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
> >       |                         ^
> > /tmp/build/perf-tools-next/pmu-events/pmu-events.c:61603:29: note: in expansion of macro ‘ARRAY_SIZE’
> > 61603 |         int low = 0, high = ARRAY_SIZE(metricgroups) - 1;
> >       |                             ^~~~~~~~~~
> > cc1: all warnings being treated as errors
> > make[3]: *** [/var/home/acme/git/perf-tools-next/tools/build/Makefile.build:98: /tmp/build/perf-tools-next/pmu-events/pmu-events.o] Error 1
> > make[2]: *** [Makefile.perf:679: /tmp/build/perf-tools-next/pmu-events/pmu-events-in.o] Error 2
> > make[1]: *** [Makefile.perf:236: sub-make] Error 2
> > make: *** [Makefile:113: install-bin] Error 2
> > make: Leaving directory '/var/home/acme/git/perf-tools-next/tools/perf'
> >
> >  Performance counter stats for 'make -k BUILD_BPF_SKEL=1 CORESIGHT=1 O=/tmp/build/perf-tools-next -C tools/perf install-bin':
> >
> >       241752971879      cycles:u
> >       296060193784      instructions:u                   #    1.22  insn per cycle
> >
> >        6.129451072 seconds time elapsed
> >
> >       59.018259000 seconds user
> >       12.132871000 seconds sys
> >
> >
> > ⬢[acme@...lbox perf-tools-next]$ fg
> > git rebase -i HEAD~15
> >
> > [1]+  Stopped                 git rebase -i HEAD~15
> > ⬢[acme@...lbox perf-tools-next]$ git log --oneline -1
> > 995a2beaa64deb7b (HEAD) perf jevents: Add support for metricgroup descriptions
> > ⬢[acme@...lbox perf-tools-next]$
> >
> > Applied 1-13, pushing to tmp.perf-tools-next,
> >
> > - Arnaldo
> 
> Thanks, there's a missing (int) cast on ARRAY_SIZE. It doesn't make
> sense to resend the entire series so I'll wait to rebase, add the cast
> and then resend in v2 - that's unless you beat me to it ;-)

I made the amendment below, now lets see why it is not building after
the next patch is applied...

- Arnaldo

diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py
index 8fca7c9adee0c354..7ed258be18292241 100755
--- a/tools/perf/pmu-events/jevents.py
+++ b/tools/perf/pmu-events/jevents.py
@@ -938,7 +938,7 @@ static const int metricgroups[][2] = {
 
 const char *describe_metricgroup(const char *group)
 {
-        int low = 0, high = ARRAY_SIZE(metricgroups) - 1;
+        int low = 0, high = (int)ARRAY_SIZE(metricgroups) - 1;
 
         while (low <= high) {
                 int mid = (low + high) / 2;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ