Merge remote-tracking branch 'torvalds/master' into perf/core
[linux-2.6-microblaze.git] / tools / perf / util / data.c
index 8fca477..a9c102e 100644 (file)
@@ -240,11 +240,12 @@ static bool is_dir(struct perf_data *data)
 
 static int open_file_read(struct perf_data *data)
 {
+       int flags = data->in_place_update ? O_RDWR : O_RDONLY;
        struct stat st;
        int fd;
        char sbuf[STRERR_BUFSIZE];
 
-       fd = open(data->file.path, O_RDONLY);
+       fd = open(data->file.path, flags);
        if (fd < 0) {
                int err = errno;