Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1537975
| Path | csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | tip-bot for David Ahern <tipbot@zytor.com> |
| Newsgroups | linux.kernel |
| Subject | [tip:perf/core] perf sched timehist: Improve error message when analyzing wrong file |
| Date | Wed, 07 Dec 2016 19:30:01 +0100 |
| Message-ID | <sLP8B-3DP-3@gated-at.bofh.it> (permalink) |
| References | <sIXvI-4Vd-19@gated-at.bofh.it> |
| X-Original-To | linux-tip-commits@vger.kernel.org |
| Reply-To | peterz@infradead.org, namhyung@kernel.org, mingo@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, dsahern@gmail.com, hpa@zytor.com, tglx@linutronix.de, acme@redhat.com |
| Git-Commit-ID | f45bf8d3939d8f32f06ec12e56d2b8651c5437b4 |
| X-Mailer | tip-git-log-daemon |
| Robot-ID | <tip-bot.git.kernel.org> |
| Robot-Unsubscribe | Contact <mailto:hpa@kernel.org> to get blacklisted from these emails |
| MIME-Version | 1.0 |
| Content-Transfer-Encoding | 8bit |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Disposition | inline |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 55 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | peterz@infradead.org, namhyung@kernel.org, jolsa@kernel.org, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, dsahern@gmail.com, tglx@linutronix.de, acme@redhat.com |
| X-Original-Date | Wed, 7 Dec 2016 10:24:07 -0800 |
| X-Original-Message-ID | <tip-f45bf8d3939d8f32f06ec12e56d2b8651c5437b4@git.kernel.org> |
| X-Original-References | <1480451988-43673-1-git-send-email-dsahern@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1537975 |
Show key headers only | View raw
Commit-ID: f45bf8d3939d8f32f06ec12e56d2b8651c5437b4
Gitweb: http://git.kernel.org/tip/f45bf8d3939d8f32f06ec12e56d2b8651c5437b4
Author: David Ahern <dsahern@gmail.com>
AuthorDate: Tue, 29 Nov 2016 13:39:48 -0700
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 7 Dec 2016 12:00:32 -0300
perf sched timehist: Improve error message when analyzing wrong file
Arnaldo reported an unhelpful error message when running perf sched
timehist on a file that did not contain sched tracepoints:
[root@jouet ~]# perf sched timehist
No trace sample to read. Did you call 'perf record -R'?
[root@jouet ~]# perf evlist -v
cycles:ppp: size: 112, { sample_period, sample_freq }: 4000, sample_type: IP|TID|TIME|CALLCHAIN|CPU|PERIOD, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq: 1, task: 1, precise_ip: 3, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1
Change the has_traces check to look for the sched_switch event. Analysis
for perf sched timehist requires at least this event.
Now when analyzing a file without sched tracepoints you get:
root@f21-vbox:/tmp$ perf sched timehist
No sched_switch events found. Have you run 'perf sched record'?
Signed-off-by: David Ahern <dsahern@gmail.com>
Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1480451988-43673-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-sched.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 870d94c..84c39f1 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -2629,8 +2629,12 @@ static int perf_sched__timehist(struct perf_sched *sched)
if (perf_session__set_tracepoints_handlers(session, handlers))
goto out;
- if (!perf_session__has_traces(session, "record -R"))
+ /* sched_switch event at a minimum needs to exist */
+ if (!perf_evlist__find_tracepoint_by_name(session->evlist,
+ "sched:sched_switch")) {
+ pr_err("No sched_switch events found. Have you run 'perf sched record'?\n");
goto out;
+ }
if (sched->show_migrations &&
perf_session__set_tracepoints_handlers(session, migrate_handlers))
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2] perf sched timehist: Improve error message when analyzing wrong file David Ahern <dsahern@gmail.com> - 2016-11-29 21:50 +0100
Re: [PATCH v2] perf sched timehist: Improve error message when analyzing wrong file Namhyung Kim <namhyung@kernel.org> - 2016-11-30 06:40 +0100
Re: [PATCH v2] perf sched timehist: Improve error message when analyzing wrong file David Ahern <dsahern@gmail.com> - 2016-12-06 00:50 +0100
Re: [PATCH v2] perf sched timehist: Improve error message when analyzing wrong file Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-12-06 17:20 +0100
[tip:perf/core] perf sched timehist: Improve error message when analyzing wrong file tip-bot for David Ahern <tipbot@zytor.com> - 2016-12-07 19:30 +0100
csiph-web