Re: [PATCH] Linux Kernel Markers 0.5 for Linux 2.6.17 (with probe management)

Jeremy Fitzhardinge
2006-09-21T19:54:10Z

Ingo Molnar wrote:
> let me qualify that: parameters must be prepared there too - but no
> actual function call inserted. (at most a NOP inserted). The register
> filling doesnt even have to be function-calling-convention compliant -
> that makes the symbolic probe almost zero-impact to register
> allocation/scheduling, the only thing it should ensure is that the
> parameters that are annotated to be available in register, stack or
> memory _somewhere_. (i.e. not hidden or destroyed at that point by gcc)
> Does a simple asm() that takes read-only parameters but only adds a NOP
> achieve this result?

Do you mean using the asm to make sure gcc puts a reference to a
variable into the DWARF info, or some other way of encoding the value
locations?

Hm, another problem. If the mark is in a loop, and gcc decides to
unroll the loop, then you'll probably only get a mark in one iteration
of the loop (or 1/Nth of the iterations). Or worse, assembler errors.
The only way I can see to deal with this is to not use symbols, but put
records in a special section. That way, if the asm() inserting them
gets duplicated, you'll get duplicate records in the marker section.

I guess you'd get a similar problem with markers inserted in inlined
functions.

(How does gdb deal with breakpoints in unrolled loops?)

J