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:	Mon, 24 Oct 2011 08:19:16 -0600
From:	David Ahern <dsahern@...il.com>
To:	Deng-Cheng Zhu <dczhu@...s.com>
CC:	linux-kernel@...r.kernel.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...e.hu>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Subject: Re: [RFC PATCH 1/2] tools/perf: Don't set attr->disabled when doing
 grouping



On 10/24/2011 04:56 AM, Deng-Cheng Zhu wrote:
> Events will be created at the state PERF_EVENT_STATE_OFF if attr->disabled
> is set. When these events go to arch level validate_group(), the function
> won't do anything real because they are filtered out by the state check.

Seems like a bug with the group checks. You should be able to enable and
disable events - including creating them disabled.

David


> 
> Signed-off-by: Deng-Cheng Zhu <dczhu@...s.com>
> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> Cc: Paul Mackerras <paulus@...ba.org>
> Cc: Ingo Molnar <mingo@...e.hu>
> Cc: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
> ---
>  tools/perf/builtin-record.c |    6 +++---
>  tools/perf/builtin-stat.c   |    3 ++-
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index f4c3fbe..67e8e4c 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -161,7 +161,6 @@ static void config_attr(struct perf_evsel *evsel, struct perf_evlist *evlist)
>  	struct perf_event_attr *attr = &evsel->attr;
>  	int track = !evsel->idx; /* only the first counter needs these */
>  
> -	attr->disabled		= 1;
>  	attr->inherit		= !no_inherit;
>  	attr->read_format	= PERF_FORMAT_TOTAL_TIME_ENABLED |
>  				  PERF_FORMAT_TOTAL_TIME_RUNNING |
> @@ -222,10 +221,11 @@ static void config_attr(struct perf_evsel *evsel, struct perf_evlist *evlist)
>  	attr->mmap		= track;
>  	attr->comm		= track;
>  
> -	if (target_pid == -1 && target_tid == -1 && !system_wide) {
> +	if (!group)
>  		attr->disabled = 1;
> +
> +	if (target_pid == -1 && target_tid == -1 && !system_wide)
>  		attr->enable_on_exec = 1;
> -	}
>  }
>  
>  static bool perf_evlist__equal(struct perf_evlist *evlist,
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index 5deb17d..ca95475 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -284,7 +284,8 @@ static int create_perf_stat_counter(struct perf_evsel *evsel)
>  		return perf_evsel__open_per_cpu(evsel, evsel_list->cpus, group);
>  
>  	if (target_pid == -1 && target_tid == -1) {
> -		attr->disabled = 1;
> +		if (!group)
> +			attr->disabled = 1;
>  		attr->enable_on_exec = 1;
>  	}
>  
--
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