From: David Ahern <dsahern@gmail.com>
To: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>, acme@ghostprotocols.net
Cc: 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: Tue, 10 Dec 2013 20:38:54 -0700 [thread overview]
Message-ID: <52A7DE4E.4070701@gmail.com> (raw)
In-Reply-To: <1386779444-29624-1-git-send-email-yangds.fnst@cn.fujitsu.com>
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?
David
next prev parent reply other threads:[~2013-12-11 3:38 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 [this message]
2013-12-11 16:46 ` Dongsheng Yang
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=52A7DE4E.4070701@gmail.com \
--to=dsahern@gmail.com \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=yangds.fnst@cn.fujitsu.com \
/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