linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] perf sched timehist: Skip print non-idle task samples when only show idle events
@ 2024-08-12 13:26 Yang Jihong
  2024-08-12 13:26 ` [PATCH v2 2/2] perf sched timehist: Remove BUG_ON in timehist_sched_change_event() Yang Jihong
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yang Jihong @ 2024-08-12 13:26 UTC (permalink / raw)
  To: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin,
	jolsa, irogers, adrian.hunter, kan.liang, james.clark,
	linux-perf-users, linux-kernel
  Cc: yangjihong

when only show idle events, runtime stats of non-idle tasks is not updated,
and the value is 0, there is no need to print non-idle samples.

Before:

  # perf sched timehist -I
  Samples of sched_switch event do not have callchains.
             time    cpu  task name                       wait time  sch delay   run time
                          [tid/pid]                          (msec)     (msec)     (msec)
  --------------- ------  ------------------------------  ---------  ---------  ---------
   2090450.763235 [0000]  migration/0[15]                     0.000      0.000      0.000
   2090450.763268 [0001]  migration/1[21]                     0.000      0.000      0.000
   2090450.763309 [0002]  migration/2[27]                     0.000      0.000      0.000
   2090450.763343 [0003]  migration/3[33]                     0.000      0.000      0.000
   2090450.763469 [0004]  migration/4[39]                     0.000      0.000      0.000
   2090450.763501 [0005]  migration/5[45]                     0.000      0.000      0.000
   2090450.763622 [0006]  migration/6[51]                     0.000      0.000      0.000
   2090450.763660 [0007]  migration/7[57]                     0.000      0.000      0.000
   2090450.763741 [0009]  migration/9[69]                     0.000      0.000      0.000
   2090450.763862 [0010]  migration/10[75]                    0.000      0.000      0.000
   2090450.763894 [0011]  migration/11[81]                    0.000      0.000      0.000
   2090450.764021 [0012]  migration/12[87]                    0.000      0.000      0.000
   2090450.764056 [0013]  migration/13[93]                    0.000      0.000      0.000
   2090450.764135 [0014]  migration/14[99]                    0.000      0.000      0.000
   2090450.764163 [0015]  migration/15[105]                   0.000      0.000      0.000
   2090450.764292 [0016]  migration/16[111]                   0.000      0.000      0.000
   2090450.764371 [0017]  migration/17[117]                   0.000      0.000      0.000
   2090450.764422 [0018]  migration/18[123]                   0.000      0.000      0.000
   2090450.764490 [0000]  <idle>                              0.000      0.000      1.255
   2090450.764505 [0000]  s1-perf[8235/7168]                  0.000      0.000      0.000
   2090450.764571 [0016]  <idle>                              0.000      0.000      0.278
   2090450.764588 [0010]  <idle>                              0.000      0.000      0.725
   2090450.764590 [0016]  s1-agent[7179/7162]                 0.000      0.000      0.000
   2090450.764635 [0000]  <idle>                              0.015      0.015      0.129
   2090450.764637 [0017]  <idle>                              0.000      0.000      0.266
   2090450.764639 [0000]  s1-perf[8235/7168]                  0.000      0.000      0.000
   2090450.764668 [0017]  s1-agent[7180/7162]                 0.000      0.000      0.000
   2090450.764669 [0000]  <idle>                              0.003      0.003      0.029
   2090450.764672 [0000]  s1-perf[8235/7168]                  0.000      0.000      0.000
   2090450.764683 [0000]  <idle>                              0.003      0.003      0.010

After:

  # perf sched timehist -I
  Samples of sched_switch event do not have callchains.
             time    cpu  task name                       wait time  sch delay   run time
                          [tid/pid]                          (msec)     (msec)     (msec)
  --------------- ------  ------------------------------  ---------  ---------  ---------
   2090450.764490 [0000]  <idle>                              0.000      0.000      1.255
   2090450.764571 [0016]  <idle>                              0.000      0.000      0.278
   2090450.764588 [0010]  <idle>                              0.000      0.000      0.725
   2090450.764635 [0000]  <idle>                              0.015      0.015      0.129
   2090450.764637 [0017]  <idle>                              0.000      0.000      0.266
   2090450.764669 [0000]  <idle>                              0.003      0.003      0.029
   2090450.764683 [0000]  <idle>                              0.003      0.003      0.010
   2090450.764688 [0016]  <idle>                              0.019      0.019      0.097
   2090450.764694 [0000]  <idle>                              0.001      0.001      0.009
   2090450.764706 [0000]  <idle>                              0.001      0.001      0.010
   2090450.764725 [0002]  <idle>                              0.000      0.000      1.415
   2090450.764728 [0000]  <idle>                              0.002      0.002      0.019
   2090450.764823 [0000]  <idle>                              0.003      0.003      0.091
   2090450.764838 [0019]  <idle>                              0.000      0.000      0.154
   2090450.764865 [0002]  <idle>                              0.109      0.109      0.029
   2090450.764866 [0000]  <idle>                              0.012      0.012      0.030
   2090450.764880 [0002]  <idle>                              0.013      0.013      0.001
   2090450.764880 [0000]  <idle>                              0.002      0.002      0.011
   2090450.764896 [0000]  <idle>                              0.001      0.001      0.013
   2090450.764903 [0019]  <idle>                              0.063      0.063      0.002
   2090450.764908 [0019]  <idle>                              0.003      0.003      0.001

Fixes: 07235f84ece6 ("perf sched timehist: Add -I/--idle-hist option")
Signed-off-by: Yang Jihong <yangjihong@bytedance.com>
---
 tools/perf/builtin-sched.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 8750b5f2d49b..177634df1ba5 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -2727,10 +2727,10 @@ static int timehist_sched_change_event(struct perf_tool *tool,
 
 			itr->last_thread = NULL;
 		}
-	}
 
-	if (!sched->summary_only)
-		timehist_print_sample(sched, evsel, sample, &al, thread, t, state);
+		if (!sched->summary_only)
+			timehist_print_sample(sched, evsel, sample, &al, thread, t, state);
+	}
 
 out:
 	if (sched->hist_time.start == 0 && t >= ptime->start)
-- 
2.25.1


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

* [PATCH v2 2/2] perf sched timehist: Remove BUG_ON in timehist_sched_change_event()
  2024-08-12 13:26 [PATCH v2 1/2] perf sched timehist: Skip print non-idle task samples when only show idle events Yang Jihong
@ 2024-08-12 13:26 ` Yang Jihong
  2024-08-12 19:04   ` Namhyung Kim
  2024-08-14 18:42   ` Madadi Vineeth Reddy
  2024-08-12 19:03 ` [PATCH v2 1/2] perf sched timehist: Skip print non-idle task samples when only show idle events Namhyung Kim
  2024-08-14 18:38 ` Madadi Vineeth Reddy
  2 siblings, 2 replies; 7+ messages in thread
From: Yang Jihong @ 2024-08-12 13:26 UTC (permalink / raw)
  To: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin,
	jolsa, irogers, adrian.hunter, kan.liang, james.clark,
	linux-perf-users, linux-kernel
  Cc: yangjihong

The BUG_ON(thread__tid(thread) != 0) in timehist_sched_change_event()
is redundant, remove it.
No functional change.

Fixes: 07235f84ece6 ("perf sched timehist: Add -I/--idle-hist option")
Signed-off-by: Yang Jihong <yangjihong@bytedance.com>
---
 tools/perf/builtin-sched.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 177634df1ba5..309dcfb3796d 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -2700,8 +2700,6 @@ static int timehist_sched_change_event(struct perf_tool *tool,
 			struct idle_thread_runtime *itr = (void *)tr;
 			struct thread_runtime *last_tr;
 
-			BUG_ON(thread__tid(thread) != 0);
-
 			if (itr->last_thread == NULL)
 				goto out;
 
-- 
2.25.1


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

* Re: [PATCH v2 1/2] perf sched timehist: Skip print non-idle task samples when only show idle events
  2024-08-12 13:26 [PATCH v2 1/2] perf sched timehist: Skip print non-idle task samples when only show idle events Yang Jihong
  2024-08-12 13:26 ` [PATCH v2 2/2] perf sched timehist: Remove BUG_ON in timehist_sched_change_event() Yang Jihong
@ 2024-08-12 19:03 ` Namhyung Kim
  2024-09-03 18:44   ` Arnaldo Carvalho de Melo
  2024-08-14 18:38 ` Madadi Vineeth Reddy
  2 siblings, 1 reply; 7+ messages in thread
From: Namhyung Kim @ 2024-08-12 19:03 UTC (permalink / raw)
  To: Yang Jihong
  Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	irogers, adrian.hunter, kan.liang, james.clark, linux-perf-users,
	linux-kernel

On Mon, Aug 12, 2024 at 09:26:05PM +0800, Yang Jihong wrote:
> when only show idle events, runtime stats of non-idle tasks is not updated,
> and the value is 0, there is no need to print non-idle samples.
> 
> Before:
> 
>   # perf sched timehist -I
>   Samples of sched_switch event do not have callchains.
>              time    cpu  task name                       wait time  sch delay   run time
>                           [tid/pid]                          (msec)     (msec)     (msec)
>   --------------- ------  ------------------------------  ---------  ---------  ---------
>    2090450.763235 [0000]  migration/0[15]                     0.000      0.000      0.000
>    2090450.763268 [0001]  migration/1[21]                     0.000      0.000      0.000
>    2090450.763309 [0002]  migration/2[27]                     0.000      0.000      0.000
>    2090450.763343 [0003]  migration/3[33]                     0.000      0.000      0.000
>    2090450.763469 [0004]  migration/4[39]                     0.000      0.000      0.000
>    2090450.763501 [0005]  migration/5[45]                     0.000      0.000      0.000
>    2090450.763622 [0006]  migration/6[51]                     0.000      0.000      0.000
>    2090450.763660 [0007]  migration/7[57]                     0.000      0.000      0.000
>    2090450.763741 [0009]  migration/9[69]                     0.000      0.000      0.000
>    2090450.763862 [0010]  migration/10[75]                    0.000      0.000      0.000
>    2090450.763894 [0011]  migration/11[81]                    0.000      0.000      0.000
>    2090450.764021 [0012]  migration/12[87]                    0.000      0.000      0.000
>    2090450.764056 [0013]  migration/13[93]                    0.000      0.000      0.000
>    2090450.764135 [0014]  migration/14[99]                    0.000      0.000      0.000
>    2090450.764163 [0015]  migration/15[105]                   0.000      0.000      0.000
>    2090450.764292 [0016]  migration/16[111]                   0.000      0.000      0.000
>    2090450.764371 [0017]  migration/17[117]                   0.000      0.000      0.000
>    2090450.764422 [0018]  migration/18[123]                   0.000      0.000      0.000
>    2090450.764490 [0000]  <idle>                              0.000      0.000      1.255
>    2090450.764505 [0000]  s1-perf[8235/7168]                  0.000      0.000      0.000
>    2090450.764571 [0016]  <idle>                              0.000      0.000      0.278
>    2090450.764588 [0010]  <idle>                              0.000      0.000      0.725
>    2090450.764590 [0016]  s1-agent[7179/7162]                 0.000      0.000      0.000
>    2090450.764635 [0000]  <idle>                              0.015      0.015      0.129
>    2090450.764637 [0017]  <idle>                              0.000      0.000      0.266
>    2090450.764639 [0000]  s1-perf[8235/7168]                  0.000      0.000      0.000
>    2090450.764668 [0017]  s1-agent[7180/7162]                 0.000      0.000      0.000
>    2090450.764669 [0000]  <idle>                              0.003      0.003      0.029
>    2090450.764672 [0000]  s1-perf[8235/7168]                  0.000      0.000      0.000
>    2090450.764683 [0000]  <idle>                              0.003      0.003      0.010
> 
> After:
> 
>   # perf sched timehist -I
>   Samples of sched_switch event do not have callchains.
>              time    cpu  task name                       wait time  sch delay   run time
>                           [tid/pid]                          (msec)     (msec)     (msec)
>   --------------- ------  ------------------------------  ---------  ---------  ---------
>    2090450.764490 [0000]  <idle>                              0.000      0.000      1.255
>    2090450.764571 [0016]  <idle>                              0.000      0.000      0.278
>    2090450.764588 [0010]  <idle>                              0.000      0.000      0.725
>    2090450.764635 [0000]  <idle>                              0.015      0.015      0.129
>    2090450.764637 [0017]  <idle>                              0.000      0.000      0.266
>    2090450.764669 [0000]  <idle>                              0.003      0.003      0.029
>    2090450.764683 [0000]  <idle>                              0.003      0.003      0.010
>    2090450.764688 [0016]  <idle>                              0.019      0.019      0.097
>    2090450.764694 [0000]  <idle>                              0.001      0.001      0.009
>    2090450.764706 [0000]  <idle>                              0.001      0.001      0.010
>    2090450.764725 [0002]  <idle>                              0.000      0.000      1.415
>    2090450.764728 [0000]  <idle>                              0.002      0.002      0.019
>    2090450.764823 [0000]  <idle>                              0.003      0.003      0.091
>    2090450.764838 [0019]  <idle>                              0.000      0.000      0.154
>    2090450.764865 [0002]  <idle>                              0.109      0.109      0.029
>    2090450.764866 [0000]  <idle>                              0.012      0.012      0.030
>    2090450.764880 [0002]  <idle>                              0.013      0.013      0.001
>    2090450.764880 [0000]  <idle>                              0.002      0.002      0.011
>    2090450.764896 [0000]  <idle>                              0.001      0.001      0.013
>    2090450.764903 [0019]  <idle>                              0.063      0.063      0.002
>    2090450.764908 [0019]  <idle>                              0.003      0.003      0.001
> 
> Fixes: 07235f84ece6 ("perf sched timehist: Add -I/--idle-hist option")
> Signed-off-by: Yang Jihong <yangjihong@bytedance.com>

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

Thanks,
Namhyung


> ---
>  tools/perf/builtin-sched.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index 8750b5f2d49b..177634df1ba5 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -2727,10 +2727,10 @@ static int timehist_sched_change_event(struct perf_tool *tool,
>  
>  			itr->last_thread = NULL;
>  		}
> -	}
>  
> -	if (!sched->summary_only)
> -		timehist_print_sample(sched, evsel, sample, &al, thread, t, state);
> +		if (!sched->summary_only)
> +			timehist_print_sample(sched, evsel, sample, &al, thread, t, state);
> +	}
>  
>  out:
>  	if (sched->hist_time.start == 0 && t >= ptime->start)
> -- 
> 2.25.1
> 

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

* Re: [PATCH v2 2/2] perf sched timehist: Remove BUG_ON in timehist_sched_change_event()
  2024-08-12 13:26 ` [PATCH v2 2/2] perf sched timehist: Remove BUG_ON in timehist_sched_change_event() Yang Jihong
@ 2024-08-12 19:04   ` Namhyung Kim
  2024-08-14 18:42   ` Madadi Vineeth Reddy
  1 sibling, 0 replies; 7+ messages in thread
From: Namhyung Kim @ 2024-08-12 19:04 UTC (permalink / raw)
  To: Yang Jihong
  Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	irogers, adrian.hunter, kan.liang, james.clark, linux-perf-users,
	linux-kernel

On Mon, Aug 12, 2024 at 09:26:06PM +0800, Yang Jihong wrote:
> The BUG_ON(thread__tid(thread) != 0) in timehist_sched_change_event()
> is redundant, remove it.
> No functional change.
> 
> Fixes: 07235f84ece6 ("perf sched timehist: Add -I/--idle-hist option")
> Signed-off-by: Yang Jihong <yangjihong@bytedance.com>

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

Thanks,
Namhyung


> ---
>  tools/perf/builtin-sched.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index 177634df1ba5..309dcfb3796d 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -2700,8 +2700,6 @@ static int timehist_sched_change_event(struct perf_tool *tool,
>  			struct idle_thread_runtime *itr = (void *)tr;
>  			struct thread_runtime *last_tr;
>  
> -			BUG_ON(thread__tid(thread) != 0);
> -
>  			if (itr->last_thread == NULL)
>  				goto out;
>  
> -- 
> 2.25.1
> 

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

* Re: [PATCH v2 1/2] perf sched timehist: Skip print non-idle task samples when only show idle events
  2024-08-12 13:26 [PATCH v2 1/2] perf sched timehist: Skip print non-idle task samples when only show idle events Yang Jihong
  2024-08-12 13:26 ` [PATCH v2 2/2] perf sched timehist: Remove BUG_ON in timehist_sched_change_event() Yang Jihong
  2024-08-12 19:03 ` [PATCH v2 1/2] perf sched timehist: Skip print non-idle task samples when only show idle events Namhyung Kim
@ 2024-08-14 18:38 ` Madadi Vineeth Reddy
  2 siblings, 0 replies; 7+ messages in thread
From: Madadi Vineeth Reddy @ 2024-08-14 18:38 UTC (permalink / raw)
  To: Yang Jihong
  Cc: namhyung, acme, kan.liang, peterz, mingo, mark.rutland,
	alexander.shishkin, jolsa, irogers, adrian.hunter, james.clark,
	linux-perf-users, linux-kernel, Madadi Vineeth Reddy

Hi Yang Jihong,

On 12/08/24 18:56, Yang Jihong wrote:
> when only show idle events, runtime stats of non-idle tasks is not updated,
> and the value is 0, there is no need to print non-idle samples.
> 
> Before:
> 
>   # perf sched timehist -I
>   Samples of sched_switch event do not have callchains.
>              time    cpu  task name                       wait time  sch delay   run time
>                           [tid/pid]                          (msec)     (msec)     (msec)
>   --------------- ------  ------------------------------  ---------  ---------  ---------
>    2090450.763235 [0000]  migration/0[15]                     0.000      0.000      0.000
>    2090450.763268 [0001]  migration/1[21]                     0.000      0.000      0.000
>    2090450.763309 [0002]  migration/2[27]                     0.000      0.000      0.000
>    2090450.763343 [0003]  migration/3[33]                     0.000      0.000      0.000
>    2090450.763469 [0004]  migration/4[39]                     0.000      0.000      0.000
>    2090450.763501 [0005]  migration/5[45]                     0.000      0.000      0.000
>    2090450.763622 [0006]  migration/6[51]                     0.000      0.000      0.000
>    2090450.763660 [0007]  migration/7[57]                     0.000      0.000      0.000
>    2090450.763741 [0009]  migration/9[69]                     0.000      0.000      0.000
>    2090450.763862 [0010]  migration/10[75]                    0.000      0.000      0.000
>    2090450.763894 [0011]  migration/11[81]                    0.000      0.000      0.000
>    2090450.764021 [0012]  migration/12[87]                    0.000      0.000      0.000
>    2090450.764056 [0013]  migration/13[93]                    0.000      0.000      0.000
>    2090450.764135 [0014]  migration/14[99]                    0.000      0.000      0.000
>    2090450.764163 [0015]  migration/15[105]                   0.000      0.000      0.000
>    2090450.764292 [0016]  migration/16[111]                   0.000      0.000      0.000
>    2090450.764371 [0017]  migration/17[117]                   0.000      0.000      0.000
>    2090450.764422 [0018]  migration/18[123]                   0.000      0.000      0.000
>    2090450.764490 [0000]  <idle>                              0.000      0.000      1.255
>    2090450.764505 [0000]  s1-perf[8235/7168]                  0.000      0.000      0.000
>    2090450.764571 [0016]  <idle>                              0.000      0.000      0.278
>    2090450.764588 [0010]  <idle>                              0.000      0.000      0.725
>    2090450.764590 [0016]  s1-agent[7179/7162]                 0.000      0.000      0.000
>    2090450.764635 [0000]  <idle>                              0.015      0.015      0.129
>    2090450.764637 [0017]  <idle>                              0.000      0.000      0.266
>    2090450.764639 [0000]  s1-perf[8235/7168]                  0.000      0.000      0.000
>    2090450.764668 [0017]  s1-agent[7180/7162]                 0.000      0.000      0.000
>    2090450.764669 [0000]  <idle>                              0.003      0.003      0.029
>    2090450.764672 [0000]  s1-perf[8235/7168]                  0.000      0.000      0.000
>    2090450.764683 [0000]  <idle>                              0.003      0.003      0.010
> 
> After:
> 
>   # perf sched timehist -I
>   Samples of sched_switch event do not have callchains.
>              time    cpu  task name                       wait time  sch delay   run time
>                           [tid/pid]                          (msec)     (msec)     (msec)
>   --------------- ------  ------------------------------  ---------  ---------  ---------
>    2090450.764490 [0000]  <idle>                              0.000      0.000      1.255
>    2090450.764571 [0016]  <idle>                              0.000      0.000      0.278
>    2090450.764588 [0010]  <idle>                              0.000      0.000      0.725
>    2090450.764635 [0000]  <idle>                              0.015      0.015      0.129
>    2090450.764637 [0017]  <idle>                              0.000      0.000      0.266
>    2090450.764669 [0000]  <idle>                              0.003      0.003      0.029
>    2090450.764683 [0000]  <idle>                              0.003      0.003      0.010
>    2090450.764688 [0016]  <idle>                              0.019      0.019      0.097
>    2090450.764694 [0000]  <idle>                              0.001      0.001      0.009
>    2090450.764706 [0000]  <idle>                              0.001      0.001      0.010
>    2090450.764725 [0002]  <idle>                              0.000      0.000      1.415
>    2090450.764728 [0000]  <idle>                              0.002      0.002      0.019
>    2090450.764823 [0000]  <idle>                              0.003      0.003      0.091
>    2090450.764838 [0019]  <idle>                              0.000      0.000      0.154
>    2090450.764865 [0002]  <idle>                              0.109      0.109      0.029
>    2090450.764866 [0000]  <idle>                              0.012      0.012      0.030
>    2090450.764880 [0002]  <idle>                              0.013      0.013      0.001
>    2090450.764880 [0000]  <idle>                              0.002      0.002      0.011
>    2090450.764896 [0000]  <idle>                              0.001      0.001      0.013
>    2090450.764903 [0019]  <idle>                              0.063      0.063      0.002
>    2090450.764908 [0019]  <idle>                              0.003      0.003      0.001
> 

LGTM and also tested the changes.

Reviewed-and-tested-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>

> Fixes: 07235f84ece6 ("perf sched timehist: Add -I/--idle-hist option")
> Signed-off-by: Yang Jihong <yangjihong@bytedance.com>
> ---
>  tools/perf/builtin-sched.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index 8750b5f2d49b..177634df1ba5 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -2727,10 +2727,10 @@ static int timehist_sched_change_event(struct perf_tool *tool,
>  
>  			itr->last_thread = NULL;
>  		}
> -	}
>  
> -	if (!sched->summary_only)
> -		timehist_print_sample(sched, evsel, sample, &al, thread, t, state);
> +		if (!sched->summary_only)
> +			timehist_print_sample(sched, evsel, sample, &al, thread, t, state);
> +	}
>  
>  out:
>  	if (sched->hist_time.start == 0 && t >= ptime->start)


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

* Re: [PATCH v2 2/2] perf sched timehist: Remove BUG_ON in timehist_sched_change_event()
  2024-08-12 13:26 ` [PATCH v2 2/2] perf sched timehist: Remove BUG_ON in timehist_sched_change_event() Yang Jihong
  2024-08-12 19:04   ` Namhyung Kim
@ 2024-08-14 18:42   ` Madadi Vineeth Reddy
  1 sibling, 0 replies; 7+ messages in thread
From: Madadi Vineeth Reddy @ 2024-08-14 18:42 UTC (permalink / raw)
  To: Yang Jihong
  Cc: namhyung, acme, peterz, mingo, mark.rutland, alexander.shishkin,
	jolsa, irogers, adrian.hunter, kan.liang, james.clark,
	linux-perf-users, linux-kernel, Madadi Vineeth Reddy

On 12/08/24 18:56, Yang Jihong wrote:
> The BUG_ON(thread__tid(thread) != 0) in timehist_sched_change_event()
> is redundant, remove it.
> No functional change.
> 
> Fixes: 07235f84ece6 ("perf sched timehist: Add -I/--idle-hist option")
> Signed-off-by: Yang Jihong <yangjihong@bytedance.com>
> ---
>  tools/perf/builtin-sched.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index 177634df1ba5..309dcfb3796d 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -2700,8 +2700,6 @@ static int timehist_sched_change_event(struct perf_tool *tool,
>  			struct idle_thread_runtime *itr = (void *)tr;
>  			struct thread_runtime *last_tr;
>  
> -			BUG_ON(thread__tid(thread) != 0);
> -
>  			if (itr->last_thread == NULL)
>  				goto out;
>  

Yes, that indeed is redundant.

Reviewed-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>

Thanks and Regards
Madadi Vineeth Reddy

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

* Re: [PATCH v2 1/2] perf sched timehist: Skip print non-idle task samples when only show idle events
  2024-08-12 19:03 ` [PATCH v2 1/2] perf sched timehist: Skip print non-idle task samples when only show idle events Namhyung Kim
@ 2024-09-03 18:44   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-09-03 18:44 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Yang Jihong, peterz, mingo, mark.rutland, alexander.shishkin,
	jolsa, irogers, adrian.hunter, kan.liang, james.clark,
	linux-perf-users, linux-kernel

On Mon, Aug 12, 2024 at 12:03:38PM -0700, Namhyung Kim wrote:
> On Mon, Aug 12, 2024 at 09:26:05PM +0800, Yang Jihong wrote:
> > Fixes: 07235f84ece6 ("perf sched timehist: Add -I/--idle-hist option")
> > Signed-off-by: Yang Jihong <yangjihong@bytedance.com>
 
> Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks, applied both for perf-tools-next.

- Arnaldo

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

end of thread, other threads:[~2024-09-03 18:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12 13:26 [PATCH v2 1/2] perf sched timehist: Skip print non-idle task samples when only show idle events Yang Jihong
2024-08-12 13:26 ` [PATCH v2 2/2] perf sched timehist: Remove BUG_ON in timehist_sched_change_event() Yang Jihong
2024-08-12 19:04   ` Namhyung Kim
2024-08-14 18:42   ` Madadi Vineeth Reddy
2024-08-12 19:03 ` [PATCH v2 1/2] perf sched timehist: Skip print non-idle task samples when only show idle events Namhyung Kim
2024-09-03 18:44   ` Arnaldo Carvalho de Melo
2024-08-14 18:38 ` Madadi Vineeth Reddy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).