From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
To: David Ahern <dsahern@gmail.com>
Cc: acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3] perf tools: Change the default filenames for perf kvm diff to perf.data.xxx and perf.data.xxx.old
Date: Wed, 11 Dec 2013 11:46:31 -0500 [thread overview]
Message-ID: <52A896E7.4050501@cn.fujitsu.com> (raw)
In-Reply-To: <52A7DE4E.4070701@gmail.com>
On 12/10/2013 10:38 PM, David Ahern wrote:
> On 12/11/13, 9:30 AM, Dongsheng Yang wrote:
>> @@ -1001,8 +1002,28 @@ static int data_init(int argc, const char **argv)
>> use_default = false;
>> }
>> } else if (perf_guest) {
>> - defaults[0] = "perf.data.host";
>> - defaults[1] = "perf.data.guest";
>> + char *file_name;
>> + int len, ret;
>> +
>> + file_name = (char *)get_filename_for_perf_kvm();
>> + if (!file_name) {
>> + pr_err("Failed to allocate memory for filename\n");
>> + return -ENOMEM;
>> + }
>> +
>
> The need for a typecast should tell you something is wrong. Why is
> get_filename_for_perf_kvm returning a const char * when it is
> allocated memory?
>
Yes, there is something is wrong I think. It returning const char*
because I assume the file_name will never be changed. But now, this
assumption seems outdated.
I will add a new patch to change the return value to char *, as the
other two patches is already applied.
http://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/core&id=e1a2b174dbbe08dce12bde9f05f64dbbae652bed
Thanx
Yang
> David
>
next prev parent reply other threads:[~2013-12-11 3:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-06 22:25 [PATCH 1/3] perf tools: Move code to generate filename for perf-kvm to function Dongsheng Yang
2013-12-06 22:25 ` [PATCH 2/3] perf tools: Make perf kvm diff support --guestmount Dongsheng Yang
2013-12-11 11:05 ` [tip:perf/core] perf kvm: " tip-bot for Dongsheng Yang
2013-12-06 22:25 ` [PATCH 3/3] perf tools: Change the default filenames for perf kvm diff to perf.data.xxx and perf.data.xxx.old Dongsheng Yang
2013-12-11 16:21 ` [PATCH V2] " Dongsheng Yang
2013-12-11 16:30 ` [PATCH V3] " Dongsheng Yang
2013-12-11 3:38 ` David Ahern
2013-12-11 16:46 ` Dongsheng Yang [this message]
2013-12-11 11:05 ` [tip:perf/core] perf kvm: Move code to generate filename for perf-kvm to function tip-bot for Dongsheng Yang
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=52A896E7.4050501@cn.fujitsu.com \
--to=yangds.fnst@cn.fujitsu.com \
--cc=acme@ghostprotocols.net \
--cc=dsahern@gmail.com \
--cc=linux-kernel@vger.kernel.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