Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1367257ybz; Thu, 16 Apr 2020 07:59:42 -0700 (PDT) X-Google-Smtp-Source: APiQypJCcqVrjDH6n/mQS4yuFgPriylssM5QApUEdfih1kbJ2CBpsU6a4Uj3b1mKPRFa1CfH7FEC X-Received: by 2002:a50:9dc4:: with SMTP id l4mr30698439edk.234.1587049181821; Thu, 16 Apr 2020 07:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587049181; cv=none; d=google.com; s=arc-20160816; b=Sz+UZFUsBTjqSwqKRKCLejj4Myx1MpjMALNf5r4eynDYVKqPYwlPNCnoEl8GximuTE J8JbixcNjfJnFZD/gmmtvAVVm9pBGFxuqTF+6SYzoJkTQZupDOa5PmB0QT6wVN0lRNwf Bc27Jftj5pgCIFwIA/FPcgTHMB2eo4ST6ePjpOhwZl6JUaP8+gk8VBzfOLsope5orrLd 5BgE86fvL7PGLpOn5HBJEw1sOXcSLFSxPrz29doLBZipHFDcyae7V9b9DFW8G1c4qKCc lLFqI5SxdnTYN9TdoCNLOymPOI1YhpuV/Rb4XYbDIDudW+01MCvAjhdmqPgpg+ENx6Gx NemQ== 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=ayGQgUTRID9GEmunMYdarzjkWcmhCRbQvl02NWxC1jk=; b=ggDYqKV5G6gZZ7q3wABiMe9kERW8IUGhBZrSzs1kku5sgMK8lp3SFOivd1XYUZnlHG WjKXoUkvNj6dQJOomwu2zId4M5QiRenVgFMp3BoOeDTnP6dO7wXFIu/8+H3dom6ySW5d HH5leFb8gRpgMvYPbN7uT2YHNvYGWRP4298m/+eN21eYOcoUFTcY+4JyOwrfl4A1xdrB r4+3TBrI5SJLegp+7C0ZgCULW6CxFWe0c0g+WoNS4afOPM7SZe9KAUw62C2g9kIp6tH3 MP9KKLB2wbS47Ml6Yg5lWXA5IF3UrV3x4PbmA5orIIy9LYL2ZMtbFRwVIDdQBm4c5L/C vVyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nR2DKDho; 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 y24si11904548ejr.132.2020.04.16.07.59.18; Thu, 16 Apr 2020 07:59:41 -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=nR2DKDho; 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 S1728695AbgDPO5U (ORCPT + 99 others); Thu, 16 Apr 2020 10:57:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2409337AbgDPO5I (ORCPT ); Thu, 16 Apr 2020 10:57:08 -0400 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C1AAC061A0C for ; Thu, 16 Apr 2020 07:57:08 -0700 (PDT) Received: by mail-qv1-xf43.google.com with SMTP id c12so2130252qvj.5 for ; Thu, 16 Apr 2020 07:57:08 -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=ayGQgUTRID9GEmunMYdarzjkWcmhCRbQvl02NWxC1jk=; b=nR2DKDho8XHafYwLEV0Gre/Y3+Yuh1C4Tgo9jOemer0vEV0PRHNcKVaBBJByc8ieaQ 3ZNv/i4KHvKmRpR/kTjG+unp/OPlqGtid4rKMnnVkUAs32mRQgEtL3KZqUk6z7TvZ0wW ogj1Q4rk1SB/sb5X8U88QwWHnIfWD61NnxImlEBx8k897wTemNZqvBn5u5+VzhCqtzQ/ JpqB7hAbq60ro4hXW1eu0/RCqNwr5pQBwLCtX4HiRlk42qCLcl6G4y4oKBrZqShQ6c38 sRf5xD/nA5TPqsn3PC4pClIanKSBe2zSViWSlsD2fLCTIt0XZQXztFdHliqeAy01no8k EKYA== 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=ayGQgUTRID9GEmunMYdarzjkWcmhCRbQvl02NWxC1jk=; b=a2Ro2bzPhdUUvvnuBdwNWPgKcsWvmQipLDzHtIFbi4guvYPZP0/mGCylgg261zhfO4 3YiaBKTtdVXbPMequoyxL/g090TI1JKMQfgXrUGpqjhfmHWC9ZfQ1gX92dwDQzfHTSNu lI+GSWRrO9HMXmJysy1FtsOOwqXu1utYLim/OxfGptyO5OLOy+/lr7zdfOoThfmxQbu/ V0CXvuB7wwlBmAgRoLdL8e63lQZQU7NkqtRnxkF6mBJubyTclPz4wGf1hoIFaUrUIujD 8WkXv5EcpRjkKJQQDksacanOOB0AgfSX6gCBYfZLISs6RxreDHh09BMBL9zqCarF3ugg D2Jw== X-Gm-Message-State: AGi0PubeFzLyPDivfNOpn1+kNTW488UyMkAnPwodIsd9NUavHe+c21Ai Abe57XcDow7rh/GP551Xnu4= X-Received: by 2002:a0c:9aea:: with SMTP id k42mr10542592qvf.91.1587049027292; Thu, 16 Apr 2020 07:57:07 -0700 (PDT) Received: from quaco.ghostprotocols.net ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id x7sm9827437qkx.36.2020.04.16.07.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2020 07:57:06 -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 978BB409A3; Thu, 16 Apr 2020 11:57:04 -0300 (-03) Date: Thu, 16 Apr 2020 11:57:04 -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: <20200416145704.GA1842@kernel.org> References: <20200401101613.6201-1-adrian.hunter@intel.com> <20200401101613.6201-11-adrian.hunter@intel.com> <20200416145426.GA31666@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200416145426.GA31666@kernel.org> 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 Thu, Apr 16, 2020 at 11:54:26AM -0300, Arnaldo Carvalho de Melo escreveu: > 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. I've added this as the cset comment: Using 'type' variable for checking for callchains is equivalent to using evsel__has_callchain(evsel) and is how the other PERF_SAMPLE_ bits are checked in this function, so use it to be consistent. > 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 -- - Arnaldo