Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH] tools/perf/sched: Update process names of processes in zombie state for both -s and -S options
@ 2026-04-26  9:39 Athira Rajeev
  2026-04-27  5:56 ` Namhyung Kim
  2026-04-27  6:43 ` Venkat
  0 siblings, 2 replies; 8+ messages in thread
From: Athira Rajeev @ 2026-04-26  9:39 UTC (permalink / raw)
  To: acme, jolsa, adrian.hunter, mpetlan, tmricht, maddy, irogers,
	namhyung
  Cc: linux-perf-users, linuxppc-dev, atrajeev, hbathini, Tejas.Manhas1,
	Tanushree.Shah, Shivani.Nittor

In redhat perftool testsuite, observed fail for this test:
    -- [ FAIL ] -- perf_sched :: test_timehist :: --with-summary (output regexp parsing)

This led to analysis of "perf sched timehist" summary options.

  # perf sched record -a -o ./perf.data -- sleep 0.1
   This will record using perf sched record

perf sched timeliest has two options "-s" and "-S"
  # perf sched -i ./perf.data timehist -S
 -S : Captures summary also at the end

  # perf sched -i ./perf.data timehist -s
 -s : Captures only summary

The test saves -s result which has only summary and compares with
summary which comes at the end from -S . Since there is a difference
in these two, test fails.

Checking the behaviour change in -S and -s results, difference is:

                  rcu_sched[16]       2          4        0.013      0.001       0.003       0.006   33.23       0
               migration/11[73]       2          1        0.006      0.006       0.006       0.006    0.00       0
                migration/3[33]       2          1        0.006      0.006       0.006       0.006    0.00       0
 -               :216753[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
 +                 sleep[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
                migration/8[58]       2          1        0.005      0.005       0.005       0.005    0.00       0
            NetworkManager[811]       1          2        0.089      0.028       0.044       0.060   36.06       0
               migration/13[83]       2          1        0.005      0.005       0.005       0.005    0.00       0

Here 216753 is pid for sleep which is a zombie process. This is
happening in latest kernel due to an update in "-S" result.
In -S, the process name appears in the results "sleep[216753]",
where as in the -s, only pid is present in the summary result
":216753[216753]".

After commit 39f473f6d0b2 ("perf sched timehist: decode process names
of processes in zombie state")
for -S option, if process name is using pid, it uses different way to
set it. So that we get the process name and not just Pid.

This change went in only for timehist_print_sample() function.
Add this improvement in generic place so that even -s option (which
captures summary) also will have meaningful information.

Signed-off-by: Athira Rajeev <atrajeev@linux.ibm.com>
---
 tools/perf/builtin-sched.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 555247568e7a..ee1b89a6af50 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -2197,11 +2197,6 @@ static void timehist_print_sample(struct perf_sched *sched,
 		printf(" ");
 	}
 
-	if (!thread__comm_set(thread)) {
-                const char *prev_comm = evsel__strval(evsel, sample, "prev_comm");
-                thread__set_comm(thread, prev_comm, sample->time);
-        }
-
 	printf(" %-*s ", comm_width, timehist_get_commstr(thread));
 
 	if (sched->show_prio)
@@ -2890,6 +2885,15 @@ static int timehist_sched_change_event(const struct perf_tool *tool,
 			itr->last_thread = NULL;
 		}
 
+		/*
+		 * If the process name is not set for the thread, use "prev_comm"
+		 * to set it. Otherwise the sched summary will have just pid information
+		 */
+		if (!thread__comm_set(thread)) {
+			const char *prev_comm = evsel__strval(evsel, sample, "prev_comm");
+			thread__set_comm(thread, prev_comm, sample->time);
+		}
+
 		if (!sched->summary_only)
 			timehist_print_sample(sched, evsel, sample, &al, thread, t, state);
 	}
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] tools/perf/sched: Update process names of processes in zombie state for both -s and -S options
  2026-04-26  9:39 [PATCH] tools/perf/sched: Update process names of processes in zombie state for both -s and -S options Athira Rajeev
@ 2026-04-27  5:56 ` Namhyung Kim
  2026-05-21  8:32   ` Athira Rajeev
  2026-04-27  6:43 ` Venkat
  1 sibling, 1 reply; 8+ messages in thread
From: Namhyung Kim @ 2026-04-27  5:56 UTC (permalink / raw)
  To: Athira Rajeev
  Cc: acme, jolsa, adrian.hunter, mpetlan, tmricht, maddy, irogers,
	linux-perf-users, linuxppc-dev, hbathini, Tejas.Manhas1,
	Tanushree.Shah, Shivani.Nittor

On Sun, Apr 26, 2026 at 03:09:30PM +0530, Athira Rajeev wrote:
> In redhat perftool testsuite, observed fail for this test:
>     -- [ FAIL ] -- perf_sched :: test_timehist :: --with-summary (output regexp parsing)
> 
> This led to analysis of "perf sched timehist" summary options.
> 
>   # perf sched record -a -o ./perf.data -- sleep 0.1
>    This will record using perf sched record
> 
> perf sched timeliest has two options "-s" and "-S"
>   # perf sched -i ./perf.data timehist -S
>  -S : Captures summary also at the end
> 
>   # perf sched -i ./perf.data timehist -s
>  -s : Captures only summary
> 
> The test saves -s result which has only summary and compares with
> summary which comes at the end from -S . Since there is a difference
> in these two, test fails.
> 
> Checking the behaviour change in -S and -s results, difference is:
> 
>                   rcu_sched[16]       2          4        0.013      0.001       0.003       0.006   33.23       0
>                migration/11[73]       2          1        0.006      0.006       0.006       0.006    0.00       0
>                 migration/3[33]       2          1        0.006      0.006       0.006       0.006    0.00       0
>  -               :216753[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
>  +                 sleep[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
>                 migration/8[58]       2          1        0.005      0.005       0.005       0.005    0.00       0
>             NetworkManager[811]       1          2        0.089      0.028       0.044       0.060   36.06       0
>                migration/13[83]       2          1        0.005      0.005       0.005       0.005    0.00       0
> 
> Here 216753 is pid for sleep which is a zombie process. This is
> happening in latest kernel due to an update in "-S" result.
> In -S, the process name appears in the results "sleep[216753]",
> where as in the -s, only pid is present in the summary result
> ":216753[216753]".
> 
> After commit 39f473f6d0b2 ("perf sched timehist: decode process names
> of processes in zombie state")
> for -S option, if process name is using pid, it uses different way to
> set it. So that we get the process name and not just Pid.
> 
> This change went in only for timehist_print_sample() function.
> Add this improvement in generic place so that even -s option (which
> captures summary) also will have meaningful information.
> 
> Signed-off-by: Athira Rajeev <atrajeev@linux.ibm.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/builtin-sched.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index 555247568e7a..ee1b89a6af50 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -2197,11 +2197,6 @@ static void timehist_print_sample(struct perf_sched *sched,
>  		printf(" ");
>  	}
>  
> -	if (!thread__comm_set(thread)) {
> -                const char *prev_comm = evsel__strval(evsel, sample, "prev_comm");
> -                thread__set_comm(thread, prev_comm, sample->time);
> -        }
> -
>  	printf(" %-*s ", comm_width, timehist_get_commstr(thread));
>  
>  	if (sched->show_prio)
> @@ -2890,6 +2885,15 @@ static int timehist_sched_change_event(const struct perf_tool *tool,
>  			itr->last_thread = NULL;
>  		}
>  
> +		/*
> +		 * If the process name is not set for the thread, use "prev_comm"
> +		 * to set it. Otherwise the sched summary will have just pid information
> +		 */
> +		if (!thread__comm_set(thread)) {
> +			const char *prev_comm = evsel__strval(evsel, sample, "prev_comm");
> +			thread__set_comm(thread, prev_comm, sample->time);
> +		}
> +
>  		if (!sched->summary_only)
>  			timehist_print_sample(sched, evsel, sample, &al, thread, t, state);
>  	}
> -- 
> 2.47.3
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] tools/perf/sched: Update process names of processes in zombie state for both -s and -S options
  2026-04-26  9:39 [PATCH] tools/perf/sched: Update process names of processes in zombie state for both -s and -S options Athira Rajeev
  2026-04-27  5:56 ` Namhyung Kim
@ 2026-04-27  6:43 ` Venkat
  1 sibling, 0 replies; 8+ messages in thread
From: Venkat @ 2026-04-27  6:43 UTC (permalink / raw)
  To: Athira Rajeev
  Cc: acme, jolsa, adrian.hunter, mpetlan, tmricht, maddy, irogers,
	namhyung, linux-perf-users, linuxppc-dev, hbathini, Tejas.Manhas1,
	Tanushree.Shah, Shivani.Nittor



> On 26 Apr 2026, at 3:09 PM, Athira Rajeev <atrajeev@linux.ibm.com> wrote:
> 
> In redhat perftool testsuite, observed fail for this test:
>    -- [ FAIL ] -- perf_sched :: test_timehist :: --with-summary (output regexp parsing)
> 
> This led to analysis of "perf sched timehist" summary options.
> 
>  # perf sched record -a -o ./perf.data -- sleep 0.1
>   This will record using perf sched record
> 
> perf sched timeliest has two options "-s" and "-S"
>  # perf sched -i ./perf.data timehist -S
> -S : Captures summary also at the end
> 
>  # perf sched -i ./perf.data timehist -s
> -s : Captures only summary
> 
> The test saves -s result which has only summary and compares with
> summary which comes at the end from -S . Since there is a difference
> in these two, test fails.
> 
> Checking the behaviour change in -S and -s results, difference is:
> 
>                  rcu_sched[16]       2          4        0.013      0.001       0.003       0.006   33.23       0
>               migration/11[73]       2          1        0.006      0.006       0.006       0.006    0.00       0
>                migration/3[33]       2          1        0.006      0.006       0.006       0.006    0.00       0
> -               :216753[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
> +                 sleep[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
>                migration/8[58]       2          1        0.005      0.005       0.005       0.005    0.00       0
>            NetworkManager[811]       1          2        0.089      0.028       0.044       0.060   36.06       0
>               migration/13[83]       2          1        0.005      0.005       0.005       0.005    0.00       0
> 
> Here 216753 is pid for sleep which is a zombie process. This is
> happening in latest kernel due to an update in "-S" result.
> In -S, the process name appears in the results "sleep[216753]",
> where as in the -s, only pid is present in the summary result
> ":216753[216753]".
> 
> After commit 39f473f6d0b2 ("perf sched timehist: decode process names
> of processes in zombie state")
> for -S option, if process name is using pid, it uses different way to
> set it. So that we get the process name and not just Pid.
> 
> This change went in only for timehist_print_sample() function.
> Add this improvement in generic place so that even -s option (which
> captures summary) also will have meaningful information.
> 
> Signed-off-by: Athira Rajeev <atrajeev@linux.ibm.com>
> ---

Tested this patch, by applying on top of mainline kernel.

WithOut Fix:

# ./perf sched -i perf.data timehist -s
Samples of sched_switch event do not have callchains.

Runtime summary
                          comm  parent   sched-in     run-time    min-run     avg-run     max-run  stddev  migrations
                                          (count)       (msec)     (msec)      (msec)      (msec)       %
---------------------------------------------------------------------------------------------------------------------
              migration/14[88]       2          1        0.006      0.006       0.006       0.006    0.00       0
               migration/6[48]       2          1        0.008      0.008       0.008       0.008    0.00       0
               rcu_preempt[16]       2          7        0.042      0.003       0.006       0.014   23.80       0
              migration/11[73]       2          1        0.010      0.010       0.010       0.010    0.00       0
               migration/3[33]       2          1        0.009      0.009       0.009       0.009    0.00       0
          sshd-session[384033]   384025          4        0.104      0.023       0.026       0.032    8.14       0
       kworker/u68:3-e[316378]       2          1        0.003      0.003       0.003       0.003    0.00       0
               kcompactd3[114]       2          1        0.003      0.003       0.003       0.003    0.00       0
               migration/8[58]       2          1        0.012      0.012       0.012       0.012    0.00       0
              migration/13[83]       2          1        0.008      0.008       0.008       0.008    0.00       0
               migration/5[43]       2          1        0.007      0.007       0.007       0.007    0.00       0
               migration/0[19]       2          1        0.010      0.010       0.010       0.010    0.00       0
              migration/10[68]       2          1        0.007      0.007       0.007       0.007    0.00       0
               ksoftirqd/5[44]       2          1        0.184      0.184       0.184       0.184    0.00       0
               migration/2[28]       2          1        0.008      0.008       0.008       0.008    0.00       0
       kworker/4:0-mm_[383676]       2          1        0.013      0.013       0.013       0.013    0.00       0
                  perf[390116]   384034         17        0.065      0.000       0.003       0.065   100.00       0
             xfsaild/dm-2[861]       2          1        0.008      0.008       0.008       0.008    0.00       0
              migration/15[93]       2          1        0.009      0.009       0.009       0.009    0.00       0
               :390117[390117]      -1          1        0.124      0.124       0.124       0.124    0.00       0
       kworker/9:4-mm_[390101]       2          1        0.069      0.069       0.069       0.069    0.00       0
               migration/7[53]       2          1        0.008      0.008       0.008       0.008    0.00       0
       kworker/5:0-xfs[390077]       2          1        0.015      0.015       0.015       0.015    0.00       0
              migration/12[78]       2          1        0.007      0.007       0.007       0.007    0.00       0
               migration/4[38]       2          1        0.005      0.005       0.005       0.005    0.00       0
           NetworkManager[903]       1          4        0.275      0.032       0.068       0.105   29.66       0
               migration/1[23]       2          1        0.010      0.010       0.010       0.010    0.00       0
               migration/9[63]       2          1        0.011      0.011       0.011       0.011    0.00       0



With FIX:

# ./perf sched -i perf.data timehist -s
Samples of sched_switch event do not have callchains.

Runtime summary
                          comm  parent   sched-in     run-time    min-run     avg-run     max-run  stddev  migrations
                                          (count)       (msec)     (msec)      (msec)      (msec)       %
---------------------------------------------------------------------------------------------------------------------
              migration/14[88]       2          1        0.006      0.006       0.006       0.006    0.00       0
               migration/6[48]       2          1        0.008      0.008       0.008       0.008    0.00       0
               rcu_preempt[16]       2          7        0.042      0.003       0.006       0.014   23.80       0
              migration/11[73]       2          1        0.010      0.010       0.010       0.010    0.00       0
               migration/3[33]       2          1        0.009      0.009       0.009       0.009    0.00       0
          sshd-session[384033]   384025          4        0.104      0.023       0.026       0.032    8.14       0
       kworker/u68:3-e[316378]       2          1        0.003      0.003       0.003       0.003    0.00       0
               kcompactd3[114]       2          1        0.003      0.003       0.003       0.003    0.00       0
               migration/8[58]       2          1        0.012      0.012       0.012       0.012    0.00       0
              migration/13[83]       2          1        0.008      0.008       0.008       0.008    0.00       0
               migration/5[43]       2          1        0.007      0.007       0.007       0.007    0.00       0
               migration/0[19]       2          1        0.010      0.010       0.010       0.010    0.00       0
              migration/10[68]       2          1        0.007      0.007       0.007       0.007    0.00       0
               ksoftirqd/5[44]       2          1        0.184      0.184       0.184       0.184    0.00       0
               migration/2[28]       2          1        0.008      0.008       0.008       0.008    0.00       0
       kworker/4:0-mm_[383676]       2          1        0.013      0.013       0.013       0.013    0.00       0
                  perf[390116]   384034         17        0.065      0.000       0.003       0.065   100.00       0
             xfsaild/dm-2[861]       2          1        0.008      0.008       0.008       0.008    0.00       0
              migration/15[93]       2          1        0.009      0.009       0.009       0.009    0.00       0
                 sleep[390117]      -1          1        0.124      0.124       0.124       0.124    0.00       0
       kworker/9:4-mm_[390101]       2          1        0.069      0.069       0.069       0.069    0.00       0
               migration/7[53]       2          1        0.008      0.008       0.008       0.008    0.00       0
       kworker/5:0-xfs[390077]       2          1        0.015      0.015       0.015       0.015    0.00       0
              migration/12[78]       2          1        0.007      0.007       0.007       0.007    0.00       0
               migration/4[38]       2          1        0.005      0.005       0.005       0.005    0.00       0
           NetworkManager[903]       1          4        0.275      0.032       0.068       0.105   29.66       0
               migration/1[23]       2          1        0.010      0.010       0.010       0.010    0.00       0
               migration/9[63]       2          1        0.011      0.011       0.011       0.011    0.00       0

Please add below tag.

Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>

Regards,
Venkat.
> tools/perf/builtin-sched.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index 555247568e7a..ee1b89a6af50 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -2197,11 +2197,6 @@ static void timehist_print_sample(struct perf_sched *sched,
> printf(" ");
> }
> 
> - if (!thread__comm_set(thread)) {
> -                const char *prev_comm = evsel__strval(evsel, sample, "prev_comm");
> -                thread__set_comm(thread, prev_comm, sample->time);
> -        }
> -
> printf(" %-*s ", comm_width, timehist_get_commstr(thread));
> 
> if (sched->show_prio)
> @@ -2890,6 +2885,15 @@ static int timehist_sched_change_event(const struct perf_tool *tool,
> itr->last_thread = NULL;
> }
> 
> + /*
> + * If the process name is not set for the thread, use "prev_comm"
> + * to set it. Otherwise the sched summary will have just pid information
> + */
> + if (!thread__comm_set(thread)) {
> + const char *prev_comm = evsel__strval(evsel, sample, "prev_comm");
> + thread__set_comm(thread, prev_comm, sample->time);
> + }
> +
> if (!sched->summary_only)
> timehist_print_sample(sched, evsel, sample, &al, thread, t, state);
> }
> -- 
> 2.47.3
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] tools/perf/sched: Update process names of processes in zombie state for both -s and -S options
  2026-04-27  5:56 ` Namhyung Kim
@ 2026-05-21  8:32   ` Athira Rajeev
  2026-05-21 14:17     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 8+ messages in thread
From: Athira Rajeev @ 2026-05-21  8:32 UTC (permalink / raw)
  To: Namhyung Kim, Ian Rogers, Arnaldo Carvalho de Melo
  Cc: jolsa, adrian.hunter, mpetlan, tmricht, maddy, linux-perf-users,
	linuxppc-dev, hbathini, Tejas.Manhas1, Tanushree.Shah,
	Shivani.Nittor



> On 27 Apr 2026, at 11:26 AM, Namhyung Kim <namhyung@kernel.org> wrote:
> 
> On Sun, Apr 26, 2026 at 03:09:30PM +0530, Athira Rajeev wrote:
>> In redhat perftool testsuite, observed fail for this test:
>>    -- [ FAIL ] -- perf_sched :: test_timehist :: --with-summary (output regexp parsing)
>> 
>> This led to analysis of "perf sched timehist" summary options.
>> 
>>  # perf sched record -a -o ./perf.data -- sleep 0.1
>>   This will record using perf sched record
>> 
>> perf sched timeliest has two options "-s" and "-S"
>>  # perf sched -i ./perf.data timehist -S
>> -S : Captures summary also at the end
>> 
>>  # perf sched -i ./perf.data timehist -s
>> -s : Captures only summary
>> 
>> The test saves -s result which has only summary and compares with
>> summary which comes at the end from -S . Since there is a difference
>> in these two, test fails.
>> 
>> Checking the behaviour change in -S and -s results, difference is:
>> 
>>                  rcu_sched[16]       2          4        0.013      0.001       0.003       0.006   33.23       0
>>               migration/11[73]       2          1        0.006      0.006       0.006       0.006    0.00       0
>>                migration/3[33]       2          1        0.006      0.006       0.006       0.006    0.00       0
>> -               :216753[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
>> +                 sleep[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
>>                migration/8[58]       2          1        0.005      0.005       0.005       0.005    0.00       0
>>            NetworkManager[811]       1          2        0.089      0.028       0.044       0.060   36.06       0
>>               migration/13[83]       2          1        0.005      0.005       0.005       0.005    0.00       0
>> 
>> Here 216753 is pid for sleep which is a zombie process. This is
>> happening in latest kernel due to an update in "-S" result.
>> In -S, the process name appears in the results "sleep[216753]",
>> where as in the -s, only pid is present in the summary result
>> ":216753[216753]".
>> 
>> After commit 39f473f6d0b2 ("perf sched timehist: decode process names
>> of processes in zombie state")
>> for -S option, if process name is using pid, it uses different way to
>> set it. So that we get the process name and not just Pid.
>> 
>> This change went in only for timehist_print_sample() function.
>> Add this improvement in generic place so that even -s option (which
>> captures summary) also will have meaningful information.
>> 
>> Signed-off-by: Athira Rajeev <atrajeev@linux.ibm.com>
> 
> Acked-by: Namhyung Kim <namhyung@kernel.org>
> 
> Thanks,
> Namhyung
Hi,

Can we please have this pulled in, if the patch looks fine ?

Thanks
Athira
> 
>> ---
>> tools/perf/builtin-sched.c | 14 +++++++++-----
>> 1 file changed, 9 insertions(+), 5 deletions(-)
>> 
>> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
>> index 555247568e7a..ee1b89a6af50 100644
>> --- a/tools/perf/builtin-sched.c
>> +++ b/tools/perf/builtin-sched.c
>> @@ -2197,11 +2197,6 @@ static void timehist_print_sample(struct perf_sched *sched,
>> printf(" ");
>> }
>> 
>> - if (!thread__comm_set(thread)) {
>> -                const char *prev_comm = evsel__strval(evsel, sample, "prev_comm");
>> -                thread__set_comm(thread, prev_comm, sample->time);
>> -        }
>> -
>> printf(" %-*s ", comm_width, timehist_get_commstr(thread));
>> 
>> if (sched->show_prio)
>> @@ -2890,6 +2885,15 @@ static int timehist_sched_change_event(const struct perf_tool *tool,
>> itr->last_thread = NULL;
>> }
>> 
>> + /*
>> +  * If the process name is not set for the thread, use "prev_comm"
>> +  * to set it. Otherwise the sched summary will have just pid information
>> +  */
>> + if (!thread__comm_set(thread)) {
>> + const char *prev_comm = evsel__strval(evsel, sample, "prev_comm");
>> + thread__set_comm(thread, prev_comm, sample->time);
>> + }
>> +
>> if (!sched->summary_only)
>> timehist_print_sample(sched, evsel, sample, &al, thread, t, state);
>> }
>> -- 
>> 2.47.3



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] tools/perf/sched: Update process names of processes in zombie state for both -s and -S options
  2026-05-21  8:32   ` Athira Rajeev
@ 2026-05-21 14:17     ` Arnaldo Carvalho de Melo
  2026-06-04 14:17       ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2026-05-21 14:17 UTC (permalink / raw)
  To: Athira Rajeev
  Cc: Namhyung Kim, Ian Rogers, jolsa, adrian.hunter, mpetlan, tmricht,
	maddy, linux-perf-users, linuxppc-dev, hbathini, Tejas.Manhas1,
	Tanushree.Shah, Shivani.Nittor

On Thu, May 21, 2026 at 02:02:53PM +0530, Athira Rajeev wrote:
> > On 27 Apr 2026, at 11:26 AM, Namhyung Kim <namhyung@kernel.org> wrote:
> > On Sun, Apr 26, 2026 at 03:09:30PM +0530, Athira Rajeev wrote:
> >> In redhat perftool testsuite, observed fail for this test:
> >>    -- [ FAIL ] -- perf_sched :: test_timehist :: --with-summary (output regexp parsing)
> >> 
> >> This led to analysis of "perf sched timehist" summary options.
> >> 
> >>  # perf sched record -a -o ./perf.data -- sleep 0.1
> >>   This will record using perf sched record
> >> 
> >> perf sched timeliest has two options "-s" and "-S"
> >>  # perf sched -i ./perf.data timehist -S
> >> -S : Captures summary also at the end
> >> 
> >>  # perf sched -i ./perf.data timehist -s
> >> -s : Captures only summary
> >> 
> >> The test saves -s result which has only summary and compares with
> >> summary which comes at the end from -S . Since there is a difference
> >> in these two, test fails.
> >> 
> >> Checking the behaviour change in -S and -s results, difference is:
> >> 
> >>                  rcu_sched[16]       2          4        0.013      0.001       0.003       0.006   33.23       0
> >>               migration/11[73]       2          1        0.006      0.006       0.006       0.006    0.00       0
> >>                migration/3[33]       2          1        0.006      0.006       0.006       0.006    0.00       0
> >> -               :216753[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
> >> +                 sleep[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
> >>                migration/8[58]       2          1        0.005      0.005       0.005       0.005    0.00       0
> >>            NetworkManager[811]       1          2        0.089      0.028       0.044       0.060   36.06       0
> >>               migration/13[83]       2          1        0.005      0.005       0.005       0.005    0.00       0
> >> 
> >> Here 216753 is pid for sleep which is a zombie process. This is
> >> happening in latest kernel due to an update in "-S" result.
> >> In -S, the process name appears in the results "sleep[216753]",
> >> where as in the -s, only pid is present in the summary result
> >> ":216753[216753]".
> >> 
> >> After commit 39f473f6d0b2 ("perf sched timehist: decode process names
> >> of processes in zombie state")
> >> for -S option, if process name is using pid, it uses different way to
> >> set it. So that we get the process name and not just Pid.
> >> 
> >> This change went in only for timehist_print_sample() function.
> >> Add this improvement in generic place so that even -s option (which
> >> captures summary) also will have meaningful information.
> >> 
> >> Signed-off-by: Athira Rajeev <atrajeev@linux.ibm.com>
> > 
> > Acked-by: Namhyung Kim <namhyung@kernel.org>
> > 
> > Thanks,
> > Namhyung
> Hi,
> 
> Can we please have this pulled in, if the patch looks fine ?

Can you please check applying it on top of current perf-tools-next?

Thanks,

- Arnaldo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] tools/perf/sched: Update process names of processes in zombie state for both -s and -S options
  2026-05-21 14:17     ` Arnaldo Carvalho de Melo
@ 2026-06-04 14:17       ` Arnaldo Carvalho de Melo
  2026-06-04 15:08         ` Athira Rajeev
  0 siblings, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2026-06-04 14:17 UTC (permalink / raw)
  To: Athira Rajeev, Anubhav Shelat
  Cc: Namhyung Kim, Ian Rogers, jolsa, adrian.hunter, mpetlan, tmricht,
	maddy, linux-perf-users, linuxppc-dev, hbathini, Tejas.Manhas1,
	Tanushree.Shah, Shivani.Nittor

On Thu, May 21, 2026 at 11:17:58AM -0300, Arnaldo Carvalho de Melo wrote:
> On Thu, May 21, 2026 at 02:02:53PM +0530, Athira Rajeev wrote:
> > > On 27 Apr 2026, at 11:26 AM, Namhyung Kim <namhyung@kernel.org> wrote:
> > > On Sun, Apr 26, 2026 at 03:09:30PM +0530, Athira Rajeev wrote:
> > >> In redhat perftool testsuite, observed fail for this test:
> > >>    -- [ FAIL ] -- perf_sched :: test_timehist :: --with-summary (output regexp parsing)
> > >> 
> > >> This led to analysis of "perf sched timehist" summary options.
> > >> 
> > >>  # perf sched record -a -o ./perf.data -- sleep 0.1
> > >>   This will record using perf sched record
> > >> 
> > >> perf sched timeliest has two options "-s" and "-S"
> > >>  # perf sched -i ./perf.data timehist -S
> > >> -S : Captures summary also at the end
> > >> 
> > >>  # perf sched -i ./perf.data timehist -s
> > >> -s : Captures only summary
> > >> 
> > >> The test saves -s result which has only summary and compares with
> > >> summary which comes at the end from -S . Since there is a difference
> > >> in these two, test fails.
> > >> 
> > >> Checking the behaviour change in -S and -s results, difference is:
> > >> 
> > >>                  rcu_sched[16]       2          4        0.013      0.001       0.003       0.006   33.23       0
> > >>               migration/11[73]       2          1        0.006      0.006       0.006       0.006    0.00       0
> > >>                migration/3[33]       2          1        0.006      0.006       0.006       0.006    0.00       0
> > >> -               :216753[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
> > >> +                 sleep[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
> > >>                migration/8[58]       2          1        0.005      0.005       0.005       0.005    0.00       0
> > >>            NetworkManager[811]       1          2        0.089      0.028       0.044       0.060   36.06       0
> > >>               migration/13[83]       2          1        0.005      0.005       0.005       0.005    0.00       0
> > >> 
> > >> Here 216753 is pid for sleep which is a zombie process. This is
> > >> happening in latest kernel due to an update in "-S" result.
> > >> In -S, the process name appears in the results "sleep[216753]",
> > >> where as in the -s, only pid is present in the summary result
> > >> ":216753[216753]".
> > >> 
> > >> After commit 39f473f6d0b2 ("perf sched timehist: decode process names
> > >> of processes in zombie state")
> > >> for -S option, if process name is using pid, it uses different way to
> > >> set it. So that we get the process name and not just Pid.
> > >> 
> > >> This change went in only for timehist_print_sample() function.
> > >> Add this improvement in generic place so that even -s option (which
> > >> captures summary) also will have meaningful information.
> > >> 
> > >> Signed-off-by: Athira Rajeev <atrajeev@linux.ibm.com>
> > > 
> > > Acked-by: Namhyung Kim <namhyung@kernel.org>
> > > 
> > > Thanks,
> > > Namhyung
> > Hi,
> > 
> > Can we please have this pulled in, if the patch looks fine ?
> 
> Can you please check applying it on top of current perf-tools-next?

So, this seems to be also addressed by:

commit 39f473f6d0b24cf375893f2110b1cc9d8a079a42
Author: Anubhav Shelat <ashelat@redhat.com>
Date:   Wed Jul 16 16:39:15 2025 -0400

    perf sched timehist: decode process names of processes in zombie state

    Previously when running perf trace timehist --state, when recording
    processes in the zombie state the process name would not be decoded
    properly and appears with just the PID:

    1140057.412177 [0006]  Mutter Input Th[3139/3104]          0.956      0.019      0.041      S
    1140057.412222 [0012]  :1248612[1248612]                   0.000      0.000      0.332      Z
    1140057.412275 [0004]  <idle>                              0.052      0.052      0.953      I
    1140057.412284 [0008]  <idle>                              0.070      0.070      0.932      I
    1140057.412333 [0004]  KMS thread[3126/3104]               0.953      0.112      0.058      S

    Now some extra processing has been added to decode the process name:

    1140057.412177 [0006]  Mutter Input Th[3139/3104]          0.956      0.019      0.041      S
    1140057.412222 [0012]  sleep[1248612]                      0.000      0.000      0.332      Z
    1140057.412275 [0004]  <idle>                              0.052      0.052      0.953      I
    1140057.412284 [0008]  <idle>                              0.070      0.070      0.932      I
    1140057.412333 [0004]  KMS thread[3126/3104]               0.953      0.112      0.058      S

    Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
    Link: https://lore.kernel.org/r/20250716203914.45772-2-ashelat@redhat.com
    Signed-off-by: Namhyung Kim <namhyung@kernel.org>


No? It is not applying to perf-tools-next, a quick look found the patch
above.

- Arnaldo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] tools/perf/sched: Update process names of processes in zombie state for both -s and -S options
  2026-06-04 14:17       ` Arnaldo Carvalho de Melo
@ 2026-06-04 15:08         ` Athira Rajeev
  2026-06-04 15:26           ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 8+ messages in thread
From: Athira Rajeev @ 2026-06-04 15:08 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Anubhav Shelat, Namhyung Kim, Ian Rogers, jolsa, adrian.hunter,
	mpetlan, tmricht, maddy, linux-perf-users, linuxppc-dev, hbathini,
	Tejas.Manhas1, Tanushree.Shah, Shivani.Nittor



> On 4 Jun 2026, at 7:47 PM, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> On Thu, May 21, 2026 at 11:17:58AM -0300, Arnaldo Carvalho de Melo wrote:
>> On Thu, May 21, 2026 at 02:02:53PM +0530, Athira Rajeev wrote:
>>>> On 27 Apr 2026, at 11:26 AM, Namhyung Kim <namhyung@kernel.org> wrote:
>>>> On Sun, Apr 26, 2026 at 03:09:30PM +0530, Athira Rajeev wrote:
>>>>> In redhat perftool testsuite, observed fail for this test:
>>>>>   -- [ FAIL ] -- perf_sched :: test_timehist :: --with-summary (output regexp parsing)
>>>>> 
>>>>> This led to analysis of "perf sched timehist" summary options.
>>>>> 
>>>>> # perf sched record -a -o ./perf.data -- sleep 0.1
>>>>>  This will record using perf sched record
>>>>> 
>>>>> perf sched timeliest has two options "-s" and "-S"
>>>>> # perf sched -i ./perf.data timehist -S
>>>>> -S : Captures summary also at the end
>>>>> 
>>>>> # perf sched -i ./perf.data timehist -s
>>>>> -s : Captures only summary
>>>>> 
>>>>> The test saves -s result which has only summary and compares with
>>>>> summary which comes at the end from -S . Since there is a difference
>>>>> in these two, test fails.
>>>>> 
>>>>> Checking the behaviour change in -S and -s results, difference is:
>>>>> 
>>>>>                 rcu_sched[16]       2          4        0.013      0.001       0.003       0.006   33.23       0
>>>>>              migration/11[73]       2          1        0.006      0.006       0.006       0.006    0.00       0
>>>>>               migration/3[33]       2          1        0.006      0.006       0.006       0.006    0.00       0
>>>>> -               :216753[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
>>>>> +                 sleep[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
>>>>>               migration/8[58]       2          1        0.005      0.005       0.005       0.005    0.00       0
>>>>>           NetworkManager[811]       1          2        0.089      0.028       0.044       0.060   36.06       0
>>>>>              migration/13[83]       2          1        0.005      0.005       0.005       0.005    0.00       0
>>>>> 
>>>>> Here 216753 is pid for sleep which is a zombie process. This is
>>>>> happening in latest kernel due to an update in "-S" result.
>>>>> In -S, the process name appears in the results "sleep[216753]",
>>>>> where as in the -s, only pid is present in the summary result
>>>>> ":216753[216753]".
>>>>> 
>>>>> After commit 39f473f6d0b2 ("perf sched timehist: decode process names
>>>>> of processes in zombie state")
>>>>> for -S option, if process name is using pid, it uses different way to
>>>>> set it. So that we get the process name and not just Pid.
>>>>> 
>>>>> This change went in only for timehist_print_sample() function.
>>>>> Add this improvement in generic place so that even -s option (which
>>>>> captures summary) also will have meaningful information.
>>>>> 
>>>>> Signed-off-by: Athira Rajeev <atrajeev@linux.ibm.com>
>>>> 
>>>> Acked-by: Namhyung Kim <namhyung@kernel.org>
>>>> 
>>>> Thanks,
>>>> Namhyung
>>> Hi,
>>> 
>>> Can we please have this pulled in, if the patch looks fine ?
>> 
>> Can you please check applying it on top of current perf-tools-next?
> 
> So, this seems to be also addressed by:
> 
> commit 39f473f6d0b24cf375893f2110b1cc9d8a079a42
> Author: Anubhav Shelat <ashelat@redhat.com>
> Date:   Wed Jul 16 16:39:15 2025 -0400
> 
>    perf sched timehist: decode process names of processes in zombie state
> 
>    Previously when running perf trace timehist --state, when recording
>    processes in the zombie state the process name would not be decoded
>    properly and appears with just the PID:
> 
>    1140057.412177 [0006]  Mutter Input Th[3139/3104]          0.956      0.019      0.041      S
>    1140057.412222 [0012]  :1248612[1248612]                   0.000      0.000      0.332      Z
>    1140057.412275 [0004]  <idle>                              0.052      0.052      0.953      I
>    1140057.412284 [0008]  <idle>                              0.070      0.070      0.932      I
>    1140057.412333 [0004]  KMS thread[3126/3104]               0.953      0.112      0.058      S
> 
>    Now some extra processing has been added to decode the process name:
> 
>    1140057.412177 [0006]  Mutter Input Th[3139/3104]          0.956      0.019      0.041      S
>    1140057.412222 [0012]  sleep[1248612]                      0.000      0.000      0.332      Z
>    1140057.412275 [0004]  <idle>                              0.052      0.052      0.953      I
>    1140057.412284 [0008]  <idle>                              0.070      0.070      0.932      I
>    1140057.412333 [0004]  KMS thread[3126/3104]               0.953      0.112      0.058      S
> 
>    Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
>    Link: https://lore.kernel.org/r/20250716203914.45772-2-ashelat@redhat.com
>    Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> 
> 
> No? It is not applying to perf-tools-next, a quick look found the patch
> above.

Hi Arnaldo

commit 39f473f6d0b2 ("perf sched timehist: decode process names
of processes in zombie state”)
added change for -S option. The patch I submitted is to add change in process name for “-s” option as well

I will check applying this on top of current perf-tools-next

Thanks
Athira


> 
> - Arnaldo



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] tools/perf/sched: Update process names of processes in zombie state for both -s and -S options
  2026-06-04 15:08         ` Athira Rajeev
@ 2026-06-04 15:26           ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2026-06-04 15:26 UTC (permalink / raw)
  To: Athira Rajeev
  Cc: Anubhav Shelat, Namhyung Kim, Ian Rogers, jolsa, adrian.hunter,
	mpetlan, tmricht, maddy, linux-perf-users, linuxppc-dev, hbathini,
	Tejas.Manhas1, Tanushree.Shah, Shivani.Nittor

On Thu, Jun 04, 2026 at 08:38:46PM +0530, Athira Rajeev wrote:
> > On 4 Jun 2026, at 7:47 PM, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > 
> > On Thu, May 21, 2026 at 11:17:58AM -0300, Arnaldo Carvalho de Melo wrote:
> >> On Thu, May 21, 2026 at 02:02:53PM +0530, Athira Rajeev wrote:
> >>>> On 27 Apr 2026, at 11:26 AM, Namhyung Kim <namhyung@kernel.org> wrote:
> >>>> On Sun, Apr 26, 2026 at 03:09:30PM +0530, Athira Rajeev wrote:
> >>>>> In redhat perftool testsuite, observed fail for this test:
> >>>>>   -- [ FAIL ] -- perf_sched :: test_timehist :: --with-summary (output regexp parsing)
> >>>>> 
> >>>>> This led to analysis of "perf sched timehist" summary options.
> >>>>> 
> >>>>> # perf sched record -a -o ./perf.data -- sleep 0.1
> >>>>>  This will record using perf sched record
> >>>>> 
> >>>>> perf sched timeliest has two options "-s" and "-S"
> >>>>> # perf sched -i ./perf.data timehist -S
> >>>>> -S : Captures summary also at the end
> >>>>> 
> >>>>> # perf sched -i ./perf.data timehist -s
> >>>>> -s : Captures only summary
> >>>>> 
> >>>>> The test saves -s result which has only summary and compares with
> >>>>> summary which comes at the end from -S . Since there is a difference
> >>>>> in these two, test fails.
> >>>>> 
> >>>>> Checking the behaviour change in -S and -s results, difference is:
> >>>>> 
> >>>>>                 rcu_sched[16]       2          4        0.013      0.001       0.003       0.006   33.23       0
> >>>>>              migration/11[73]       2          1        0.006      0.006       0.006       0.006    0.00       0
> >>>>>               migration/3[33]       2          1        0.006      0.006       0.006       0.006    0.00       0
> >>>>> -               :216753[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
> >>>>> +                 sleep[216753]      -1          1        0.041      0.041       0.041       0.041    0.00       0
> >>>>>               migration/8[58]       2          1        0.005      0.005       0.005       0.005    0.00       0
> >>>>>           NetworkManager[811]       1          2        0.089      0.028       0.044       0.060   36.06       0
> >>>>>              migration/13[83]       2          1        0.005      0.005       0.005       0.005    0.00       0
> >>>>> 
> >>>>> Here 216753 is pid for sleep which is a zombie process. This is
> >>>>> happening in latest kernel due to an update in "-S" result.
> >>>>> In -S, the process name appears in the results "sleep[216753]",
> >>>>> where as in the -s, only pid is present in the summary result
> >>>>> ":216753[216753]".
> >>>>> 
> >>>>> After commit 39f473f6d0b2 ("perf sched timehist: decode process names
> >>>>> of processes in zombie state")
> >>>>> for -S option, if process name is using pid, it uses different way to
> >>>>> set it. So that we get the process name and not just Pid.
> >>>>> 
> >>>>> This change went in only for timehist_print_sample() function.
> >>>>> Add this improvement in generic place so that even -s option (which
> >>>>> captures summary) also will have meaningful information.
> >>>>> 
> >>>>> Signed-off-by: Athira Rajeev <atrajeev@linux.ibm.com>
> >>>> 
> >>>> Acked-by: Namhyung Kim <namhyung@kernel.org>
> >>>> 
> >>>> Thanks,
> >>>> Namhyung
> >>> Hi,
> >>> 
> >>> Can we please have this pulled in, if the patch looks fine ?
> >> 
> >> Can you please check applying it on top of current perf-tools-next?
> > 
> > So, this seems to be also addressed by:
> > 
> > commit 39f473f6d0b24cf375893f2110b1cc9d8a079a42
> > Author: Anubhav Shelat <ashelat@redhat.com>
> > Date:   Wed Jul 16 16:39:15 2025 -0400
> > 
> >    perf sched timehist: decode process names of processes in zombie state
> > 
> >    Previously when running perf trace timehist --state, when recording
> >    processes in the zombie state the process name would not be decoded
> >    properly and appears with just the PID:
> > 
> >    1140057.412177 [0006]  Mutter Input Th[3139/3104]          0.956      0.019      0.041      S
> >    1140057.412222 [0012]  :1248612[1248612]                   0.000      0.000      0.332      Z
> >    1140057.412275 [0004]  <idle>                              0.052      0.052      0.953      I
> >    1140057.412284 [0008]  <idle>                              0.070      0.070      0.932      I
> >    1140057.412333 [0004]  KMS thread[3126/3104]               0.953      0.112      0.058      S
> > 
> >    Now some extra processing has been added to decode the process name:
> > 
> >    1140057.412177 [0006]  Mutter Input Th[3139/3104]          0.956      0.019      0.041      S
> >    1140057.412222 [0012]  sleep[1248612]                      0.000      0.000      0.332      Z
> >    1140057.412275 [0004]  <idle>                              0.052      0.052      0.953      I
> >    1140057.412284 [0008]  <idle>                              0.070      0.070      0.932      I
> >    1140057.412333 [0004]  KMS thread[3126/3104]               0.953      0.112      0.058      S
> > 
> >    Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
> >    Link: https://lore.kernel.org/r/20250716203914.45772-2-ashelat@redhat.com
> >    Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > 
> > 
> > No? It is not applying to perf-tools-next, a quick look found the patch
> > above.
> 
> Hi Arnaldo
> 
> commit 39f473f6d0b2 ("perf sched timehist: decode process names
> of processes in zombie state”)
> added change for -S option. The patch I submitted is to add change in process name for “-s” option as well
> 
> I will check applying this on top of current perf-tools-next

Thanks for looking into this!

- Arnaldo

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-06-04 15:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-26  9:39 [PATCH] tools/perf/sched: Update process names of processes in zombie state for both -s and -S options Athira Rajeev
2026-04-27  5:56 ` Namhyung Kim
2026-05-21  8:32   ` Athira Rajeev
2026-05-21 14:17     ` Arnaldo Carvalho de Melo
2026-06-04 14:17       ` Arnaldo Carvalho de Melo
2026-06-04 15:08         ` Athira Rajeev
2026-06-04 15:26           ` Arnaldo Carvalho de Melo
2026-04-27  6:43 ` Venkat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox