Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3540865ybz; Mon, 20 Apr 2020 04:59:36 -0700 (PDT) X-Google-Smtp-Source: APiQypKeGhlr66Gza0YUHy4JBCKEoNXK/YHVTeaK3vD6HMQxm6TqOCfp/tkwrSjCf6tkvwu8Y+z+ X-Received: by 2002:a17:906:2b89:: with SMTP id m9mr15216568ejg.302.1587383976696; Mon, 20 Apr 2020 04:59:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587383976; cv=none; d=google.com; s=arc-20160816; b=QAEk71Up2PPfwXhvVx0uD1HZf/6HfKPeCD5rTV1vAnqWX0Bd1mO2YnWuEyxWXieOnL RVhzsyRzAr1Z/gzXUPqlPjHr8D9cCbLdUS0oMsC7vgYIORmdnZZPOpY7eaGj2pzd11p+ GDGtS9eqQaN/1C5sR5MSJznyc3S9l3jX8YhphwLDQErwIRlCy+37mO/mEfUOSerha3B2 8e1uCr9XXandnNrsHiGGKdegmBE3z16zvSOCzG0G7j6p0BEm8ukPRvv8MIaUwtpCOAJj yStYVcEI4E7koJbyfIudWw3I1AY/eXn8+qh/0hz5XYYJwyIbZ9LWZK1AwDls8g59aU1z R9iA== 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=LzPGSD2ykKcixcvyJ2bqwoUBvYcLhUfprIg8liVVmbk=; b=r8S2pcp4VNpwgpOsuvqpk9R/nshqQ2YQpmI8tlrVjNymrvjlafkgg8Rc6qk+CNNhi0 P0XszumdalC8UAGG3QN9zipI/MUoM+DFtr2AlNjj/nWlq1l22MlQ6nFCn0+1CByVT8D7 nJtLJGwfKOw4am9KZcd+NIDgju7VYwtMlaWMwFh4tUIkF+1ioTRsP+JqRYLNxwCkTLbY fY3b4o+l17fo+5xMZOn0BVSgsQPmwdWGMAAXTXUgvG97SjkS2I8TkqQzIgHhgNd+sywb tgI1+/t0F1CC7cWR6stduQBQwfbigFECt4x2wVA2Jq3ACIgbC4jH0LXqoVq+OxIPDgF/ 3esQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0Wum3tJF; 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 p18si412202ejl.98.2020.04.20.04.59.13; Mon, 20 Apr 2020 04:59:36 -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=0Wum3tJF; 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 S1726775AbgDTL4M (ORCPT + 99 others); Mon, 20 Apr 2020 07:56:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:40402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbgDTL4G (ORCPT ); Mon, 20 Apr 2020 07:56:06 -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 96E0021744; Mon, 20 Apr 2020 11:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587383766; bh=AqQD4sxd4DWZ99ZebKG5eBlkR+OUVebxgHrra1nrocQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0Wum3tJF8nB3BLdK01pGL0RBx77WmWY6WEkVswoMG+M0WvPhOHtFjRfpcw4ZXX3tE EqueuKKMkOH5ivJayI9L/Pzae8UTxfrnkxOu8Gu0QUp0IttRa7XBbf8Uvq1YkGe3WY Gg7id50GFEm7wx4bTg5gnDcEMAr44pEoYDzNuuu0= 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 , Arnaldo Carvalho de Melo Subject: [PATCH 35/60] perf evsel: Add support for synthesized sample type Date: Mon, 20 Apr 2020 08:52:51 -0300 Message-Id: <20200420115316.18781-36-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 For reporting purposes, an evsel sample can have a callchain synthesized from AUX area data. Add support for keeping track of synthesized sample types. Note, the recorded sample_type cannot be changed because it is needed to continue to parse events. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20200401101613.6201-11-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/evsel.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 53187c501ee8..e64ed4202cab 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -104,6 +104,14 @@ struct evsel { perf_evsel__sb_cb_t *cb; void *data; } side_band; + /* + * For reporting purposes, an evsel sample can have a callchain + * synthesized from AUX area data. Keep track of synthesized sample + * types here. Note, the recorded sample_type cannot be changed because + * it is needed to continue to parse events. + * See also evsel__has_callchain(). + */ + __u64 synth_sample_type; }; struct perf_missing_features { @@ -398,7 +406,12 @@ static inline bool perf_evsel__has_branch_hw_idx(const struct evsel *evsel) static inline bool evsel__has_callchain(const struct evsel *evsel) { - return (evsel->core.attr.sample_type & PERF_SAMPLE_CALLCHAIN) != 0; + /* + * For reporting purposes, an evsel sample can have a recorded callchain + * or a callchain synthesized from AUX area data. + */ + return evsel->core.attr.sample_type & PERF_SAMPLE_CALLCHAIN || + evsel->synth_sample_type & PERF_SAMPLE_CALLCHAIN; } struct perf_env *perf_evsel__env(struct evsel *evsel); -- 2.21.1