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, 24 May 2012 12:44:22 +0200
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	acme@...hat.com, mingo@...e.hu, paulus@...ba.org,
	cjashfor@...ux.vnet.ibm.com, fweisbec@...il.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, benjamin.redelings@...cent.org
Subject: Re: [PATCH 04/16] perf: Add ability to attach user stack dump to
 sample

On Wed, 2012-05-23 at 21:32 +0200, Jiri Olsa wrote:
> @@ -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 */
> +};
> +
> +/*
>   * 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;
>  }; 

And here we have a similarly weird set-up. If you're ever going to add
another type, you have to make another __u64 since clearly another type
cannot use sample_stack_user per the name.

Thus, if you get another size variable you might as well use that to
discover the state that is now sample_stack.



--
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