Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1366533ybz; Thu, 16 Apr 2020 07:58:54 -0700 (PDT) X-Google-Smtp-Source: APiQypJnu369vw6cv94/w/AZNrCOosdHHKTCMqj/KPqquUwCioqjOJMA+t08doKwxAgE8CPssYCB X-Received: by 2002:a17:906:2443:: with SMTP id a3mr9567896ejb.291.1587049134427; Thu, 16 Apr 2020 07:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587049134; cv=none; d=google.com; s=arc-20160816; b=W5qMtEORhd6EGIG4TwevcSLzNH8iKgg2wkxI3Gi1WmHcMpFRHmr4cpTrwhIZlu/x3S PaKk/xB8yFxgH9JyYntm5ebcqfIcfqDlI6o+H/jG9XI+jOlhBVVUoz21ElQ+qbHPzvC9 v8GWw6YdQMOWJyYUts8DuhR69oieHlCD4NPGUMQT+URivuW70+HYDPfkNpl35l1oYyao dJDBXcpXfjbGhFQEsMDlo11SEXbKqtxDsotqZrmNiBnQB97X6qwXj5vQbHmhENnKugzs pYj0h5SKR+XrU5GHz4vT0rBiMXlhGkif9snUYIwheMlMhcg5T/rTiesx22OdJweBnUGk pBjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=Etbk7rdNgMqH7Cm8FhnpqP53Wbqbw8Y1RuUVXb+PXc0=; b=IpsAlZ7fyAET7nsAZ1+lXeNxPl0QzY6Kmwc3vO6PDpufnmcCJ5vaykI2BL7P85SRoj yACJxiiPGkEqnslnuLaPSOgcgBMbJkCkWIN9ALs0T4+BpClsYlWX8meqlmTi7pra5Bfm AGaRdMre/77ezNMx8MiGPVRX7b8GEIqU/wuEijlRhOjBbGvmkRtTDhyBhEWwMxSMwlDB BrfejImA6wmm7OQSUn8j6iwItDsNZywVqA9FE7WAXayKc4jw/UHtrG0+RyxajgtVkCbR F+I74QVWxKBrbT+J/lvX98LeG4L4e68DbxgajsQtUBIOKPIXDiFqjSukkD75HOEvs6Q6 52CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mPAP3fsG; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si9753484edr.596.2020.04.16.07.58.31; Thu, 16 Apr 2020 07:58:54 -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=@gmail.com header.s=20161025 header.b=mPAP3fsG; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404338AbgDPOyh (ORCPT + 99 others); Thu, 16 Apr 2020 10:54:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2405907AbgDPOyb (ORCPT ); Thu, 16 Apr 2020 10:54:31 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58362C061A0C for ; Thu, 16 Apr 2020 07:54:31 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id w29so16178281qtv.3 for ; Thu, 16 Apr 2020 07:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Etbk7rdNgMqH7Cm8FhnpqP53Wbqbw8Y1RuUVXb+PXc0=; b=mPAP3fsGoyvk1dnOOsH0XuvNzRFb5Jg50JWZ4sXWpWeMM88oUYkrd7xnyCnkhz9abZ M0tvegs1eXEdDVTgD1mIOrssZf0+UbBQVBNEMzNgHbXSO5032WKTKgC9VdrBeR+9X1cV pSg7OlcUuubn/X8tcG7T3wlNxPaoS8ty1329CIt/c7AExIdPScqmU4RHjigWP6ymcEwZ Gjy+FnbuKId4045xM2NkGxdqzZmWjO4XGu7Fv8LNKy/axEl7fAaUUOvbcXgJ5M4AtWn2 hA9Wskt5DOvDWwXGoiZVymfGI6wp3b9QnVDPoTtLB/TStossYehgvTmWij4KETVqMuJz 9cfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Etbk7rdNgMqH7Cm8FhnpqP53Wbqbw8Y1RuUVXb+PXc0=; b=WqSyzFWkikaoi1x5KOS3qLU2Ytx9yYu8j95/MmHYQzqxwCj/TaOgb4/gysINVTAfkj ifbv6YqCEkMwBz+A9dPn0H9ggUT0ma19+1KEJu4WNPSCl7I+oY9bKgOBw5ILCrA1oziU 18nu80gM9M1zVLp3ZkZulB1NBMJUO4rhVqi1dO5U+u4QbHOkdMrEyD4FEHzG1ufuDlwp TJbQpUrjpm/GAh9sCpDQPIFFW5xbbUQ0JcsvLa5z4F/1w7gssx6W8El7DnxhP1TRwD6o Avpf9T9J+KDqxP4GwPob1hfE1azEt7lwO6V2xIuukizkteWbCBUFqSFnXnYdMIGXdCn3 z6bw== X-Gm-Message-State: AGi0PuaTv9aPhfJjp11m/STf+KZ4yVZiA84ghOFGT3DHh8478JZkkKSf pEUGEm6mvRLADicriruTv74= X-Received: by 2002:ac8:3466:: with SMTP id v35mr26649342qtb.308.1587048870419; Thu, 16 Apr 2020 07:54:30 -0700 (PDT) Received: from quaco.ghostprotocols.net ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id y17sm11707586qky.33.2020.04.16.07.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2020 07:54:29 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id B7A70409A3; Thu, 16 Apr 2020 11:54:26 -0300 (-03) Date: Thu, 16 Apr 2020 11:54:26 -0300 To: Adrian Hunter Cc: Jiri Olsa , Andi Kleen , linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/16] perf tools: Add support for synthesized sample type Message-ID: <20200416145426.GA31666@kernel.org> References: <20200401101613.6201-1-adrian.hunter@intel.com> <20200401101613.6201-11-adrian.hunter@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200401101613.6201-11-adrian.hunter@intel.com> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Apr 01, 2020 at 01:16:07PM +0300, Adrian Hunter escreveu: > 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); This ends up looking unrelated, I had to go and look at the source to see that this is just a simplification, i.e. earlier in this function (perf_evsel__parse_sample) we have: u64 type = evsel->core.attr.sample_type; So the above doesn't change anything, good, but slowed reviewing a bit, please consider next time to have this in a separate patch, I'll do it this time. Thanks, - Arnaldo > 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 > -- - Arnaldo