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: BZ#2421 - removing duplicate probe handlers


David Smith 写道:
> On Fri, 2006-07-21 at 14:13 -0500, David Smith wrote:
> [...]
> I've been working on this and here's an update.
> 
> I made a stab at removing duplicate functions.  I cheated and just
> hashed the args/body of functions to do comparisons.  All duplicate
> functions are redirected to the first copy found.  A patch is attached.
> 
> I'd appreciate any code comments.
> 

Hi David,

I tried this stap script:

probe kernel.function("sys_read"), kernel.function("sys_write")
{
        log("here")
}

but stap will still generate duplicated handlers after applying your
patch.

  sys_read-->enter_probe_896-->probe_896
  sys_write-->enter_probe_897-->probe_897

  enter_probe_896 and probe_896 are exactly a copy of enter_probe_897
and probe_897. It seems to me that this patch will determine if a
function is duplicated with another function by hashing its function
names and arguments. So semantic_pass_opt5 will think that
enter_probe_896 and enter_probe_897 are different and didn't optimize
for it. If so, maybe we have to do this optimization a little earlier,
 say, in semantic_pass_symbols() before calling
semantic_pass_optimize(). Am I right?

- Guanglei


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