public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Paul Mackerras <paulus@samba.org>, Jiri Olsa <jolsa@kernel.org>,
	Borislav Petkov <bp@suse.de>,
	Hemant Kumar <hemant@linux.vnet.ibm.com>
Subject: Re: [perf/core PATCH v4 2/2] perf buildid-cache: Add --purge FILE to remove all caches of FILE
Date: Mon, 23 Feb 2015 15:06:29 +0900	[thread overview]
Message-ID: <54EAC365.6010508@hitachi.com> (raw)
In-Reply-To: <20150221135645.GA10557@danjae>

(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@hitachi.com>
> 
> I have a nitpick below - other than that both patches look good.
> 
> Acked-by: Namhyung Kim <namhyung@kernel.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@hitachi.com



      reply	other threads:[~2015-02-23  6:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20  9:41 [perf/core PATCH v4 0/2] perf-buildid-cache: Enhance --update and add --purge Masami Hiramatsu
2015-02-20  9:41 ` [perf/core PATCH v4 1/2] perf buildid-cache: Add new buildid cache if update target is not cached Masami Hiramatsu
2015-02-20  9:41 ` [perf/core PATCH v4 2/2] perf buildid-cache: Add --purge FILE to remove all caches of FILE Masami Hiramatsu
2015-02-20 19:07   ` Hemant Kumar
2015-02-23  6:07     ` Masami Hiramatsu
2015-02-21 13:56   ` Namhyung Kim
2015-02-23  6:06     ` Masami Hiramatsu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54EAC365.6010508@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=bp@suse.de \
    --cc=hemant@linux.vnet.ibm.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox