lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 14 Nov 2013 16:51:58 -0500
From:	Dongsheng Yang <yangds.fnst@...fujitsu.com>
To:	mingo@...nel.org
Cc:	linux-kernel@...r.kernel.org,
	Dongsheng Yang <yangds.fnst@...fujitsu.com>
Subject: [PATCH] perf kvm record: Change the default value of perf_guest to 0.

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@...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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ