Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3541331ybz; Mon, 20 Apr 2020 05:00:13 -0700 (PDT) X-Google-Smtp-Source: APiQypLTONTE8SlSQ9gsNOEL9Lmsw3Matg0EzOJTN4iUiwT077roPm+eO5n1HB4q+uiHfaDP8cil X-Received: by 2002:a50:d5c8:: with SMTP id g8mr14239592edj.370.1587384013154; Mon, 20 Apr 2020 05:00:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587384013; cv=none; d=google.com; s=arc-20160816; b=rx4XKKHdM7Kw0E/X13DKwFC8/5gTuiE3DblxIIE4cT2SIcS7z2BiENLIaz/Kl3fCou D1ufA8yu1cPuTVGZP+vtkoTkLuntYGhaniMi5oTB5eCvvkreTJ4AHtwxS13V/0Pnn502 MoC9HitviclciMwEcmK9W49Ghn58b4Qcl9ncLv2Xhc3lRHZh+VVBTdGopLV4q9k2lfYY D8kNexH/mnD1N0i1CszMz1YDiSSb2brBAt4ckgXkpQ6xQACumEz+1Z8Tqw6htKdDKzV8 5tCk44iPRQtr2FhXKGgn/jVadcXom+12Lb7oLbNABiUxpTpfXrInpdTHpYhTZGUEqTlV SZmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sSOnNWrlRsmvmZfAbJ2KSYcu8746A71cTPazNmAUl7s=; b=1I/8wt/MoBF2t57CZJdmB/MlFvDIV5yHwe6/+IdthhulWXazNmiLZu9JTvMTvVBer5 kUZ29h517ijNeFCe6GgEtxnRYiTV4yXBaOXYWSKGz47NyLvE5J/x93y1TND8W7DFtA0u NYX7FXjoY8GdHHIIPeUnoA8KgweAlh7yaXfWlaHm6rXszZaCtEezXpkcg18Y51HNedP5 CypZFBcA3FfbB6YloQBcfQX5z5joncgUAvJWYWXVlZ+/WpGxpomXncs8WfN5+wxVyZF1 RLUqtTi/mLjErF572slhtqZ78WzlsuafYIhs7SJh2ErVMXNEqTfG7otHog2EyBmF2gNH J4zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=llAJTnPG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs26si406183ejb.527.2020.04.20.04.59.50; Mon, 20 Apr 2020 05:00:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=llAJTnPG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726944AbgDTLzh (ORCPT + 99 others); Mon, 20 Apr 2020 07:55:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:39746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726936AbgDTLze (ORCPT ); Mon, 20 Apr 2020 07:55:34 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ECE5421927; Mon, 20 Apr 2020 11:55:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587383734; bh=30CZ9PEAJfchmXoSIp9QKjRwAYs/rClC7yLCk+RuL7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=llAJTnPG+Xut6XAg4tje4gYplX0A58DKTI70+K5tucPNmwyWuqx2uhd4QBLroUgxL lfH24EIgVko9aKI154qthybxomKNbVE28KnqIrK+dBJHrQzdVr+S/7LFKrrHWNU2DF L5wsSnO6orxRT6x3H57kYp9A7JcS1nHuyfbrImxg= From: Arnaldo Carvalho de Melo To: Ingo Molnar , Thomas Gleixner Cc: Jiri Olsa , Namhyung Kim , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Adrian Hunter , Andi Kleen , Jiri Olsa , Kim Phillips , Mathieu Poirier , Thomas Richter , Arnaldo Carvalho de Melo Subject: [PATCH 25/60] perf auxtrace: Add ->evsel_is_auxtrace() callback Date: Mon, 20 Apr 2020 08:52:41 -0300 Message-Id: <20200420115316.18781-26-acme@kernel.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200420115316.18781-1-acme@kernel.org> References: <20200420115316.18781-1-acme@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adrian Hunter Add ->evsel_is_auxtrace() callback to identify if a selected event is an AUX area event. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Cc: Kim Phillips Cc: Mathieu Poirier Cc: Thomas Richter Link: http://lore.kernel.org/lkml/20200401101613.6201-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/auxtrace.c | 9 +++++++++ tools/perf/util/auxtrace.h | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 3571ce72ca28..2c4ad6838766 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -2577,3 +2577,12 @@ void auxtrace__free(struct perf_session *session) return session->auxtrace->free(session); } + +bool auxtrace__evsel_is_auxtrace(struct perf_session *session, + struct evsel *evsel) +{ + if (!session->auxtrace || !session->auxtrace->evsel_is_auxtrace) + return false; + + return session->auxtrace->evsel_is_auxtrace(session, evsel); +} diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h index e58ef160b599..db65aae5c2ea 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h @@ -21,6 +21,7 @@ union perf_event; struct perf_session; struct evlist; +struct evsel; struct perf_tool; struct mmap; struct perf_sample; @@ -166,6 +167,8 @@ struct auxtrace { struct perf_tool *tool); void (*free_events)(struct perf_session *session); void (*free)(struct perf_session *session); + bool (*evsel_is_auxtrace)(struct perf_session *session, + struct evsel *evsel); }; /** @@ -584,6 +587,8 @@ void auxtrace__dump_auxtrace_sample(struct perf_session *session, int auxtrace__flush_events(struct perf_session *session, struct perf_tool *tool); void auxtrace__free_events(struct perf_session *session); void auxtrace__free(struct perf_session *session); +bool auxtrace__evsel_is_auxtrace(struct perf_session *session, + struct evsel *evsel); #define ITRACE_HELP \ " i: synthesize instructions events\n" \ @@ -749,6 +754,13 @@ void auxtrace_index__free(struct list_head *head __maybe_unused) { } +static inline +bool auxtrace__evsel_is_auxtrace(struct perf_session *session __maybe_unused, + struct evsel *evsel __maybe_unused) +{ + return false; +} + static inline int auxtrace_parse_filters(struct evlist *evlist __maybe_unused) { -- 2.21.1