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: <CAP-5=fWRRZsyJZ-gky-FOFz79zW_3r78d_0APpj5sf66HqTpLw@mail.gmail.com>
Date:   Wed, 11 May 2022 18:15:13 -0700
From:   Ian Rogers <irogers@...gle.com>
To:     Andi Kleen <ak@...ux.intel.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        John Garry <john.garry@...wei.com>,
        Kan Liang <kan.liang@...ux.intel.com>,
        Zhengjun Xing <zhengjun.xing@...ux.intel.com>,
        Felix Fietkau <nbd@....name>, Qi Liu <liuqi115@...wei.com>,
        Like Xu <likexu@...cent.com>, linux-kernel@...r.kernel.org,
        linux-perf-users@...r.kernel.org,
        Nick Forrington <nick.forrington@....com>,
        Kajol Jain <kjain@...ux.ibm.com>,
        James Clark <james.clark@....com>,
        Andrew Kilroy <andrew.kilroy@....com>,
        "Paul A . Clarke" <pc@...ibm.com>, Will Deacon <will@...nel.org>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        ananth.narayan@....com, ravi.bangoria@....com,
        santosh.shukla@....com, sandipan.das@....com,
        Caleb Biggers <caleb.biggers@...el.com>,
        Perry Taylor <perry.taylor@...el.com>,
        Kshipra Bopardikar <kshipra.bopardikar@...el.com>,
        Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH v2 5/7] perf jevents: Add python converter script

On Wed, May 11, 2022 at 2:47 PM Andi Kleen <ak@...ux.intel.com> wrote:
>
>
> On 5/11/2022 2:15 PM, Ian Rogers wrote:
> > jevents.c is large, has a dependency on an old forked version of jsmn,
> > and is challenging to work upon. A lot of jevents.c's complexity comes
> > from needing to write json and csv parsing from first principles. In
> > contrast python has this functionality in standard libraries and is
> > already a build pre-requisite for tools like asciidoc (that builds all
> > of the perf man pages).
>
>
> Well I was still hoping at some point we could have run time loading of
> events. But yes if that's not
>
> happening then this probably the right approach.

Thanks Andi, some thinking out loud below:

The perf tool already discovers events from sysfs, so could we have
runtime loading by turning the sysfs mount point into a list of
directories?

I'm thinking that for consistency the jevents API inside of the perf
code should look more like sysfs. There's then a question of how we
resolve events, perhaps we can have a config value something like
"sysfs,runtime=/home/me/my-events,jevents" where we treat the list as
setting up something like a unionfs in the tool. So if you ask for
instructions.retired, the tool would first check sysfs, then any
runtime events specified sysfs like directories, then jevents (or a
different order if you set a different config value). If the event is
defined more than once for the same PMU then the ordering says which
one has priority. If a PMU isn't specified for an event then we search
all PMUs and for jevents you'd only see PMUs relevant to the cpuid(s).

I'm hoping something like this will allow hybrid to work without all
the "if...hybrid" code that's getting added, and with a behavior
that's obvious and will allow us to debug errors. Maybe a runtime
sysfs like directory implies too many files so we could make a json
file to replace that directory, or use a zip file, etc. I'd prefer it
if the mappings were as 1-to-1 as possible (ie have a new json format
whose structure matches sysfs) and so I wouldn't like to use the
current jevents.c code for it.

Thanks,
Ian

> -Andi
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ