From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933772AbeAXLwg (ORCPT ); Wed, 24 Jan 2018 06:52:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36036 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933712AbeAXLwd (ORCPT ); Wed, 24 Jan 2018 06:52:33 -0500 From: Jiri Olsa To: Peter Zijlstra , Ingo Molnar Cc: lkml , Namhyung Kim , David Ahern , Andi Kleen , Alexander Shishkin , Andy Lutomirski , Arnaldo Carvalho de Melo Subject: [PATCH 20/21] perf report: Add user data processing stats Date: Wed, 24 Jan 2018 12:51:42 +0100 Message-Id: <20180124115143.14322-21-jolsa@kernel.org> In-Reply-To: <20180124115143.14322-1-jolsa@kernel.org> References: <20180124115143.14322-1-jolsa@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding user data processing stats for to review the processing. Adding following per-thread counters: user_data_sample - nb of samples with with PERF_RECORD_MISC_USER_DATA set user_data_event - nb of user data events user_data_match - nb of samples that matched user data event user_data_drop - nb of samples that did not match any user data event and were drop Link: http://lkml.kernel.org/n/tip-j4zh9fpntjbtjo993cjdn92b@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/builtin-report.c | 6 ++++++ tools/perf/util/thread.h | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index a1cd5fd793fc..82b2368d208a 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -314,6 +314,7 @@ perf_thread__add_user_data(struct thread *thread, return -ENOMEM; } + thread->stats.user_data_sample++; list_add_tail(&entry->list, &thread->user_data_list); return 0; } @@ -425,6 +426,8 @@ thread__flush_user_data(struct thread *thread, struct user_data *entry, *p; int ret = 0; + thread->stats.user_data_event++; + list_for_each_entry_safe(entry, p, &thread->user_data_list, list) { /* different event, skip it */ if (entry->sample.id != sample->id) @@ -439,6 +442,9 @@ thread__flush_user_data(struct thread *thread, ret = user_data__process(entry, sample, event, rep); if (ret) pr_debug("problem adding hist entry, skipping event\n"); + thread->stats.user_data_match++; + } else { + thread->stats.user_data_drop++; } list_del(&entry->list); diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index e78b295bbcdb..742bbf8cb285 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h @@ -22,6 +22,13 @@ struct user_data { struct perf_evsel *evsel; }; +struct thread_stats { + u64 user_data_sample; + u64 user_data_event; + u64 user_data_match; + u64 user_data_drop; +}; + struct thread { union { struct rb_node rb_node; @@ -51,6 +58,7 @@ struct thread { void *addr_space; struct unwind_libunwind_ops *unwind_libunwind_ops; #endif + struct thread_stats stats; }; struct machine; -- 2.13.6