On Tue, 2011-07-05 at 14:46 +0100, Dave Martin wrote:
On Tue, Jul 5, 2011 at 12:35 PM, Tixy tixy@yxit.co.uk wrote:
On Tue, 2011-07-05 at 12:01 +0100, Dave Martin wrote:
One question though -- how do we know when setting a probe whether the target instruction is ARM or Thumb?
I'm using the bottom bit of the probe address. The kprobes API lets you specify the probe location as a symbol
the_probe.symbol_name = "function_name";
or as an address
the_probe.addr = &function_name;
and both of these cases will work. If the address is obtained by another means which doesn't set bit zero to indicate thumb code, then it's going to go bang.
[...]
If there is automatic infrastructure for creating probe points in the middle of functions, this would also have to be careful to set the bit correctly, since by default the noted locations may not have the bit set correctly.
The kprobes struct has an 'offset' field which is used to specify an offset from the start of the specified function. If this is used for probes in the middle of functions then things will also be OK.
I forget exactly what such infrastructure may exist -- do you have ideas on this?
I haven't. It's a failing of mine that I haven't researched this enough to find these. Though from what I have come across that seems like it would be a thankless task - there seams to be many trace/debug/instrumentation frameworks in various states of newness, flux or disrepair. At UDS I was in one meeting where someone mentioned that one trace scheme was effectively dead, at the same time another meeting was talking about integrating it into Ubuntu!