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: Writing tapset functions for multiple versions


> > A global integer instead of the string comparison could be set if you
> > are worried about the overhead. In the example above, tid() could be
> > saved in the probe alias body as a private global which would be sufficient
> > for identifying the desired function.
> 
> I'm not quite sure how saving tid() in a private global would work if
> you are probing more than one thread at a time. Or did I misunderstand
> your idea and your global is an array? If the private global is an
> array, now we've got 2 private global arrays (1 for version1.stp and 1
> for version2.stp).

A global scalar should suffice in this case. All we want is for the function
f in version1.stp to be called when version1/process is executed and likewise
for version2. The probe alias body in the above example would update the saved
tid() every time it's hit.

> 
> --
> David Smith
> dsmith@redhat.com
> Red Hat
> http://www.redhat.com
> 256.217.0141 (direct)
> 256.837.0057 (fax)
> 


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