All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: William Cohen <wcohen@redhat.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: RFE: More inclusive pid filtering of sched:sched_switch tracepoint events
Date: Thu, 19 Nov 2015 12:52:55 -0300	[thread overview]
Message-ID: <20151119155255.GE29361@kernel.org> (raw)
In-Reply-To: <564CCAF9.3070805@redhat.com>

Em Wed, Nov 18, 2015 at 02:01:13PM -0500, William Cohen escreveu:
> I was experimenting with the sched:sched_switch tracepoint to look at
> the time that a process spend off the processor.  As a really simple
> experiment record data with:
> 
> $ sudo perf record -e sched:sched_switch -- du
> 
> Then examine the data with:
> 
> $ sudo perf script
> 
> The output only shows the sched:sched_switch when the process is moved
> off the processor.  However, there is no data showing when the process is
> scheduled back onto the processor:
> 
>               du 20960 [007] 339893.429394: sched:sched_switch: du:20960 [120] R ==> kworker/7:0:16805 [120]
>               du 20960 [007] 339893.429411: sched:sched_switch: du:20960 [120] R ==> kworker/7:0:16805 [120]
>               du 20960 [007] 339893.429544: sched:sched_switch: du:20960 [120] R ==> kworker/7:0:16805 [120]
>               du 20960 [007] 339893.429556: sched:sched_switch: du:20960 [120] R ==> kworker/7:0:16805 [120]
>               du 20960 [007] 339893.429561: sched:sched_switch: du:20960 [120] R ==> kworker/7:0:16805 [120]
>               du 20960 [007] 339893.429567: sched:sched_switch: du:20960 [120] R ==> kworker/7:0:16805 [120]
>               du 20960 [007] 339893.430150: sched:sched_switch: du:20960 [120] R ==> kworker/7:0:16805 [120]
> 
> Would it be possible to make perf's process filtering more inclusive so
> that output also includes sched:sched_switch tracepoints for pid that
> are also being scheduled onto the processor?  The alternative of
> recording all sched:sched_switch events system-wide and filtering out
> all the unwanted pid's is undesirable.

So, on a recent kernel, no need to run with sudo:

[acme@zoo linux]$ perf record --switch-events -e dummy -- du > /dev/null
^[[A[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.016 MB perf.data ]
[acme@zoo linux]$ perf script --show-switch-events
              du  4026 103867.891889: PERF_RECORD_SWITCH OUT
              du  4026 103867.891980: PERF_RECORD_SWITCH IN 
              du  4026 103867.984411: PERF_RECORD_SWITCH OUT
              du  4026 103867.984424: PERF_RECORD_SWITCH IN 
[acme@zoo linux]$

[acme@zoo linux]$ perf report -D | grep PERF_RECORD_SWITCH
103867891889845 0x4260 [0x18]: PERF_RECORD_SWITCH OUT
103867891980760 0x4278 [0x18]: PERF_RECORD_SWITCH IN 
103867984411995 0x4290 [0x18]: PERF_RECORD_SWITCH OUT
103867984424725 0x42a8 [0x18]: PERF_RECORD_SWITCH IN 
[acme@zoo linux]$ 

- Arnaldo

      parent reply	other threads:[~2015-11-19 15:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 19:01 RFE: More inclusive pid filtering of sched:sched_switch tracepoint events William Cohen
2015-11-18 19:08 ` David Ahern
2015-11-18 19:16   ` William Cohen
2015-11-18 19:18     ` David Ahern
2015-11-18 20:18       ` Arnaldo Carvalho de Melo
2015-11-19 15:52 ` Arnaldo Carvalho de Melo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151119155255.GE29361@kernel.org \
    --to=acme@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=wcohen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.