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.0905142227250.30591@gandalf.stny.rr.com>
Date:	Thu, 14 May 2009 22:27:40 -0400 (EDT)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Li Zefan <lizf@...fujitsu.com>
cc:	LKML <linux-kernel@...r.kernel.org>,
	Christoph Hellwig <hch@...radead.org>,
	Ingo Molnar <mingo@...e.hu>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [RFC] tracing: adding flags to events



On Fri, 15 May 2009, Li Zefan wrote:

> Steven Rostedt wrote:
> > Christoph has been asking about processing flags in the output. He rather 
> > not see c2, and rather see what those three bits are. This patch is 
> > an RFC to do just that. To test it out, I added the previous task state to 
> > sched switch and used the flag processing to the printk of the 
> > sched_switch event.
> > 
> > 
> > To add a flag, just add __print_flags to the TP_printk arguments.
> > 
> > 	TP_STRUCT__entry(
> > 		__field(	unsigned int,	flags		)
> > 	),
> > 
> > 	TP_printk("flags are %s", __print_flags(__entry->flags,
> > 			0, "BIT0", 1, "BIT1", 2, "BIT2", -1))
> > 
> > 
> > Thus __print_flags prototype would look like:
> > 
> > const char *__print_flags(long flags, ...);
> > 
> 
> How about __print_flags(long flags, char *delim, ...); ?
> 
> Take file mode for example, the output will be "rwx", but not "r|w|x".

Heh, sure, why not?

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