This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Storing lists of CPU on/off times
- From: William Cohen <wcohen at redhat dot com>
- To: "Paddie O'Brien" <paddieobrien at gmail dot com>, systemtap <systemtap at sourceware dot org>
- Date: Wed, 11 Jan 2017 13:09:44 -0500
- Subject: Re: Storing lists of CPU on/off times
- Authentication-results: sourceware.org; auth=none
- References: <CAOK12DbhEzG+DTxZsQj=w9KuSKM4DdVPEyuDUbz1A7QOBhBFxw@mail.gmail.com>
On 01/11/2017 12:24 PM, 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?
>
> Thanks.
>
Hi,
The cyclethief.stp example does something like that to provide histograms of time a single process is on and off a processor. (https://sourceware.org/systemtap/examples/process/cycle_thief.txt)
You might take a look at how it is getting that information by looking at the cyclethief.stp script in /usr/share/doc/systemtap*/examples/process/cycle_thief.stp.
-Will