• Ivan Babrou's avatar
    Skip idle swapper threads, closes #1732 (#1741) · 799f46a7
    Ivan Babrou authored
    Run queue latency does not make much sense for idle `swapper` threads.
    
    The same happens in `perf sched`:
    
    * https://github.com/torvalds/linux/blob/v4.14/tools/perf/builtin-sched.c
    
    ```c
        /*
         * Ignore idle threads:
         */
        if (!strcmp(thread__comm_str(work_list->thread), "swapper"))
            return;
    ```
    
    ```c
    static bool is_idle_sample(struct perf_sample *sample,
    	       struct perf_evsel *evsel)
    {
        /* pid 0 == swapper == idle task */
        if (strcmp(perf_evsel__name(evsel), "sched:sched_switch") == 0)
            return perf_evsel__intval(evsel, sample, "prev_pid") == 0;
    
        return sample->pid == 0;
    }
    ```
    799f46a7
runqslower.py 7.25 KB