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: <alpine.DEB.2.00.0906100819500.30552@gandalf.stny.rr.com>
Date:	Wed, 10 Jun 2009 08:23:26 -0400 (EDT)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Christoph Hellwig <hch@...radead.org>
cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Minchan Kim <minchan.kim@...il.com>,
	Mel Gorman <mel@....ul.ie>, Rik van Riel <riel@...hat.com>,
	Pekka Enberg <penberg@...helsinki.fi>,
	Peter Zijlstra <peterz@...radead.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Theodore Tso <tytso@....edu>,
	Mathieu Desnoyers <compudj@...stal.dyndns.org>,
	Lai Jiangshan <laijs@...fujitsu.com>,
	Zhaolei <zhaolei@...fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Jason Baron <jbaron@...hat.com>,
	Jiaying Zhang <jiayingz@...gle.com>
Subject: Re: [RFC PATCH 3/5] tracing/events: modify irq print to new format


On Wed, 10 Jun 2009, Christoph Hellwig wrote:

> On Mon, Jun 08, 2009 at 09:45:37PM -0400, Steven Rostedt wrote:
> > -#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
> > -#define show_softirq_name(val)			\
> > -	__print_symbolic(val,			\
> > -			 softirq_name(HI),	\
> > -			 softirq_name(TIMER),	\
> > -			 softirq_name(NET_TX),	\
> > -			 softirq_name(NET_RX),	\
> > -			 softirq_name(BLOCK),	\
> > -			 softirq_name(TASKLET),	\
> > -			 softirq_name(SCHED),	\
> > -			 softirq_name(HRTIMER),	\
> > -			 softirq_name(RCU))
> > +#define softirq_name(sirq) sirq##_SOFTIRQ, #sirq
> > +#define show_softirq_name(val)						\
> > +	"%d=%s,%d=%s,%d=%s,%d=%s,%d=%s,%d=%s,%d=%s,%d=%s,%d=%s>",	\
> > +		softirq_name(HI),					\
> > +		softirq_name(TIMER),					\
> > +		softirq_name(NET_TX),					\
> > +		softirq_name(NET_RX),					\
> > +		softirq_name(BLOCK),					\
> > +		softirq_name(TASKLET),					\
> > +		softirq_name(SCHED),					\
> > +		softirq_name(HRTIMER),					\
> > +		softirq_name(RCU)
> 
> This is a massive readability and maintainabilit  regression over the
> old code.  I now need to add a useless and counter-intuitive %d=%s,
> boilerplate for every new flag I add instead ofa simple line-line
> array entry.
> 
> Also why does show_softirq_name get a val argument passed that's never
> used?  And no, I don't think

That was from the original, I forgot to remove it.

> %d=%s,%d=%s,%d=%s,%d=%s,%d=%s,%d=%s,%d=%s,%d=%s,%d=%s is an intuitive
> way to print an enum.

This is a helper macro and has nothing to do with the new format. In fact, 
I'd do something similar with the old format because currently without 
that "%d=%s,..." helper we get in the print format:

	HRTIMER_SOFTIRQ = "HRTIMER"

How is a user tool going to know what value HRTIMER_SOFTIRQ is?

This was a trick I used to evaluate the HRTIMER_SOFTIRQ to an actual 
number that might actually be useful for userland readers.

-- Steve

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