linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf sched timehist --state vs perf script
@ 2024-10-24 16:36 vmolnaro
  2024-10-30  0:34 ` Namhyung Kim
  0 siblings, 1 reply; 4+ messages in thread
From: vmolnaro @ 2024-10-24 16:36 UTC (permalink / raw)
  To: linux-perf-users
  Cc: mpetlan, kan.liang, irogers, acme, ak, alexander.shishkin,
	namhyung

From: Veronika Molnarova <vmolnaro@redhat.com>

Hello!

We encountered an issue with 'perf sched timehist --state' when
we expected for a test case that the process of a workload would 
eventually end in the dead state(marked by 'X') and be switched
out. This can be seen also by using 'perf script':

    # perf sched record -a sleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.167 MB perf.data (166 samples) ]
    # perf script | grep sleep
           sleep  151541 [000] 193461.410617: sched:sched_stat_runtime: comm=sleep pid=151541 runtime=3132275 [ns]
           sleep  151541 [000] 193461.410624:       sched:sched_switch: sleep:151541 [120] S ==> swapper/0:0 [120]
         swapper       0 [000] 193462.410688:       sched:sched_waking: comm=sleep pid=151541 prio=120 target_cpu=000
         swapper       0 [000] 193462.410698:       sched:sched_switch: swapper/0:0 [120] R ==> sleep:151541 [120]
         :151541  151541 [000] 193462.411100: sched:sched_stat_runtime: comm=sleep pid=151541 runtime=407210 [ns]
         :151541  151541 [000] 193462.411107:       sched:sched_switch: sleep:151541 [120] X ==> swapper/0:0 [120]

But for the 'perf sched timehist --state' the process is shown
in the zombie state when it is being switched out:

    # perf sched timehist --state | grep 151541
    Samples do not have callchains.
      193461.410624 [0000]  sleep[151541]                       0.000      0.054      3.129      S 
      193462.411107 [0000]  :151541[151541]                     0.000      0.000      0.408      Z 

Shouldn't both commands report the same result, or is there a reason
why 'perf script' uses the dead state while 'perf sched' uses dead?
It also seems that the 'perf sched' cannot read the name of the zombie
process, but that can be a different issue.

Thanks,

Veronika


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

end of thread, other threads:[~2024-11-02  6:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-24 16:36 perf sched timehist --state vs perf script vmolnaro
2024-10-30  0:34 ` Namhyung Kim
2024-10-31 11:32   ` Michael Petlan
2024-11-02  6:20     ` Namhyung Kim

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).