linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: yuzhoujian <ufo19890607@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, David Ahern <dsahern@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Milian Wolff <milian.wolff@kdab.com>,
	yuzhoujian@didichuxing.com,
	Adrian Hunter <adrian.hunter@intel.com>,
	Wang Nan <wangnan0@huawei.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/2] Add new elements for per-event-dump option
Date: Thu, 26 Oct 2017 10:46:07 -0300	[thread overview]
Message-ID: <20171026134607.GI7045@kernel.org> (raw)
In-Reply-To: <20171026130143.GH7045@kernel.org>

Em Thu, Oct 26, 2017 at 10:01:43AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Oct 25, 2017 at 04:53:18PM +0800, yuzhoujian escreveu:
> > +	bool		per_event_dump;
> > +	const char	*last_evsel_name;
> >  	enum show_feature_header show_feat_hdr;
 
> Ditto, this should be in struct perf_script.
 
> I'm cooking a patch...

So, please take a look at my perf/core branch, I've reimplemented it the way I
had suggested, should work as you intended, and I added the missing entry to
tools/perf/Documentation/perf-script.txt, its man page:

[root@jouet ~]# mkdir tt
[root@jouet ~]# cd tt
[root@jouet tt]# perf sched record sleep 5
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 4.450 MB perf.data (16177 samples) ]
[root@jouet tt]# perf evlist
sched:sched_switch
sched:sched_stat_wait
sched:sched_stat_sleep
sched:sched_stat_iowait
sched:sched_stat_runtime
sched:sched_process_fork
sched:sched_wakeup
sched:sched_wakeup_new
sched:sched_migrate_task
# Tip: use 'perf evlist --trace-fields' to show fields for tracepoint events
[root@jouet tt]# perf script | head
            perf 24359 [003] 203964.311770:       sched:sched_wakeup: perf:24360 [120] success=1 CPU:001
         swapper     0 [001] 203964.311778:       sched:sched_switch: swapper/1:0 [120] R ==> perf:24360 [120]
            perf 24359 [003] 203964.311804: sched:sched_stat_runtime: comm=perf pid=24359 runtime=716900 [ns] vruntime=9190193330 [ns]
            perf 24359 [003] 203964.311806:       sched:sched_switch: perf:24359 [120] S ==> swapper/3:0 [120]
         swapper     0 [000] 203964.312036:       sched:sched_wakeup: chrome:20356 [120] success=1 CPU:000
         swapper     0 [000] 203964.312041:       sched:sched_switch: swapper/0:0 [120] R ==> chrome:20356 [120]
          chrome 20356 [000] 203964.312079: sched:sched_stat_runtime: comm=chrome pid=20356 runtime=39381 [ns] vruntime=7598655260580 [ns]
            perf 24360 [001] 203964.312079: sched:sched_stat_runtime: comm=perf pid=24360 runtime=304174 [ns] vruntime=917028583 [ns]
          chrome 20356 [000] 203964.312086:       sched:sched_wakeup: kworker/0:23:12157 [120] success=1 CPU:000
          chrome 20356 [000] 203964.312096: sched:sched_stat_runtime: comm=chrome pid=20356 runtime=3531 [ns] vruntime=7598655264111 [ns]
[root@jouet tt]# ls
perf.data
[root@jouet tt]# perf script --per-event-dump
[root@jouet tt]# ls
perf.data                                perf.data.sched:sched_stat_runtime.dump  perf.data.sched:sched_wakeup.dump
perf.data.sched:sched_migrate_task.dump  perf.data.sched:sched_stat_sleep.dump    perf.data.sched:sched_wakeup_new.dump
perf.data.sched:sched_process_fork.dump  perf.data.sched:sched_stat_wait.dump
perf.data.sched:sched_stat_iowait.dump   perf.data.sched:sched_switch.dump
[root@jouet tt]# head -5 perf.data.sched:sched_switch.dump
         swapper     0 [001] 203964.311778:       sched:sched_switch: swapper/1:0 [120] R ==> perf:24360 [120]
            perf 24359 [003] 203964.311806:       sched:sched_switch: perf:24359 [120] S ==> swapper/3:0 [120]
         swapper     0 [000] 203964.312041:       sched:sched_switch: swapper/0:0 [120] R ==> chrome:20356 [120]
          chrome 20356 [000] 203964.312097:       sched:sched_switch: chrome:20356 [120] R ==> kworker/0:23:12157 [120]
    kworker/0:23 12157 [000] 203964.312110:       sched:sched_switch: kworker/0:23:12157 [120] t ==> chrome:20356 [120]
[root@jouet tt]# 
[root@jouet tt]# head -5 perf.data.sched:sched_stat_runtime.dump
            perf 24359 [003] 203964.311804: sched:sched_stat_runtime: comm=perf pid=24359 runtime=716900 [ns] vruntime=9190193330 [ns]
          chrome 20356 [000] 203964.312079: sched:sched_stat_runtime: comm=chrome pid=20356 runtime=39381 [ns] vruntime=7598655260580 [ns]
            perf 24360 [001] 203964.312079: sched:sched_stat_runtime: comm=perf pid=24360 runtime=304174 [ns] vruntime=917028583 [ns]
          chrome 20356 [000] 203964.312096: sched:sched_stat_runtime: comm=chrome pid=20356 runtime=3531 [ns] vruntime=7598655264111 [ns]
    kworker/0:23 12157 [000] 203964.312108: sched:sched_stat_runtime: comm=kworker/0:23 pid=12157 runtime=7327 [ns] vruntime=110992086009578 [ns]
[root@jouet tt]# 

- Arnaldo

  reply	other threads:[~2017-10-26 13:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25  8:53 [PATCH v5 0/2] perf script: Add script per-event-dump support yuzhoujian
2017-10-25  8:53 ` [PATCH v5 1/2] Add new elements for per-event-dump option yuzhoujian
2017-10-26 13:01   ` Arnaldo Carvalho de Melo
2017-10-26 13:46     ` Arnaldo Carvalho de Melo [this message]
2017-10-25  8:53 ` [PATCH v5 2/2] Add the fp_selection_helper to set the fp for print functions yuzhoujian

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=20171026134607.GI7045@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=milian.wolff@kdab.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ufo19890607@gmail.com \
    --cc=wangnan0@huawei.com \
    --cc=yuzhoujian@didichuxing.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 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).