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: user instruction tracing patch?

Dave Nomura <> writes:

> Have you had a chance to review the user instruction tracing patch I
> re-posted on 11/1?

Thanks for demonstrating the implementation as something layered
nicely on top of utrace.  (Sorry for not collecting my notes earlier.)

In order to integrate this facility nicely into systemtap, it should
be integrated as a first class probe point syntax.  You suggested:

  probe usr_itrace.single_step
  probe usr_itrace.block_step

but that's rather unspecific (particularly: which processes to
probe?).  So, here's a possibly better way.  The script-side interface
would look like:

  probe process(PID).itrace { }
  probe process(PID).btrace { }   # block trace
  probe process(NAME).itrace { }
  probe process(NAME).btrace { }

The name variant could be implemented by a startup-time mapping of
execname->pid.  There's probably a utrace hook that will let us be
notified of execs, so that we can keep the mapping up-to-date during
run time.

Since utrace will provide the pt_regs structure, the probe handler
bodies will be able to call e.g. backtrace(), probefunc(), and really
should have some structured access to the registers (a new tapset
function like register:long ("name") ?)

It's also a bit risky to expose the on/off functionality as explicit
functions (though an end-user script or tapset could be more assured
of proper cleanup using "probe end,error {...}".)  But of course it's
desirable to turn things on/off dynamically, so how?  A special case
of bug #4935 might be the ticket, once that is complete:

  probe process(PID).itrace if (condition) { }
  probe process(PID).function("NAME") { condition = 1 }
  probe process(PID).function("NAME").return { condition = 0 }

(The .function("NAME") stuff is of course waiting for symbolic
user-space probing support, in progress separately.)

It seems like with these three separate bits of incoming functions
(itrace, on-the-fly probe on/off, user-space probes), we should get a
comfortable user experience.

- FChE

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