[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1337856262.9783.106.camel@laptop>
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