The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: "acme@kernel.org" <acme@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"ak@linux.intel.com" <ak@linux.intel.com>
Subject: Re: [PATCH V5 2/3] perf tools: parse the pmu event prefix and surfix
Date: Thu, 11 Sep 2014 16:53:21 +0200	[thread overview]
Message-ID: <20140911145321.GB32722@krava.brq.redhat.com> (raw)
In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F077015C6EDB@SHSMSX103.ccr.corp.intel.com>

On Thu, Sep 11, 2014 at 01:50:50PM +0000, Liang, Kan wrote:
> 
> 
> > On Wed, Sep 10, 2014 at 01:55:31PM -0400, kan.liang@intel.com wrote:
> > 
> > SNIP
> > 
> > > +	struct perf_pmu_event_symbol *pmu2 =
> > > +			(struct perf_pmu_event_symbol *) p2;
> > > +
> > > +	return strcmp(pmu1->symbol, pmu2->symbol); }
> > > +
> > > +/*
> > > + * Read the pmu events list from sysfs
> > > + * Save it into perf_pmu_events_list
> > > + */
> > > +static void perf_pmu__parse_init(void) {
> > > +
> > > +	struct perf_pmu *pmu = NULL;
> > > +	struct perf_pmu_alias *alias;
> > > +	int len = 0;
> > > +
> > > +	while ((pmu = perf_pmu__scan(pmu)) != NULL)
> > > +		list_for_each_entry(alias, &pmu->aliases, list) {
> > > +			if (!strcmp(pmu->name, "cpu")) {
> > > +				if (strchr(alias->name, '-'))
> > > +					len++;
> > > +				len++;
> > > +			}
> > > +	}
> > > +	if (len == 0)
> > > +		return;
> > 
> > s oif 'len' is 0 we will scan all the time? maybe we want some separate 'init'
> > variable..
> > 
> 
> Maybe we can reuse the "perf_pmu_events_list_num".
> static int perf_pmu_events_list_num;
> 
> If len is 0, we just set perf_pmu_events_list_num to -1.
> Is it OK?

seems ok

jirka

  reply	other threads:[~2014-09-11 14:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10 17:55 [PATCH V5 1/3] Revert "perf tools: Default to cpu// for events v5" kan.liang
2014-09-10 17:55 ` [PATCH V5 2/3] perf tools: parse the pmu event prefix and surfix kan.liang
2014-09-11  8:46   ` Jiri Olsa
2014-09-11 13:31     ` Liang, Kan
2014-09-11 13:37       ` Jiri Olsa
2014-09-11  8:51   ` Jiri Olsa
2014-09-11 13:50     ` Liang, Kan
2014-09-11 14:53       ` Jiri Olsa [this message]
2014-09-10 17:55 ` [PATCH V5 3/3] perf tools: Add support to new style format of kernel PMU event kan.liang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140911145321.GB32722@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox