mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: "Yan, Zheng" <zheng.z.yan@intel.com>
Cc: eranian@google.com, a.p.zijlstra@chello.nl, mingo@elte.hu,
	andi@firstfloor.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 3/3] perf tool: Allow wildcard in PMU name
Date: Tue, 11 Sep 2012 16:05:49 +0200	[thread overview]
Message-ID: <20120911140549.GC3800@krava.brq.redhat.com> (raw)
In-Reply-To: <1347263631-23175-4-git-send-email-zheng.z.yan@intel.com>

On Mon, Sep 10, 2012 at 03:53:51PM +0800, Yan, Zheng wrote:
> From: "Yan, Zheng" <zheng.z.yan@intel.com>
> 

SNIP

> +int parse_events_add_pmu(struct list_head **_list, int *idx,
>  			 char *name, struct list_head *head_config)
>  {
>  	struct perf_event_attr attr;
> -	struct perf_pmu *pmu;
> +	struct list_head *list;
> +	struct perf_pmu *pmu = NULL;
> +	struct perf_evsel *evsel, *first = NULL;
> +	int orig_idx = *idx;
>  
> -	pmu = perf_pmu__find(name);
> -	if (!pmu)
> -		return -EINVAL;
> +	list = malloc(sizeof(*list));
> +	if (!list)
> +		return -ENOMEM;
> +	INIT_LIST_HEAD(list);

list should be allocated only if (!*_list)) same as in add_event function

I haven't test, but I think you'll leak/loose events if there's another pmu
event defined after ','

jirka

  parent reply	other threads:[~2012-09-11 14:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-10  7:53 [RFC PATCH 1/3] perf: Add cpumask for uncore pmu Yan, Zheng
2012-09-10  7:53 ` [RFC PATCH 1/3] perf/x86: " Yan, Zheng
2012-09-19 15:26   ` [tip:perf/core] " tip-bot for Yan, Zheng
2012-09-10  7:53 ` [RFC PATCH 2/3] perf tool: Make perf-stat check PMU cpumask file Yan, Zheng
2012-09-19 15:26   ` [tip:perf/core] perf stat: Check " tip-bot for Yan, Zheng
2012-09-10  7:53 ` [RFC PATCH 3/3] perf tool: Allow wildcard in PMU name Yan, Zheng
2012-09-11 13:50   ` Jiri Olsa
2012-09-11 14:05   ` Jiri Olsa [this message]
2012-09-12  1:30     ` Yan, Zheng
2012-09-12  9:03       ` Jiri Olsa
2012-09-11 14:27   ` Jiri Olsa
2012-09-17 15:36     ` Arnaldo Carvalho de Melo
2012-09-18  3:11       ` Yan, Zheng
2012-09-10 16:34 ` [RFC PATCH 1/3] perf: Add cpumask for uncore pmu Peter Zijlstra
2012-09-10 23:10   ` Arnaldo Carvalho de Melo

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=20120911140549.GC3800@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=andi@firstfloor.org \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=zheng.z.yan@intel.com \
    /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

Powered by JetHome