diff options
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index e079b34201f2..a17a9306bdf6 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <unistd.h> | 52 | #include <unistd.h> |
53 | #include <subcmd/pager.h> | 53 | #include <subcmd/pager.h> |
54 | #include <perf/evlist.h> | 54 | #include <perf/evlist.h> |
55 | #include <linux/err.h> | ||
55 | #include "util/record.h" | 56 | #include "util/record.h" |
56 | #include "util/util.h" | 57 | #include "util/util.h" |
57 | #include "perf.h" | 58 | #include "perf.h" |
@@ -3083,8 +3084,8 @@ int find_scripts(char **scripts_array, char **scripts_path_array, int num, | |||
3083 | int i = 0; | 3084 | int i = 0; |
3084 | 3085 | ||
3085 | session = perf_session__new(&data, false, NULL); | 3086 | session = perf_session__new(&data, false, NULL); |
3086 | if (!session) | 3087 | if (IS_ERR(session)) |
3087 | return -1; | 3088 | return PTR_ERR(session); |
3088 | 3089 | ||
3089 | snprintf(scripts_path, MAXPATHLEN, "%s/scripts", get_argv_exec_path()); | 3090 | snprintf(scripts_path, MAXPATHLEN, "%s/scripts", get_argv_exec_path()); |
3090 | 3091 | ||
@@ -3754,8 +3755,8 @@ int cmd_script(int argc, const char **argv) | |||
3754 | } | 3755 | } |
3755 | 3756 | ||
3756 | session = perf_session__new(&data, false, &script.tool); | 3757 | session = perf_session__new(&data, false, &script.tool); |
3757 | if (session == NULL) | 3758 | if (IS_ERR(session)) |
3758 | return -1; | 3759 | return PTR_ERR(session); |
3759 | 3760 | ||
3760 | if (header || header_only) { | 3761 | if (header || header_only) { |
3761 | script.tool.show_feat_hdr = SHOW_FEAT_HEADER; | 3762 | script.tool.show_feat_hdr = SHOW_FEAT_HEADER; |