From: Namhyung Kim <namhyung@kernel.org>
To: "Wang, Weilin" <weilin.wang@intel.com>, Ian Rogers <irogers@google.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
"Hunter, Adrian" <adrian.hunter@intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
"linux-perf-users@vger.kernel.org"
<linux-perf-users@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Taylor, Perry" <perry.taylor@intel.com>,
"Alt, Samantha" <samantha.alt@intel.com>,
"Biggers, Caleb" <caleb.biggers@intel.com>
Subject: Re: [RFC PATCH v10 3/8] perf stat: Fork and launch perf record when perf stat needs to get retire latency value for a metric.
Date: Tue, 4 Jun 2024 15:32:40 -0700 [thread overview]
Message-ID: <Zl-WCEhhxBtiGGhn@google.com> (raw)
In-Reply-To: <CO6PR11MB563511F1A6165F0F4B30C4DFEEF82@CO6PR11MB5635.namprd11.prod.outlook.com>
On Tue, Jun 04, 2024 at 08:00:26PM +0000, Wang, Weilin wrote:
> > On Thu, May 30, 2024 at 11:46 PM Wang, Weilin <weilin.wang@intel.com>
> > > > > + /*
> > > > > + * Only set retire_latency value to the first CPU and thread.
> > > > > + */
> > > > > + if (cpu_map_idx == 0 && thread == 0) {
> > > > > + /* Lost precision when casting from double to __u64. Any
> > > > improvement? */
> > > >
> > > > As I said before I think you can set t->val * 1000 and then
> > > > set the evsel->scale to 1e3 or 1e-3.
> > >
> > > Hi Namhyung,
> > >
> > > Sorry if this is a repeated message. I thought I replied to your suggestion
> > > on this last time. I'm thinking we should keep it like this for now and make
> > > this change unless we find the precision loss is critical. Because I thought
> > > we don't want to add special code to handle the calculation and final print
> > > to keep code simple.
> > >
> > > I kept this comment here so that we don't forget about it. Please let me
> > > know if you'd like me to remove it.
> >
> > Please see print_counter_aggrdata(). It's the generic code to print
> > the event value and it'll display the value multiplied by the scale
> > (default to 1.0). So you can keep precision as long as you set the
> > scale properly (1e-3).
>
> I could see the retire_latency is printed correctly after set the evsel->scale to 1e-3
> and multiply the t->val * 1000. However, this scale is not used in metric calculations.
> We need to add code in metric calculation or display part to scale it as well. Is that
> acceptable or do you have other suggestions?
Hmm.. I don't know if other metric already dealt with the scale like with
RAPL events.. If not, I think it's reasonable to add that to the metric
calculation.
Ian, what do you think?
Thanks,
Namhyung
next prev parent reply other threads:[~2024-06-04 22:32 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 6:43 [RFC PATCH v10 0/8] TPEBS counting mode support weilin.wang
2024-05-29 6:43 ` [RFC PATCH v10 1/8] perf parse-events: Add a retirement latency modifier weilin.wang
2024-05-29 6:43 ` [RFC PATCH v10 2/8] perf data: Allow to use given fd in data->file.fd weilin.wang
2024-05-29 6:43 ` [RFC PATCH v10 3/8] perf stat: Fork and launch perf record when perf stat needs to get retire latency value for a metric weilin.wang
2024-05-31 6:40 ` Namhyung Kim
2024-05-31 6:46 ` Wang, Weilin
2024-05-31 21:39 ` Namhyung Kim
2024-05-31 23:04 ` Wang, Weilin
2024-06-04 20:00 ` Wang, Weilin
2024-06-04 22:32 ` Namhyung Kim [this message]
2024-06-04 22:41 ` Ian Rogers
2024-06-04 23:56 ` Ian Rogers
2024-05-29 6:43 ` [RFC PATCH v10 4/8] perf stat: Plugin retire_lat value from sampled data to evsel weilin.wang
2024-05-29 6:43 ` [RFC PATCH v10 5/8] perf vendor events intel: Add MTL metric json files weilin.wang
2024-05-29 6:43 ` [RFC PATCH v10 6/8] perf stat: Add command line option for enabling tpebs recording weilin.wang
2024-05-29 6:43 ` [RFC PATCH v10 7/8] perf Document: Add TPEBS to Documents weilin.wang
2024-05-29 6:43 ` [RFC PATCH v10 8/8] perf test: Add test for Intel TPEBS counting mode weilin.wang
2024-06-02 23:20 ` Namhyung Kim
2024-06-03 17:00 ` Wang, Weilin
2024-05-31 6:37 ` [RFC PATCH v10 0/8] TPEBS counting mode support Namhyung Kim
2024-05-31 7:00 ` Wang, Weilin
2024-05-31 21:30 ` Namhyung Kim
2024-05-31 23:03 ` Wang, Weilin
2024-06-02 21:18 ` Namhyung Kim
2024-06-03 17:00 ` Wang, Weilin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zl-WCEhhxBtiGGhn@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=caleb.biggers@intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=perry.taylor@intel.com \
--cc=peterz@infradead.org \
--cc=samantha.alt@intel.com \
--cc=weilin.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).