perf data: Correctly identify directory data files
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 4 Oct 2019 08:31:17 +0000 (11:31 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 6 Nov 2019 18:43:05 +0000 (15:43 -0300)
In order to rename the "header" file to "data" without conflicting,
correctly identify the non-header files as starting with "data."

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lore.kernel.org/lkml/20191004083121.12182-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/data.c

index 88fba2ba549f22d4fc6b78511ac660a0642ed4a2..8993253c5564886d28b81753e0c61467d800aaa1 100644 (file)
@@ -96,7 +96,7 @@ int perf_data__open_dir(struct perf_data *data)
                if (stat(path, &st))
                        continue;
 
-               if (!S_ISREG(st.st_mode) || strncmp(dent->d_name, "data", 4))
+               if (!S_ISREG(st.st_mode) || strncmp(dent->d_name, "data.", 5))
                        continue;
 
                ret = -ENOMEM;