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: Storing lists of CPU on/off times


With some post processing I can make timestamps[execname(), count] do
what I need.

Switched to threads as recommended. I can now see that a switch like
vlc ---> vlc was actually a switch between two threads in same
process.

Had a look at cycle_thief.stp but it appears to use an associative
array to map to aggregates which wasn't really what I wanted since it
threw away the individual timestamps.

Thank you.

On 11 January 2017 at 19:06, Josh Stone <jistone@redhat.com> wrote:
> On 01/11/2017 09:24 AM, Paddie O'Brien wrote:
>> Hi,
>>
>> I want to store a per process list of CPU on/off times. So in probe
>> scheduler.cpu_on I had hoped to do something like:
>>
>> timestamps[execname()][count] = gettimeofday_us()
>> count++
>>
>> This above is illegal but illustrates what I'm trying to do. Can it be done?
>
> You can't nest the data structure like that, but you *can* use multiple
> indexes, like:
>
>     timestamps[execname(), count] = gettimeofday_us()
>
> I'd be wary of execname() for this though, since there could be multiple
> processes with the same name.  I suppose that depends on what you need
> to do with this data, but pid() is probably a better choice.
>
> Further, you may want to track the scheduling of threads in particular,
> since that's the actual unit which is scheduled on/off of CPUs, so then
> you'd index by tid().


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