summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/util.c')
-rw-r--r--tools/perf/util/util.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index ae56c766eda1..969ae560dad9 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -182,14 +182,31 @@ static int rm_rf_depth_pat(const char *path, int depth, const char **pat)
return rmdir(path);
}
+static int rm_rf_kcore_dir(const char *path)
+{
+ char kcore_dir_path[PATH_MAX];
+ const char *pat[] = {
+ "kcore",
+ "kallsyms",
+ "modules",
+ NULL,
+ };
+
+ snprintf(kcore_dir_path, sizeof(kcore_dir_path), "%s/kcore_dir", path);
+
+ return rm_rf_depth_pat(kcore_dir_path, 0, pat);
+}
+
int rm_rf_perf_data(const char *path)
{
const char *pat[] = {
- "header",
+ "data",
"data.*",
NULL,
};
+ rm_rf_kcore_dir(path);
+
return rm_rf_depth_pat(path, 0, pat);
}