Re: [PATCH V2]Perf:Return error code for perf_session__new function on failure

From: Mamatha Inamdar
Date: Thu Aug 22 2019 - 09:45:26 EST



On 22/08/19 3:37 PM, Jiri Olsa wrote:
On Thu, Aug 22, 2019 at 12:50:49PM +0530, Mamatha Inamdar wrote:
This Patch is to return error code of perf_new_session function
on failure instead of NULL
----------------------------------------------
Test Results:

Before Fix:

$ perf c2c report -input
failed to open nput: No such file or directory

$ echo $?
0
------------------------------------------
After Fix:

$ ./perf c2c report -input
failed to open nput: No such file or directory

$ echo $?
254
[root@krava perf]# ./perf c2c report -input
failed to open nput: No such file or directory
[root@krava perf]# echo $?
255

hum, not sure why I'm getting 255.. but it looks good now

Reviewed-by: Jiri Olsa <jolsa@xxxxxxxxxx>

thanks,
jirka
Thank you