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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1213992446.3223.195.camel@lappy.programming.kicks-ass.net>
Date:	Fri, 20 Jun 2008 22:07:25 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
Cc:	Masami Hiramatsu <mhiramat@...hat.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	"Frank Ch. Eigler" <fche@...hat.com>, Ingo Molnar <mingo@...e.hu>,
	LKML <linux-kernel@...r.kernel.org>,
	systemtap-ml <systemtap@...rces.redhat.com>,
	Hideo AOKI <haoki@...hat.com>
Subject: Re: [RFC][Patch 2/2] markers: example of irq regular kernel markers

On Fri, 2008-06-20 at 13:45 -0400, Mathieu Desnoyers wrote:

> All this work look good, thanks Masami! Sorry I did not find time to do
> it lately, I've been busy on other things. A small question though :
> since LTTng is configurable both as an external module or as an
> in-kernel tracer, I wonder if it would really hurt to add the format
> strings to DEFINE_TRACE, e.g. :
> 
> DEFINE_TRACE(name, prototype, format_string, args...)
> 
> which would give :
> 
> DEFINE_TRACE(irq_entry, (int irq_id, int kernel_mode), "%d %d",
>     irq_id, kernel_mode);
> 
> DEFINE_TRACE(irq_exit, (void), MARK_NOARGS);
> 
> and calling this in the kernel code :
> 
> trace_irq_entry(irq, (regs)?(!user_mode(regs)):(1));
> ...
> trace_irq_exit();
> 
> and for quick-and-dirty debug usage, one would add this to kernel code :
> 
> trace_mark(subsystem_event, "(int arg, struct task_struct *task)",
>  "%d %p", arg, current);

How would this work for:

DEFINE_TRACE(sched_switch, (struct task_struct *prev, struct task_struct *next), prev, next);

You'd want a string like: "%d %d", prev->pid, next->pid
not: "%p %p", prev, next

perhaps we can do something like:

DEFINE_TRACER(sched_switch, (struct task_struct *prev, struct task_struct *next), prev, next,
		"%d %d", prev->pid, next->pid);

that defines a default tracer function for the previously defined trace
point. That way its optional, and allows for generic trace points.

Of course, all this could be ruined by reality - C really sucks wrt
forwarding functions.. :-/

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