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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 23 Feb 2015 15:06:29 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Adrian Hunter <adrian.hunter@...el.com>,
	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
	Paul Mackerras <paulus@...ba.org>,
	Jiri Olsa <jolsa@...nel.org>, Borislav Petkov <bp@...e.de>,
	Hemant Kumar <hemant@...ux.vnet.ibm.com>
Subject: Re: [perf/core PATCH v4 2/2] perf buildid-cache: Add --purge FILE
 to remove all caches of FILE

(2015/02/21 22:56), Namhyung Kim wrote:
> Hi Masami,
> 
> On Fri, Feb 20, 2015 at 06:41:50PM +0900, Masami Hiramatsu wrote:
>> Add --purge FILE to remove all caches of FILE.
>> Since the current --remove FILE removes a cache which has
>> same build-id of given FILE. Since the command takes a
>> FILE path, it can confuse user who tries to remove cache
>> about FILE path.
>>
>>   -----
>>   # ./perf buildid-cache -v --add ./perf
>>   Adding 133b7b5486d987a5ab5c3ebf4ea14941f45d4d4f ./perf: Ok
>>   # (update the ./perf binary)
>>   # ./perf buildid-cache -v --remove ./perf
>>   Removing 305bbd1be68f66eca7e2d78db294653031edfa79 ./perf: FAIL
>>   ./perf wasn't in the cache
>>   -----
>> Actually, the --remove's FAIL is not shown, it just silently fails.
>>
>> So, this patch adds --purge FILE action for such usecase.
>> perf buildid-cache --purge FILE removes all caches which
>> has same FILE path.
>> In other words, it removes all caches including old binaries.
>>
>>   -----
>>   # ./perf buildid-cache -v --add ./perf
>>   Adding 133b7b5486d987a5ab5c3ebf4ea14941f45d4d4f ./perf: Ok
>>   # (update the ./perf binary)
>>   # ./perf buildid-cache -v --purge ./perf
>>   Removing 133b7b5486d987a5ab5c3ebf4ea14941f45d4d4f ./perf: Ok
>>   -----
>>
>> BTW, if you want to purge all the caches, remove ~/.debug/* .
>>
>> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
> 
> I have a nitpick below - other than that both patches look good.
> 
> Acked-by: Namhyung Kim <namhyung@...nel.org>

Thanks!

> 
> Thanks,
> Namhyung
> 
[...]

>> +static int build_id_cache__purge_path(const char *pathname)
>> +{
>> +	struct strlist *list;
>> +	struct str_node *pos;
>> +	int err;
>> +
>> +	list = build_id_cache__list_build_ids(pathname);
>> +	if (!list)
>> +		return 0;
>> +
>> +	strlist__for_each(pos, list) {
>> +		err = build_id_cache__remove_s(pos->s);
>> +		if (verbose)
>> +			pr_info("Removing %s %s: %s\n", pos->s, pathname,
>> +				err ? "FAIL" : "Ok");
> 
> You can simply use pr_debug() here. :)

Yes, but other operations already uses pr_info instead of pr_debug.
I thinks we'd better change them all at once.

Thank you,

> 
> Thanks,
> Namhyung
> 
> 
>> +		if (err)
>> +			break;
>> +	}
>> +	strlist__delete(list);
>> +
>> +	return err;
>> +}
>> +
> 


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@...achi.com


--
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