[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YHWQUMmj/7MqCfcs@krava>
Date: Tue, 13 Apr 2021 14:36:32 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: "Jin, Yao" <yao.jin@...ux.intel.com>
Cc: acme@...nel.org, jolsa@...nel.org, peterz@...radead.org,
mingo@...hat.com, alexander.shishkin@...ux.intel.com,
Linux-kernel@...r.kernel.org, ak@...ux.intel.com,
kan.liang@...el.com, yao.jin@...el.com
Subject: Re: [PATCH v3 12/27] perf parse-events: Support no alias assigned
event inside hybrid PMU
On Mon, Apr 12, 2021 at 10:51:14AM +0800, Jin, Yao wrote:
SNIP
>
> Do you suggest we just use string comparison for doing the direct check?
>
> e.g.
>
> if (strstr(term->config, "L1-dcache"))
> ...
>
> Of course, we can define a string array first and use a loop for string comparison.
>
> > > + if (!parse_state->fake_pmu && head_config && !found &&
> > > + perf_pmu__is_hybrid(name)) {
> > > + struct parse_events_term *term;
> > > + int ret;
> > > +
> > > + list_for_each_entry(term, head_config, list) {
> > > + if (!term->config)
> > > + continue;
> > > +
> > > + ret = parse_events__with_hybrid_pmu(parse_state,
> > > + term->config,
> > > + name, &found,
> > > + list);
> >
> > do we need to call the parsing again? could we just call
> > parse_events__add_cache_hybrid?
> >
> > jirka
> >
> >
>
> If we do the direct check for cache events, I think we don't need the parsing again.
>
> As I mentioned above, we need to define a string array and compare with term->config one by one.
>
maybe another way is to find a way to run just the lexer (without
parser) and check that it returns PE_NAME_CACHE_OP_RESULT
jirka
Powered by blists - more mailing lists