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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 9 Jan 2020 13:08:06 +0800
From:   Leo Yan <leo.yan@...aro.org>
To:     Mathieu Poirier <mathieu.poirier@...aro.org>
Cc:     Arnaldo Carvalho de Melo <acme@...hat.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Ian Rogers <irogers@...gle.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Andi Kleen <ak@...ux.intel.com>,
        linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Mike Leach <mike.leach@...aro.org>
Subject: Re: [PATCH v4 1/2] perf parse: Refactor struct perf_evsel_config_term

Hi Mathieu,

On Wed, Jan 08, 2020 at 10:58:31AM -0700, Mathieu Poirier wrote:

[...]

> > diff --git a/tools/perf/util/evsel_config.h b/tools/perf/util/evsel_config.h
> > index 1f8d2fe0b66e..4e5b3ebf09cf 100644
> > --- a/tools/perf/util/evsel_config.h
> > +++ b/tools/perf/util/evsel_config.h
> > @@ -33,21 +33,8 @@ struct perf_evsel_config_term {
> >         struct list_head      list;
> >         enum evsel_term_type  type;
> >         union {
> > -               u64           period;
> > -               u64           freq;
> > -               bool          time;
> > -               char          *callgraph;
> > -               char          *drv_cfg;
> > -               u64           stack_user;
> > -               int           max_stack;
> > -               bool          inherit;
> > -               bool          overwrite;
> > -               char          *branch;
> > -               unsigned long max_events;
> > -               bool          percore;
> > -               bool          aux_output;
> > -               u32           aux_sample_size;
> > -               u64           cfg_chg;
> > +               u64           num;
> > +               char          *str;
> 
> That is a lot more than just dealing with the "char *" members.  Given
> the pervasiveness of the changes I would have been happy to leave
> other members alone for the time being.

I think actually you are suggesting like below which add general
members and also keep the old members.  If so, I prefer to add two
general members 'num' and 'str'.

struct perf_evsel_config_term {
        struct list_head      list;
        enum evsel_term_type  type;
        union {
                u64           period;
                u64           freq;
                bool          time;
                char          *callgraph;
                char          *drv_cfg;
                u64           stack_user;
                int           max_stack;
                bool          inherit;
                bool          overwrite;
                char          *branch;
                unsigned long max_events;
                bool          percore;
                bool          aux_output;
                u32           aux_sample_size;
                u64           cfg_chg;
+               u64           num;
+               char          *str;
        } val;
        bool weak;
};

> I will let Jiri make the
> final call but if we are to proceed this way I think we should have a
> member per type to avoid casting issues.

Yeah, let's see what's Jiri thinking.

Just note, with this change, I don't see any casting warning or errors
when built perf on arm64/arm32.

Thanks,
Leo Yan

Powered by blists - more mailing lists