lkml.org 
[lkml]   [2013]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/7] perf tools: Add support of user space symbols for guest in perf kvm top.
Date

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


\
 
 \ /
  Last update: 2013-12-20 09:21    [W:2.302 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site