From: Masami Hiramatsu Date: Wed, 6 May 2015 12:46:45 +0000 (+0900) Subject: perf probe: Fix to return 0 when positive value returned X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9bc9f3b6800e8de16f40a2da1d6ded3a391ea01a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git perf probe: Fix to return 0 when positive value returned Fix to return 0 when positive value returned from probe command. At least --vars can returns a positive value if it found a point. ---- # perf probe --vars vfs_read && echo succeeded! || echo failed! Available variables at vfs_read @ char* buf loff_t* pos size_t count struct file* file failed! ---- This fixes above problem. ---- # perf probe --vars vfs_read && echo succeeded! || echo failed! Available variables at vfs_read @ char* buf loff_t* pos size_t count struct file* file succeeded! ---- Signed-off-by: Masami Hiramatsu Tested-by: Arnaldo Carvalho de Melo Cc: Ananth N Mavinakayanahalli Cc: David Ahern Cc: Hemant Kumar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20150506124645.4961.56973.stgit@localhost.localdomain Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 53d475b1422e..9c4cf5e5aad4 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c @@ -523,5 +523,5 @@ int cmd_probe(int argc, const char **argv, const char *prefix) cleanup_params(); } - return ret; + return ret < 0 ? ret : 0; }