Commit-ID:  1e2778e91616086177a255f3fc8c72ecaa564ae6
Gitweb:     https://git.kernel.org/tip/1e2778e91616086177a255f3fc8c72ecaa564ae6
Author:     Jin Yao <yao....@linux.intel.com>
AuthorDate: Wed, 10 Jan 2018 23:00:27 +0800
Committer:  Arnaldo Carvalho de Melo <a...@redhat.com>
CommitDate: Wed, 17 Jan 2018 10:23:34 -0300

perf script: Improve error msg when no first/last sample time found

The following message will be returned to user when executing 'perf
script --time' if perf data file doesn't contain the first/last sample
time.

"HINT: no first/last sample time found in perf data.
 Please use latest perf binary to execute 'perf record'
 (if '--buildid-all' is enabled, needs to set '--timestamp-boundary')."

Signed-off-by: Jin Yao <yao....@linux.intel.com>
Reviewed-by: Jiri Olsa <jo...@redhat.com>
Cc: Alexander Shishkin <alexander.shish...@linux.intel.com>
Cc: Andi Kleen <a...@linux.intel.com>
Cc: Kan Liang <kan.li...@intel.com>
Cc: Peter Zijlstra <pet...@infradead.org>
Link: 
http://lkml.kernel.org/r/1515596433-24653-3-git-send-email-yao....@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.com>
---
 tools/perf/builtin-script.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 08bc818..ac78191 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -3449,7 +3449,9 @@ int cmd_script(int argc, const char **argv)
        if (perf_time__parse_str(script.ptime_range, script.time_str) != 0) {
                if (session->evlist->first_sample_time == 0 &&
                    session->evlist->last_sample_time == 0) {
-                       pr_err("No first/last sample time in perf data\n");
+                       pr_err("HINT: no first/last sample time found in perf 
data.\n"
+                              "Please use latest perf binary to execute 'perf 
record'\n"
+                              "(if '--buildid-all' is enabled, please set 
'--timestamp-boundary').\n");
                        err = -EINVAL;
                        goto out_delete;
                }

Reply via email to