This is the mail archive of the systemtap@sourceware.org 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: [RFC] Systemtap translator support for hardware breakpoints on


> > (I wonder if simple .read or .write would be sufficient as suffixes,
> > and let a script render both as 
> > 
> >    probe kernel.data(ADDRESS).write, probe kernel.data(ADDRESS).read
> > 
> > and let the translator collapse such duplication into the internal RW case.)
> 
> That sounds reasonable to me.

Let me add a wrinkle to this subject.  This may have been implied in what
you meant, but it's not obvious and it just occurred to me.

On x86 at least, you can't distinguish different kinds of hits.
If one debug register enables RW, then you just know that debug
register hit, not whether it was for a read or for a write.

So for:

probe kernel.data(0x1234).write, kernel.data(0x1234).read {
  same_stuff()
}

you can turn it into a RW breakpoint.  But for:

probe kernel.data(0x1234).write { one_thing() }
probe kernel.data(0x1234).read { another_thing() }

you cannot consolidate these into one RW breakpoint, because you
won't know which handler to run.  This is in contrast to e.g. two
kprobes at the same PC.  Those you can consolidate at translation
time so the module init code only inserts one kprobe and its handler
does both things.

Even for the same_stuff() case, it's not clear you can really 
consolidate them if something like pp() is used.  i.e., where the
name of the specific probe is part of the "stuff", it's not really
the same stuff any more.

On x86 you can distinguish this by just using two different debug
registers, one for the read and one for the write.  You can tell
which of the two hit.  Only if you don't care to distinguish them
can you use a single debug register set to RW.


Thanks,
Roland


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