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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 20 Dec 2013 15:53:01 -0500
From:	Dongsheng Yang <yangds.fnst@...fujitsu.com>
To:	acme@...stprotocols.net, linux-kernel@...r.kernel.org
Cc:	mingo@...nel.org, namhyung.kim@....com, jolsa@...hat.com,
	dsahern@...il.com, Dongsheng Yang <yangds.fnst@...fujitsu.com>
Subject: [PATCH 6/7] perf tools: Add support of user space symbols for guest in perf kvm top.

	# perf kvm --guestmount /tmp/guestmount/ top
	Samples: 1K of event 'cycles', Event count (approx.): 259112905
	 17.34%  libcrypto.so.1.0.1e  [u] 0x000000000007d971
	  5.60%  [guest.kernel]       [g] kallsyms_expand_symbol
	  5.44%  libcrypto.so.1.0.1e  [u] md5_block_asm_data_order
	  4.09%  [guest.kernel]       [g] number.isra.1
	  3.59%  [guest.kernel]       [g] vsnprintf
	  3.52%  sshd                 [u] 0x00000000000441c0
	  2.37%  [guest.kernel]       [g] format_decode
	  2.36%  [guest.kernel]       [g] memcpy
	  2.11%  [guest.kernel]       [g] strnlen

Signed-off-by: Dongsheng Yang <yangds.fnst@...fujitsu.com>
---
 tools/perf/builtin-top.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 03d37a7..670bd0b 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -821,11 +821,9 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
 			break;
 		case PERF_RECORD_MISC_GUEST_USER:
 			++top->guest_us_samples;
-			/*
-			 * TODO: we don't process guest user from host side
-			 * except simple counting.
-			 */
-			/* Fall thru */
+			machine = perf_session__find_machine(session,
+							     sample.pid);
+			break;
 		default:
 			goto next_event;
 		}
@@ -912,6 +910,7 @@ static int __cmd_top(struct perf_top *top)
 	struct perf_record_opts *opts = &top->record_opts;
 	pthread_t thread;
 	int ret;
+	struct rb_node *nd;
 
 	top->session = perf_session__new(NULL, false, NULL);
 	if (top->session == NULL)
@@ -931,6 +930,12 @@ static int __cmd_top(struct perf_top *top)
 
 	machine__synthesize_threads(&top->session->machines.host, &opts->target,
 				    top->evlist->threads, false);
+
+	for (nd = rb_first(&top->session->machines.guests); nd; nd = rb_next(nd)) {
+		struct machine *pos = rb_entry(nd, struct machine, rb_node);
+		machine__synthesize_threads(pos, &opts->target, top->evlist->threads, false);
+	}
+
 	ret = perf_top__start_counters(top);
 	if (ret)
 		goto out_delete;
-- 
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