From: Corey Ashford Date: Sat, 20 Nov 2010 01:37:24 +0000 (-0800) Subject: perf stat: Change and clean up sys_perf_event_open error handling X-Git-Tag: v2.6.38-rc1~490^2~84 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9cf837ef9629ab34167bd6fc0141383ddb8813a;p=pandora-kernel.git perf stat: Change and clean up sys_perf_event_open error handling This patch makes several changes to "perf stat": - "perf stat" will no longer go ahead and run the application when one or more of the specified events could not be opened. - Use error() and die() instead of pr_err() so that the output is more consistent with "perf top" and "perf record". - Handle permission errors in a more robust way, and in a similar way to "perf record" and "perf top". In addition, the sys_perf_event_open() error handling of "perf top" and "perf record" is made more consistent and adds the following phrase when an event doesn't open (with something ther than an access or permission error): "/bin/dmesg may provide additional information." This is added because kernel code doesn't have a good way of expressing detailed errors to user space, so its only avenue is to use printk's. However, many users may not think of looking at dmesg to find out why an event is being rejected. Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Ian Munsie Cc: Michael Ellerman LKML-Reference: <1290217044-26293-1-git-send-email-cjashfor@linux.vnet.ibm.com> Signed-off-by: Corey Ashford Signed-off-by: Arnaldo Carvalho de Melo --- Reading git-diff-tree failed