lkml.org 
[lkml]   [2009]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/4] perf tools: Warn while running perf trace without sample
    Date
    When a user runs perf trace using an input with logged counters
    without PERF_SAMPLE_RAW attribute, warn by giving a nice tip.

    Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    ---
    tools/perf/builtin-trace.c | 4 ++++
    1 files changed, 4 insertions(+), 0 deletions(-)

    diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
    index b160a9f..88eef71 100644
    --- a/tools/perf/builtin-trace.c
    +++ b/tools/perf/builtin-trace.c
    @@ -184,6 +184,10 @@ static int __cmd_trace(void)
    header = perf_header__read(input);
    sample_type = perf_header__sample_type(header);

    + if (!(sample_type & PERF_SAMPLE_RAW))
    + die("No trace sample to read. Did you call perf record "
    + "without -R?");
    +
    if (load_kernel() < 0) {
    perror("failed to load kernel symbols");
    return EXIT_FAILURE;
    --
    1.6.2.3


    \
     
     \ /
      Last update: 2009-08-17 23:11    [W:0.023 / U:59.592 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site