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: timing system calls or other functions


2010/1/11 PrzemysÅaw PaweÅczyk <przemyslaw@pawelczyk.it>:
> On Tue, Jan 12, 2010 at 01:09, Ivan Novick <novickivan@gmail.com> wrote:
>> Is there a way to write an if statement that checks for the presence
>> of a key in an associative array? ÂThan the solution would seem
>> straightforward.
>
> Yes, ([key1, key2, ...] in array)
>
>> The other question is regarding multi-threading. ÂPresumably the same
>> system call can be made from the same process multiple times before
>> exiting, so my associate array should probably be keyed on pid, tid,
>> and syscall name. ÂCorrect?
>
> Tid is system-wide unique, so pid is useless here. Tid and syscall
> name are sufficient as a key for begin timestamp, but only the last
> one per syscall. If you want to aggregate these times, you have to use
> another associative array with key = syscall name and add there your
> timestamp subtraction results via <<< operator.
>
> Look at my script below (it's not exactly what you're looking for, but
> it's close and should be helpful):

Great! Thank you,
Ivan Novick


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