X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_profiler.c;h=46a9e5e9ba372aba72eaaaf8367d17c0ed7db514;hb=f2c389745faae8bbd6e16b60baa59c01e735949f;hp=362b8c939f429549aad37d1322f2b49ab69aa226;hpb=362391accc505b29d938e9d0a21bf6a28a8cee34;p=palacios.git diff --git a/palacios/src/palacios/vmm_profiler.c b/palacios/src/palacios/vmm_profiler.c index 362b8c9..46a9e5e 100644 --- a/palacios/src/palacios/vmm_profiler.c +++ b/palacios/src/palacios/vmm_profiler.c @@ -37,6 +37,7 @@ void v3_init_profiler(struct guest_info * info) { info->profiler.start_time = 0; info->profiler.end_time = 0; + info->profiler.guest_pf_cnt = 0; info->profiler.root.rb_node = NULL; } @@ -119,7 +120,11 @@ void v3_profile_exit(struct guest_info * info, uint_t exit_code) { insert_event(info, evt); } - evt->handler_time += time; + + + evt->handler_time = (evt->handler_time * .99) + (time * .01); + + evt->exit_count++; info->profiler.total_exits++; @@ -130,12 +135,17 @@ void v3_print_profile(struct guest_info * info) { struct exit_event * evt = NULL; struct rb_node * node = v3_rb_first(&(info->profiler.root)); + PrintDebug("GUEST_PF: %u\n", info->profiler.guest_pf_cnt); + do { evt = rb_entry(node, struct exit_event, tree_node); + const char * code_str = vmexit_code_to_str(evt->exit_code); - PrintDebug("%s: Cnt=%u, Time=%u\n", - vmexit_code_to_str(evt->exit_code), + PrintDebug("%s:%sCnt=%u,%sTime=%u\n", + code_str, + (strlen(code_str) > 14) ? "\t" : "\t\t", evt->exit_count, + (evt->exit_count >= 100) ? "\t" : "\t\t", evt->handler_time); } while ((node = v3_rb_next(node)));