summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-kvm.c
diff options
context:
space:
mode:
authorDongsheng Yang <yangds.fnst@cn.fujitsu.com>2013-12-06 17:25:51 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-12-09 15:23:56 -0300
commite1a2b174dbbe08dce12bde9f05f64dbbae652bed (patch)
tree9d2c2694b58eb2a323ddd612ce62c1f13f793a2b /tools/perf/builtin-kvm.c
parent6f1d0c866261ec1e42850b2bf760484c100b6dd6 (diff)
downloadblackbird-op-linux-e1a2b174dbbe08dce12bde9f05f64dbbae652bed.tar.gz
blackbird-op-linux-e1a2b174dbbe08dce12bde9f05f64dbbae652bed.zip
perf kvm: Move code to generate filename for perf-kvm to function.
The code in builtin-kvm.c to generate filename for perf-kvm is useful to other command such as builtin-diff. This patch move the related code form builtin-kvm.c to util/util.c and wrap them in a function named get_filename_for_perf_kvm. Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Link: http://lkml.kernel.org/r/5e09a5c47e8a495e888cbdc65a6fafb2c950f529.1386368672.git.yangds.fnst@cn.fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-kvm.c')
-rw-r--r--tools/perf/builtin-kvm.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index c2e5d56a291d..c6fa3cbd45a9 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1713,12 +1713,7 @@ int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused)
perf_guest = 1;
if (!file_name) {
- if (perf_host && !perf_guest)
- file_name = strdup("perf.data.host");
- else if (!perf_host && perf_guest)
- file_name = strdup("perf.data.guest");
- else
- file_name = strdup("perf.data.kvm");
+ file_name = get_filename_for_perf_kvm();
if (!file_name) {
pr_err("Failed to allocate memory for filename\n");
OpenPOWER on IntegriCloud