diff options
| -rw-r--r-- | tools/perf/builtin-record.c | 2 | ||||
| -rw-r--r-- | tools/perf/util/data.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index eb524f91bffe..8ce62ef7f6c3 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
| @@ -374,7 +374,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) | |||
| 374 | 374 | ||
| 375 | session = perf_session__new(file, false, NULL); | 375 | session = perf_session__new(file, false, NULL); |
| 376 | if (session == NULL) { | 376 | if (session == NULL) { |
| 377 | pr_err("Not enough memory for reading perf file header\n"); | 377 | pr_err("Perf session creation failed.\n"); |
| 378 | return -1; | 378 | return -1; |
| 379 | } | 379 | } |
| 380 | 380 | ||
diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c index 1fbcd8bdc11b..55de44ecebef 100644 --- a/tools/perf/util/data.c +++ b/tools/perf/util/data.c | |||
| @@ -86,10 +86,17 @@ static int open_file_read(struct perf_data_file *file) | |||
| 86 | 86 | ||
| 87 | static int open_file_write(struct perf_data_file *file) | 87 | static int open_file_write(struct perf_data_file *file) |
| 88 | { | 88 | { |
| 89 | int fd; | ||
| 90 | |||
| 89 | if (check_backup(file)) | 91 | if (check_backup(file)) |
| 90 | return -1; | 92 | return -1; |
| 91 | 93 | ||
| 92 | return open(file->path, O_CREAT|O_RDWR|O_TRUNC, S_IRUSR|S_IWUSR); | 94 | fd = open(file->path, O_CREAT|O_RDWR|O_TRUNC, S_IRUSR|S_IWUSR); |
| 95 | |||
| 96 | if (fd < 0) | ||
| 97 | pr_err("failed to open %s : %s\n", file->path, strerror(errno)); | ||
| 98 | |||
| 99 | return fd; | ||
| 93 | } | 100 | } |
| 94 | 101 | ||
| 95 | static int open_file(struct perf_data_file *file) | 102 | static int open_file(struct perf_data_file *file) |
