Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp450790ybb; Wed, 1 Apr 2020 03:19:12 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuXZk7PdwmeimaQ1Fvk8P0Ay8rIH/x27SuCiRBtMdB/BRwGy4VnRspHFbMmKDRw0tGPZA+T X-Received: by 2002:a05:6830:1f54:: with SMTP id u20mr16665451oth.322.1585736352500; Wed, 01 Apr 2020 03:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585736352; cv=none; d=google.com; s=arc-20160816; b=w9iM5jQ8DyJfBIZ+wWEEvMZscAjUu+1qsYyXH8LmLBKU8pMZqie0Z4ZaFbQHRfdabR 4aK41Q18jh1xGQPdkElxJfAZGjdpGXifNg3yWjHyz/NrcUuz27gCOhfGf0YJ2akCYlUU COsBwrq4f8mFmCGQKWyPxo7czlFoVCP6DR7tCg6nDOx+zwgjnIqzBz7CFYt1TxJ17vrx LGf8+Xae8zppgmDYTZXhd0R9tBqVU31lzqhbe62sbfmX+FHLpCby+xB8E83aEXXOCwnu tqa/1+ms3rbNpVnp344Ppang4A7jK3Z2BP7Yk+AhJx8DSpSIy0t8k6QGp5ypkWX20oNH G3Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=nzOlJDHuT21++kIiFCsX9NoMhcSd9vO4LMfG5Xuqx7I=; b=ROB+xRxCD5u7LaUAp74JtsWIxH00kS83fgk5RpGtoLxI6L5FrfT+GJKN76q10qBeuw YkOxE7+nGWzCkgr7eFB7mGefxdtsQEeswVXeV+vk+zjjS4g1/tVB2CL6h4KiIT27l5JD HGx3scuX7IZ37f+hUy0hwq/6Jp57dYkb9rqklY2BWpO6fdmZPFpwzwM1damW//EIAVhm DMBD7+hQeqGXK1Wb7UBKhXarbykB2PTXvedqOsuPEiJrvXX7iVyYl2HXMu1yw6SywqA2 SgQKungjaKc3b/8T23XY7qF60JtwGe462gaLkPZnwoyVzA4r8ibkZFHtNFAvHeQiKhgg frUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si685630otp.266.2020.04.01.03.19.00; Wed, 01 Apr 2020 03:19:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732256AbgDAKRz (ORCPT + 99 others); Wed, 1 Apr 2020 06:17:55 -0400 Received: from mga01.intel.com ([192.55.52.88]:34152 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732241AbgDAKRx (ORCPT ); Wed, 1 Apr 2020 06:17:53 -0400 IronPort-SDR: uwi6iFDb35GfQlhMkXMJzPEcpkKT79yxIogyq33fmBlJzV9DCWfcFSughCp9JN0nST+qMYDAc8 rOlu+CtyCBmQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2020 03:17:51 -0700 IronPort-SDR: HQ7ev7S2ehkI8t6nWVEsj3HbOqEu2Dgcd6qYrTN8Q6LOTLRxoqgdjtB5jXIBm/zt8sROevLHTE Q5lMBiQ9mjew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,331,1580803200"; d="scan'208";a="395925558" Received: from ahunter-desktop.fi.intel.com ([10.237.72.87]) by orsmga004.jf.intel.com with ESMTP; 01 Apr 2020 03:17:51 -0700 From: Adrian Hunter To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Andi Kleen , linux-kernel@vger.kernel.org, Adrian Hunter Subject: [PATCH 10/16] perf tools: Add support for synthesized sample type Date: Wed, 1 Apr 2020 13:16:07 +0300 Message-Id: <20200401101613.6201-11-adrian.hunter@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200401101613.6201-1-adrian.hunter@intel.com> References: <20200401101613.6201-1-adrian.hunter@intel.com> Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- tools/perf/util/evsel.c | 2 +- tools/perf/util/evsel.h | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index eb880efbce16..60e6cd49dee3 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -2136,7 +2136,7 @@ int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event, } } - if (evsel__has_callchain(evsel)) { + if (type & PERF_SAMPLE_CALLCHAIN) { const u64 max_callchain_nr = UINT64_MAX / sizeof(u64); OVERFLOW_CHECK_u64(array); 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.17.1