lkml.org 
[lkml]   [2015]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/PATCH] perf sched: Implement 'perf sched runtime' command
On 8/25/15 1:07 AM, Namhyung Kim wrote:
> Hi David,
>
> On Mon, Aug 24, 2015 at 11:19:44PM -0700, David Ahern wrote:
>> On 8/24/15 11:11 PM, Namhyung Kim wrote:
>>>
>>> +static int perf_sched__read_runtime_events(struct perf_sched *sched)
>>> +{
>>> + const struct perf_evsel_str_handler handlers[] = {
>>> + { "sched:sched_switch", process_sched_switch_event, },
>>> + { "sched:sched_stat_runtime", process_sched_runtime_event, },
>>> + { "sched:sched_stat_sleep", process_sched_sleep_event, },
>>> + { "sched:sched_stat_wait", process_sched_wait_event, },
>>> + { "sched:sched_stat_iowait", process_sched_iowait_event, },
>>> + { "sched:sched_migrate_task", process_sched_migrate_task_event, },
>>> + };
>>
>> I like the concept (obviously since I have invested so much time in other
>> solutions). But... you cannot rely on the sched_stat tracepoints being
>> enabled. I believe it is a performance hit to have CONFIG_SCHEDSTATS enabled
>> and distributions (e.g., Fedora) do not have it enabled.
>
> Yes, I know that some distributions don't enable SCHEDSTATS. But as
> perf sched record already requires it, I think it's ok to use those
> events in other sched commands.
>
> Maybe we could fix 'perf sched record' not to requires SCHEDSTATS.

I was going to suggest that a couple of years ago. You can't rely on it
in production environments, so my timehist command for example used
other approximations. Then if it is enabled it balloons the data file.

> All commands in perf sched just use stat_runtime event currently. And
> I guess we can calculate/approximate the stat times using sched_switch
> events (and wakeup events) only. But it also requires changing other
> sched commands not to use sched_stat_runtime.

That's what I do in my 'perf sched timehist' command.

David



\
 
 \ /
  Last update: 2015-08-25 19:21    [W:1.166 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site