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]
Date:	Tue, 11 Sep 2012 16:05:49 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	"Yan, Zheng" <zheng.z.yan@...el.com>
Cc:	eranian@...gle.com, a.p.zijlstra@...llo.nl, mingo@...e.hu,
	andi@...stfloor.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 3/3] perf tool: Allow wildcard in PMU name

On Mon, Sep 10, 2012 at 03:53:51PM +0800, Yan, Zheng wrote:
> From: "Yan, Zheng" <zheng.z.yan@...el.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ