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: <20090416022305.GA22378@Krystal>
Date:	Wed, 15 Apr 2009 22:23:05 -0400
From:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Jeremy Fitzhardinge <jeremy@...p.org>, Ingo Molnar <mingo@...e.hu>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Problem with CREATE_TRACE_POINTS and recursion safety

* Steven Rostedt (rostedt@...dmis.org) wrote:
> 
> On Wed, 15 Apr 2009, Jeremy Fitzhardinge wrote:
> 
> > Steven Rostedt wrote:
> > > On Wed, 15 Apr 2009, Jeremy Fitzhardinge wrote:
> > > 
> > >   
> > > > I'm having a problem with CREATE_TRACE_POINTS being too indiscriminate.
> > > > The
> > > > trouble is that it not only creates tracepoint definitions for the
> > > > intended
> > > > tracepoints, but any other tracepoint definitions which get included
> > > > incidentally.
> > > > 
> > > > For example, I'm seeing my paravirt tracepoints being instantiated in both
> > > > kernel/sched.o and kernel/irq/manage.o as side-effects of the scheduler
> > > > and
> > > > irq tracepoints being instantiated.
> > > > 
> > > > I'm experimenting with a different scheme, wherein a subsystem defines
> > > > CREATE_FOO_TRACE_POINTS in the .c file where it wants to instantiate the
> > > > tracepoints - rather than CREATE_TRACE_POINTS - and its trace/events/foo.h
> > > > does:
> > > > 
> > > >    #ifdef CREATE_FOO_TRACE_POINTS
> > > >    #undef CREATE_FOO_TRACE_POINTS	/* avoid infinite recursion */
> > > >    #include <trace/instantiate_trace.h>
> > > >    #else
> > > >    #include <trace/define_trace.h>
> > > >    #endif
> > > > 
> > > > where instantiate_trace.h is:
> > > > 
> > > >    #define CREATE_TRACE_POINTS
> > > >    #include <trace/define_trace.h>
> > > >    #undef CREATE_TRACE_POINTS
> 
> Have you tried:
> 
> #ifdef CREATE_PVOPS_TRACE_POINTS
> #define CREATE_TRACE_POINTS
> #include <trace/define_trace.h>
> #undef CREATE_TRACE_POINTS
> #endif
> 
> And in your C file do:
> 
> #define CREATE_PVOPS_TRACE_POINTS
> #include <trace/pvops.h>
> 
> ??
> 
> -- Steve

Jeremy brings up an interesting point. Given that we might eventually
include a few tracepoint header files in a given C file, but with the
intent of only "creating" the tracepoint callbacks for few of these, the
global "CREATE_TRACE_POINTS" flag makes little sense and seems like it
will easily lead to link-time errors.

Maybe we could consider requiring something like the following solution :

In the .c file :

#define CREATE_TRACE_POINTS
#include <trace/subsysa.h>
#undef CREATE_TRACE_POINTS

#include <trace/subsysb.h>

Where subsysa has its trace points callbacks created, but subsysb
doesn't. This seems half-way understandable, at least.

Mathieu

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
--
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