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]
Message-ID: <20120521131930.GC23687@somewhere>
Date:	Mon, 21 May 2012 15:19:32 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	acme@...hat.com, a.p.zijlstra@...llo.nl, mingo@...e.hu,
	paulus@...ba.org, cjashfor@...ux.vnet.ibm.com, eranian@...gle.com,
	gorcunov@...nvz.org, tzanussi@...il.com, mhiramat@...hat.com,
	robert.richter@....com, fche@...hat.com,
	linux-kernel@...r.kernel.org, masami.hiramatsu.pt@...achi.com,
	drepper@...il.com, asharma@...com
Subject: Re: [PATCH 04/17] perf: Add ability to attach user stack dump to
 sample

On Wed, May 02, 2012 at 01:37:05PM +0200, Jiri Olsa wrote:
> Introducing new sample_type bit PERF_SAMPLE_STACK. Once set,
> the sample_stack value determines the stack which is going
> to be attached.
> 
> Currently only user level stack is supported, specified by
> PERF_SAMPLE_STACK_USER bit in sample_stack value. When set,
> the sample_stack_user value determines the size of the
> stack dump.
> 
> Beeing able to dump parts of the user stack, starting from the
> stack pointer, will be useful to make a post mortem dwarf CFI
> based stack unwinding.
> 
> Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
> Signed-off-by: Jiri Olsa <jolsa@...hat.com>
> ---
>  include/linux/perf_event.h |   20 ++++++++-
>  kernel/events/core.c       |  103 ++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 122 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> index dcda0f16..2e5f486 100644
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -131,8 +131,9 @@ enum perf_event_sample_format {
>  	PERF_SAMPLE_RAW				= 1U << 10,
>  	PERF_SAMPLE_BRANCH_STACK		= 1U << 11,
>  	PERF_SAMPLE_REGS			= 1U << 12,
> +	PERF_SAMPLE_STACK			= 1U << 13,
>  
> -	PERF_SAMPLE_MAX = 1U << 13,		/* non-ABI */
> +	PERF_SAMPLE_MAX = 1U << 14,		/* non-ABI */
>  };
>  
>  /*
> @@ -173,6 +174,15 @@ enum perf_sample_regs {
>  };
>  
>  /*
> + * Values for sample_stack when PERF_SAMPLE_STACK is set.
> + * Defines stack dump to be attached to the sample.
> + */
> +enum perf_sample_stack {
> +	PERF_SAMPLE_STACK_USER	= 1U << 0, /* user stack */
> +	PERF_SAMPLE_STACK_MAX	= 1U << 1, /* non-ABI */

Same problem than with regs, this doesn't allow several stack dumps types
in a single sample.

> +};
> +
> +/*
>   * The format of the data returned by read() on a perf event fd,
>   * as specified by attr.read_format:
>   *
> @@ -291,6 +301,14 @@ struct perf_event_attr {
>  	 * See asm/perf_regs.h for details.
>  	 */
>  	__u64	sample_regs_user;
> +
> +	__u64	sample_stack; /* enum perf_sample_stack */
> +
> +	/*
> +	 * Defines size of the user stack to dump on samples,
> +	 * for sample_stack PERF_SAMPLE_STACK_USER settings.
> +	 */
> +	__u64	sample_stack_user;

Do we need PERF_SAMPLE_STACK when we can already set 0 in sample_stack_user?
--
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