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: task time tapset


On 10/09/2009 08:17 AM, Mark Wielaard wrote:
Hi,

As an addition to the proc_mem tapset I created a task_time tapset. Like
the process memory tapset it only works on the current task. But that
makes it really trivial to implement. I think it would be a nice
addition since it allows you to do these "pass based statistics" fully
dynamically (and they would of course also work with function probes, or
any other probe that targets user processes).

Looks good to me.


Since this doesn't operate on arbitrary tasks, I wonder if it would make sense to drop the "task_" prefix, like the functions in context.stp. Maybe time_string() sounds too generic though... just thinking aloud...

These are total user and system times. It doesn't include real time atm.
In theory this can be gotten. The task struct keeps the start time. But
this is in monotonic or boot time and we currently only have daytime. It
shouldn't be too hard to add that, but I didn't want to do that atm.
Recent kernels export a per cpu_clock() (based on sched_clock) that
might be helpful.

Yes please! I don't think real time is that critical here, but I think that this clock source would be very useful in general. Most uses now of gettimeofday are just to measure time elapsed, and a monotonic clock is much more appropriate for that. It can fall back on gettimeofday for older kernels.


Josh


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