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]
Date:	Mon, 20 Jul 2009 22:38:36 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Arjan van de Ven <arjan@...ux.intel.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...e.hu>,
	"Kok, Auke-jan H" <auke-jan.h.kok@...el.com>,
	Frédéric Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH] sched: Provide iowait counters

On Mon, 2009-07-20 at 16:26 -0400, Steven Rostedt wrote:
> > +#define _TRACE_PROFILE(call, proto, args, assign)                    \
> >  static void ftrace_profile_##call(proto)                             \
> >  {                                                                    \
> > -     extern void perf_tpcounter_event(int);                          \
> > -     perf_tpcounter_event(event_##call.id);                          \
> > +     extern void perf_tpcounter_event(int, u64, u64);                \
> > +     u64 addr = 0, count = 1;                                        \
> > +     { assign; }                                                     \
> > +     perf_tpcounter_event(event_##call.id, addr, count);             \
> 
> The problem here is that the assign also will do the :
> 
>        TP_fast_assign(
>                __entry->pid    = p->pid;
>                __entry->time   = time;
> 
> part, thus you will probably get errors in processing the __entry part.

Oh, right, no macros wrapping that..

> What about doing instead:
> 
>  TRACE_EVENT(sched_iowait,
>  
>         TP_PROTO(struct task_struct *p, u64 time),
>  
>         TP_ARGS(p, time),
>  
>         TP_STRUCT__entry(
>                 __field(pid_t, pid )
>                 __field(u64,   time)
>         ),
>  
>         TP_fast_assign(
>                 __entry->pid    = p->pid;
>                 __entry->time   = time;
>  
>         ) __perf_count(time),
> 
>         TP_printk("task %d waited for IO for %Lu ns",
>                 __entry->pid, __entry->time)
>  );
>  
> Then we could simply do:
> 
> #undef __perf_count
> #define __perf_count(a)
> 
> [ do all the ftrace event work ]
> 
> #undef TP_fast_assign
> #define TP_fast_assign(a...)
> 
> #undef __perf_count
> #define __perf_count(c) count = (c);

Hmm, should we maybe do something like:

	TP_fast_assign(
		...
	)
	TP_perf_assign(
		addr = 0;
		count = time;
	),

So we can extend it over time?

But otherwise, yes, looks nice. Lets make it happen ;-)

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