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  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 6 May 2020 15:45:59 -0700
From:   Ian Rogers <irogers@...gle.com>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     "Jin, Yao" <yao.jin@...ux.intel.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        LKML <Linux-kernel@...r.kernel.org>,
        Andi Kleen <ak@...ux.intel.com>, kan.liang@...el.com,
        yao.jin@...el.com, John Garry <john.garry@...wei.com>
Subject: Re: [PATCH] perf parse-events: Use strcmp to compare the PMU name

On Thu, Apr 30, 2020 at 8:33 AM Jiri Olsa <jolsa@...hat.com> wrote:
>
> On Thu, Apr 30, 2020 at 09:45:14PM +0800, Jin, Yao wrote:
> > Hi Jiri,
> >
> > On 4/30/2020 4:45 PM, Jiri Olsa wrote:
> > > On Thu, Apr 30, 2020 at 08:36:18AM +0800, Jin Yao wrote:
> > > > A big uncore event group is split into multiple small groups which
> > > > only include the uncore events from the same PMU. This has been
> > > > supported in the commit 3cdc5c2cb924a ("perf parse-events: Handle
> > > > uncore event aliases in small groups properly").
> > > >
> > > > If the event's PMU name starts to repeat, it must be a new event.
> > > > That can be used to distinguish the leader from other members.
> > > > But now it only compares the pointer of pmu_name
> > > > (leader->pmu_name == evsel->pmu_name).
> > > >
> > > > If we use "perf stat -M LLC_MISSES.PCIE_WRITE -a" on cascadelakex,
> > > > the event list is:
> > > >
> > > > evsel->name                                       evsel->pmu_name
> > > > ---------------------------------------------------------------
> > > > unc_iio_data_req_of_cpu.mem_write.part0           uncore_iio_4 (as leader)
> > > > unc_iio_data_req_of_cpu.mem_write.part0           uncore_iio_2
> > > > unc_iio_data_req_of_cpu.mem_write.part0           uncore_iio_0
> > > > unc_iio_data_req_of_cpu.mem_write.part0           uncore_iio_5
> > > > unc_iio_data_req_of_cpu.mem_write.part0           uncore_iio_3
> > > > unc_iio_data_req_of_cpu.mem_write.part0           uncore_iio_1
> > > > unc_iio_data_req_of_cpu.mem_write.part1           uncore_iio_4
> > > > ......
> > > >
> > > > For the event "unc_iio_data_req_of_cpu.mem_write.part1" with
> > > > "uncore_iio_4", it should be the event from PMU "uncore_iio_4".
> > > > It's not a new leader for this PMU.
> > > >
> > > > But if we use "(leader->pmu_name == evsel->pmu_name)", the check
> > > > would be failed and the event is stored to leaders[] as a new
> > > > PMU leader.
> > > >
> > > > So this patch uses strcmp to compare the PMU name between events.
> > > >
> > > > Fixes: 3cdc5c2cb924a ("perf parse-events: Handle uncore event aliases in small groups properly")
> > > > Signed-off-by: Jin Yao <yao.jin@...ux.intel.com>
> > >
> > > looks good, any chance we could have automated test
> > > for this uncore leader setup logic? like maybe the way
> > > John did the pmu-events tests? like test will trigger
> > > only when there's the pmu/events in the system
> > >
> > > Acked-by: Jiri Olsa <jolsa@...hat.com>
> > >
> > > thanks,
> > > jirka
> > >
> > >
> >
> > I'm considering to use LKP to do the sanity tests for all perf events
> > (core/uncore) and perf metrics periodically. It may help us to find the
> > regressions on time.
>
> sounds good ;) thanks
>
> jirka

I've tested this and would be happy to see this merged. John's bisect
found a memory leak fix of mine as the culprit.

Wrt testing, libbpf is using github/travis CI:
https://github.com/libbpf/libbpf
https://travis-ci.org/libbpf/libbpf
Perhaps that kind of set up can automate testing and lower the
reviewer burden - but there's upfront cost in setting it up.

Thanks,
Ian

Powered by blists - more mailing lists