From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752840AbcLEXl7 (ORCPT ); Mon, 5 Dec 2016 18:41:59 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:34084 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488AbcLEXl5 (ORCPT ); Mon, 5 Dec 2016 18:41:57 -0500 Subject: Re: [PATCH v2] perf sched timehist: Improve error message when analyzing wrong file To: Namhyung Kim , acme@kernel.org References: <1480451988-43673-1-git-send-email-dsahern@gmail.com> Cc: mingo@kernel.org, peterz@infradead.org, jolsa@kernel.org, linux-kernel@vger.kernel.org From: David Ahern Message-ID: <0b7e62e2-ef1d-6ad1-86c7-16c32c83a94f@gmail.com> Date: Mon, 5 Dec 2016 15:41:54 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/29/16 9:31 PM, Namhyung Kim wrote: > On 11/30/16, David Ahern wrote: >> 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 > > Acked-by: Namhyung Kim > > Thanks, > Namhyung > Arnaldo: I think this one has been overlooked