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: <20130726085730.GD27075@twins.programming.kicks-ass.net>
Date:	Fri, 26 Jul 2013 10:57:30 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Vince Weaver <vince@...ter.net>
Cc:	Adrian Hunter <adrian.hunter@...el.com>, mingo@...nel.org,
	hpa@...or.com, linux-kernel@...r.kernel.org, tglx@...utronix.de,
	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:perf/core] perf: Update perf_event_type documentation

On Thu, Jul 25, 2013 at 11:20:24PM -0400, Vince Weaver wrote:
> 
> On Thu, 25 Jul 2013, Adrian Hunter wrote:
> 
> > >> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> > >> index 0b1df41..00d8274 100644
> > >> --- a/include/uapi/linux/perf_event.h
> > >> +++ b/include/uapi/linux/perf_event.h
> > >> @@ -478,6 +478,16 @@ enum perf_event_type {
> > >>  	 * file will be supported by older perf tools, with these new optional
> > >>  	 * fields being ignored.
> > >>  	 *
> > >> +	 * struct sample_id {
> > >> +	 * 	{ u32			pid, tid; } && PERF_SAMPLE_TID
> > >> +	 * 	{ u64			time;     } && PERF_SAMPLE_TIME
> > >> +	 * 	{ u64			id;       } && PERF_SAMPLE_ID
> > >> +	 * 	{ u64			stream_id;} && PERF_SAMPLE_STREAM_ID
> > >> +	 * 	{ u32			cpu, res; } && PERF_SAMPLE_CPU
> > >> +	 * } && perf_event_attr::sample_id_all
> > >> +	 */
> > >> +
> 
> a thing that personally bothers me are these imaginary struct definitions 
> added as part of the documentation that aren't actually available in the 
> public perf_event.h
> 
> I can see why it's done, but it can be confusing picking out in later 
> definitions which struct fields are real and which ones are conceptual.

Would it help if we changed the syntax to not look as much as real C
would?

> > >> @@ -498,6 +508,7 @@ enum perf_event_type {
> > >>  	 *	struct perf_event_header	header;
> > >>  	 *	u64				id;
> > >>  	 *	u64				lost;
> > >> +	 * 	struct sample_id		sample_id;
> > >>  	 * };
> 
> This is what confused me; this documentation shows the sample_id
> as always being there, but in reality that struct is only there
> if perf_event_attr::sample_id_all is set.  
> 
> It might be clearer
> if you stuck the perf_event_attr::sample_id_all qualifier each
> place you add the sample_id field.

Ah, I actually considered that but then got lazy and used the 0 sized
struct idea :/


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