mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
To: mingo@redhat.com
Cc: linux-kernel@vger.kernel.org, yangds.fnst@cn.fujitsu.com
Subject: [PATCH] perf kvm record: Change the default value of perf_guest to 0.
Date: Thu, 14 Nov 2013 16:29:49 -0500	[thread overview]
Message-ID: <1384464589-12346-1-git-send-email-yangds.fnst@cn.fujitsu.com> (raw)

Currently, we can not record the event counters of host to perf.data.host.
Example:
   perf kvm --host record -a sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.625 MB perf.data.guest (~27290 samples) ]

The record file is named 'perf.data.kvm' and the content of it is about host
and guest. But we expect the record file is named 'perf.data.host' with the
counters only about host.

The issue was introduced by 1aed267(perf kvm: Do guest-only counting by default).

Actually, the following code can make sure that do guest-only by default:
    if (!perf_host)
        perf_guest = 1;

So, changing the default value from 0 to 1 is not a good idea, it prevents
us from getting 'perf.data.host' by '--host'.

With this patch applied, the behavior of perf-kvm is shown as below:
	* Default 	 -> perf.data.guest
	* --host  	 -> perf.data.host
	* --guest 	 -> perf.data.guest
	* --host --guest -> perf.data.kvm

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
 tools/perf/builtin-kvm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index cd9f920..eac8269 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1709,8 +1709,7 @@ int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused)
 		NULL
 	};
 
-	perf_host  = 0;
-	perf_guest = 1;
+	perf_host = perf_guest = 0;
 
 	argc = parse_options(argc, argv, kvm_options, kvm_usage,
 			PARSE_OPT_STOP_AT_NON_OPTION);
-- 
1.8.2.1


             reply	other threads:[~2013-11-14  8:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 21:29 Dongsheng Yang [this message]
2013-11-14 21:51 Dongsheng Yang
2013-11-14 20:38 ` David Ahern
2013-11-15 20:03   ` 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=1384464589-12346-1-git-send-email-yangds.fnst@cn.fujitsu.com \
    --to=yangds.fnst@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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

all inboxes | Powered by JetHome®