diff options
Diffstat (limited to 'tools/perf/util/util.c')
-rw-r--r-- | tools/perf/util/util.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 3096654377c2..969ae560dad9 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -182,6 +182,21 @@ 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[] = { @@ -190,6 +205,8 @@ int rm_rf_perf_data(const char *path) NULL, }; + rm_rf_kcore_dir(path); + return rm_rf_depth_pat(path, 0, pat); } |