This is the mail archive of the mailing list for the systemtap project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Linux Kernel Markers 0.2 for Linux 2.6.17

Hi Randy,

Thanks for the comments, see below :

* Randy.Dunlap ( wrote:
> > +static inline void __mark_check_format(const char *fmt, ...)
> > +	__attribute__ ((format (printf, 1, 2)));
> > +void __mark_check_format(const char *fmt, ...) {  }
> That last line is confusing (to me).  What's it for?
> Is it just an empty (inline) function definition?
> If so, why repeat the void + function name?

The goal of this "empty" function is just to have to compiler check the string
format consistency.

I separated the function declaration and implementation because I have seen some
compilers complain about having the two merged together.

I will change it to

static inline __attribute__ ((format (printf, 1, 2)))
void __mark_check_format(const char *fmt, ...)
{ }

And hope every compiler will like it.

The empty implementation is because the function is called (must therefore be
implemented), but I expect the compiler to completely optimize it away.

> > --- /dev/null
> > +++ b/kernel/Kconfig.marker
> > @@ -0,0 +1,75 @@
> > +# Code markers configuration
> > +
> > +menu "Marker configuration"
> > +
> > +
> > +config MARK
> > +	bool "Enable MARK code markers"
> > +	default y
> Please justify using 'y' as the default value.

It has to be debated. The default for markers will put a symbol for all the
markers, so that kprobe can easily attach to it. It has no impact that I am
aware of except to boost the number of symbols.


OpenPGP public key:    
Key fingerprint:     8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]