Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S939012AbcKWRqL (ORCPT ); Wed, 23 Nov 2016 12:46:11 -0500 Received: from mga14.intel.com ([192.55.52.115]:40054 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938726AbcKWRpB (ORCPT ); Wed, 23 Nov 2016 12:45:01 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,539,1473145200"; d="scan'208";a="1072652974" From: kan.liang@intel.com To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, linux-kernel@vger.kernel.org Cc: alexander.shishkin@linux.intel.com, tglx@linutronix.de, namhyung@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com, wangnan0@huawei.com, mark.rutland@arm.com, andi@firstfloor.org, Kan Liang Subject: [PATCH 10/14] perf tools: introduce PERF_RECORD_USER_OVERHEAD Date: Wed, 23 Nov 2016 04:44:48 -0500 Message-Id: <1479894292-16277-11-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1479894292-16277-1-git-send-email-kan.liang@intel.com> References: <1479894292-16277-1-git-send-email-kan.liang@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2113 Lines: 60 From: Kan Liang User space perf tool also bring overhead. Introduce PERF_RECORD_USER_OVERHEAD to track the overhead information. Signed-off-by: Kan Liang --- tools/perf/util/event.c | 1 + tools/perf/util/event.h | 1 + tools/perf/util/session.c | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index ca98c4c..6cd43c9 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -48,6 +48,7 @@ static const char *perf_event__names[] = { [PERF_RECORD_STAT_ROUND] = "STAT_ROUND", [PERF_RECORD_EVENT_UPDATE] = "EVENT_UPDATE", [PERF_RECORD_TIME_CONV] = "TIME_CONV", + [PERF_RECORD_USER_OVERHEAD] = "USER_OVERHEAD", }; const char *perf_event__name(unsigned int id) diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 3357529..1ef1a9d 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -237,6 +237,7 @@ enum perf_user_event_type { /* above any possible kernel type */ PERF_RECORD_STAT_ROUND = 77, PERF_RECORD_EVENT_UPDATE = 78, PERF_RECORD_TIME_CONV = 79, + PERF_RECORD_USER_OVERHEAD = 80, PERF_RECORD_HEADER_MAX }; diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index e3aa9d7..27a5c8a 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -804,6 +804,7 @@ static perf_event__swap_op perf_event__swap_ops[] = { [PERF_RECORD_STAT_ROUND] = perf_event__stat_round_swap, [PERF_RECORD_EVENT_UPDATE] = perf_event__event_update_swap, [PERF_RECORD_TIME_CONV] = perf_event__all64_swap, + [PERF_RECORD_USER_OVERHEAD] = perf_event__all64_swap, [PERF_RECORD_HEADER_MAX] = NULL, }; @@ -1382,6 +1383,9 @@ static s64 perf_session__process_user_event(struct perf_session *session, case PERF_RECORD_TIME_CONV: session->time_conv = event->time_conv; return tool->time_conv(tool, event, session); + case PERF_RECORD_USER_OVERHEAD: + overhead_stats_update(tool, session->evlist, event); + return tool->overhead(tool, event, NULL, NULL); default: return -EINVAL; } -- 2.5.5