From: Arnaldo Carvalho de Melo Date: Sun, 2 May 2010 16:37:24 +0000 (-0300) Subject: perf record: Don't exit in live mode when no tracepoints are enabled X-Git-Tag: v2.6.35-rc1~522^2~79 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2c9faa060064343a4a0b16f5b77f3c61d1d17e23;p=karo-tx-linux.git perf record: Don't exit in live mode when no tracepoints are enabled With this I was able to actually test Tom Zanussi's two previous patches in my usual perf testing ways, i.e. without any tracepoints activated. Cc: Frédéric Weisbecker Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Tom Zanussi LKML-Reference: Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index e382d93d369c..ac989e9ba8fe 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -666,12 +666,15 @@ static int __cmd_record(int argc, const char **argv) nr_counters, process_synthesized_event, session); - if (err <= 0) { - pr_err("Couldn't record tracing data.\n"); - return err; - } - - advance_output(err); + /* + * FIXME err <= 0 here actually means that there were no tracepoints + * so its not really an error, just that we don't need to synthesize + * anything. + * We really have to return this more properly and also propagate + * errors that now are calling die() + */ + if (err > 0) + advance_output(err); } machine = perf_session__find_host_machine(session);