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:	Thu, 2 Aug 2012 11:38:26 +0400
From:	Andrew Vagin <avagin@...allels.com>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	"acme@...hat.com" <acme@...hat.com>,
	"a.p.zijlstra@...llo.nl" <a.p.zijlstra@...llo.nl>,
	"mingo@...e.hu" <mingo@...e.hu>,
	"paulus@...ba.org" <paulus@...ba.org>,
	"cjashfor@...ux.vnet.ibm.com" <cjashfor@...ux.vnet.ibm.com>,
	"fweisbec@...il.com" <fweisbec@...il.com>,
	"eranian@...gle.com" <eranian@...gle.com>,
	"gorcunov@...nvz.org" <gorcunov@...nvz.org>,
	"tzanussi@...il.com" <tzanussi@...il.com>,
	"mhiramat@...hat.com" <mhiramat@...hat.com>,
	"robert.richter@....com" <robert.richter@....com>,
	"fche@...hat.com" <fche@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"masami.hiramatsu.pt@...achi.com" <masami.hiramatsu.pt@...achi.com>,
	"drepper@...il.com" <drepper@...il.com>,
	"asharma@...com" <asharma@...com>,
	"benjamin.redelings@...cent.org" <benjamin.redelings@...cent.org>,
	Andrew Vagin <avagin@...nvz.org>
Subject: Re: [PATCH 07/13] perf: Add attribute to filter out callchains

On Wed, Aug 01, 2012 at 02:10:59PM +0400, Jiri Olsa wrote:
> From: Frederic Weisbecker <fweisbec@...il.com> 
> 
> Introducing following bits to the the perf_event_attr struct:
>   - exclude_callchain_kernel to filter out kernel callchain
>     from the sample dump
>   - exclude_callchain_user to filter out user callchain
>     from the sample dump
> 
> We need to be able to disable standard user callchain dump
> when we use the dwarf cfi callchain mode, because frame
> pointer based user callchains are useless in this mode.
> 
> Implementing also exclude_callchain_kernel to have complete
> set of options.
> 
> Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
> [ Added kernel callchains filtering ]
> Signed-off-by: Jiri Olsa <jolsa@...hat.com>
> CC: Andrew Vagin <avagin@...nvz.org>

Acked-by: Andrew Vagin <avagin@...nvz.org>


> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index c4582bb..0902d4a 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -4130,8 +4130,12 @@ void perf_prepare_sample(struct perf_event_header *header,
>  
>  	if (sample_type & PERF_SAMPLE_CALLCHAIN) {
>  		int size = 1;
> +		int kernel = !event->attr.exclude_callchain_kernel;
> +		int user   = !event->attr.exclude_callchain_user;
>  
> -		data->callchain = perf_callchain(event, regs);
> +		if (kernel || user)
> +			data->callchain = perf_callchain(event, regs,
> +							 kernel, user);
I am not sure, that we need two arguments kernel and user here,
we can get them from event inside perf_callchain...
>  
>  		if (data->callchain)
>  			size += data->callchain->nr;
> diff --git a/kernel/events/internal.h b/kernel/events/internal.h
> index ce7bdfc..95d0215 100644
> --- a/kernel/events/internal.h
> +++ b/kernel/events/internal.h
> @@ -126,7 +126,8 @@ DEFINE_OUTPUT_COPY(__output_copy_user, arch_perf_out_copy_user)
>  
>  /* Callchain handling */
>  extern struct perf_callchain_entry *
> -perf_callchain(struct perf_event *event, struct pt_regs *regs);
> +perf_callchain(struct perf_event *event, struct pt_regs *regs,
> +	       int kernel, int user);
>  extern int get_callchain_buffers(void);
>  extern void put_callchain_buffers(void);
>  
> -- 
> 1.7.7.6
> 
--
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