Re: [PATCH] Linux Kernel Markers 0.11 for 2.6.17

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

* Frank Ch. Eigler ([email protected]) wrote:
> Hi -
> 
> > [...]
> > - It _does not_ change the compiler optimisations.
> 
> Like any similar mechanism, it does force the compiler to change its
> code generation, so one can't claim this too strongly.
> 
Yes, memory dependencies are changed, you are right. I was principally talking
about the inline and unrolled loops optimisations.


> > [...]  Comments are welcome,
> 
> I'm still uneasy about the use of varargs.  The current code now uses
> the formatting string as metadata to be matched (strcmp) between
> producer and consumer.  A general tool that would use them would have
> to start parsing general printf directives.

If you want to generate probes automatically, yes.

> I believe they are not
> quite general enough either e.g. to describe a raw binary blob.
> 
If you want to dump a raw binary blob, what about :
MARK(mysubsys_myevent, "char %p %u", blobptr, blobsize);
where %p is a pointer to an array of char and %u the length ?

My idea is to use the string to identify what is referred by a pointer, so it
can be casted into this type with some kind of coherency between the marker and
the probe.

> I realize they serve a useful purpose in abbreviating what otherwise
> one might have to do (like that multiplicity of STAP_MARK_* type/arity
> permutations).  But maybe there is a better way.
> 

I think that duplicating the number of marker macros could easily make
them unflexible and ugly. This is why I am trying to come with this generic
macro.

> Also, while regparm(0) may provide some comfort on x86, is there good
> reason to believe that the same trick works (and will continue to
> work) on non-x86 platforms to invoke a non-varargs callee with a
> varargs caller?
> 

Good point, I will setup a va_args in the probe. When correctly used, however,
there is no need to use the format string : we can directly get the variables
from the var arg list if we know in advance what the string will be.

Mathieu

OpenPGP public key:              http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint:     8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68 

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux