lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7cg7TM5qEGDMbgEFVsHVc7jySckz1Q421Ok-nyiX9N1bZg@mail.gmail.com>
Date:	Fri, 26 Dec 2014 10:19:49 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	LKML <linux-kernel@...r.kernel.org>,
	David Ahern <dsahern@...il.com>,
	Stephane Eranian <eranian@...gle.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Andi Kleen <andi@...stfloor.org>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH 04/37] perf tools: Add multi file interface to perf_data_file

Hi Jiri,

On Fri, Dec 26, 2014 at 7:08 AM, Jiri Olsa <jolsa@...hat.com> wrote:
> On Wed, Dec 24, 2014 at 04:15:00PM +0900, Namhyung Kim wrote:
>
> SNIP
>
>>  #endif /* __PERF_DATA_H */
>> diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
>> index d5eab3f3323f..a5046d52e311 100644
>> --- a/tools/perf/util/util.c
>> +++ b/tools/perf/util/util.c
>> @@ -72,6 +72,49 @@ int mkdir_p(char *path, mode_t mode)
>>       return (stat(path, &st) && mkdir(path, mode)) ? -1 : 0;
>>  }
>>
>> +int rm_rf(char *path)
>> +{
>> +     DIR *dir;
>> +     int ret = 0;
>> +     struct dirent *d;
>> +     char namebuf[PATH_MAX];
>> +
>> +     dir = opendir(path);
>> +     if (dir == NULL)
>> +             return 0;
>> +
>> +     while ((d = readdir(dir)) != NULL && !ret) {
>> +             struct stat statbuf;
>> +
>> +             if (d->d_name[0] == '.')
>> +                     continue;
>
> Could you check for '.' and for '..' to support '.*' removal?
>
> I know tha we will probably not have any '.*' files in perf.data.dir,
> but this function could be used later like for total cache clean ;-)

Ah, okay.


> also please submit 'rm_rf' in separate patch

Will do.


Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ