mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "nakamura.shun@fujitsu.com" <nakamura.shun@fujitsu.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Rob Herring <robh@kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-perf-users <linux-perf-users@vger.kernel.org>,
	Jiri Olsa <jolsa@kernel.org>
Subject: Re: [PATCH v5 3/3] libperf tests: Add test_stat_multiplexing test
Date: Tue, 21 Dec 2021 08:18:22 +0000	[thread overview]
Message-ID: <OSBPR01MB46004A56EC0CB66FAD6EC4FCF77C9@OSBPR01MB4600.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CAM9d7ci3Uycj21X4XXu-MxV--k=gtYkS-H+vGWheKC-YG+d3Wg@mail.gmail.com>

Hi Namhyung

Sorry for the late reply.

> > +static double display_error(long long average,
> > +                           long long high,
> > +                           long long low,
> > +                           long long expected)
> > +{
> > +       double error;
> > +
> > +       error = (((double)average - expected) / expected) * 100.0;
> > +
> > +       __T_VERBOSE("   Expected: %lld\n", expected);
> > +       __T_VERBOSE("   High: %lld   Low:  %lld   Average:  %lld\n",
> > +                   high, low, average);
> > +
> > +       __T_VERBOSE("   Average Error = %.2f%%\n", error);
> > +
> > +       return error;
> > +}
> > +
> > +static int test_stat_multiplexing(void)
> > +{
> > +       struct perf_counts_values expected_counts = { .val = 0 };
> > +       struct perf_counts_values counts[EVENT_NUM] = {{ .val = 0 },};
> > +       struct perf_thread_map *threads;
> > +       struct perf_evlist *evlist;
> > +       struct perf_evsel *evsel;
> > +       struct perf_event_attr attr = {
> > +               .type        = PERF_TYPE_HARDWARE,
> > +               .config      = PERF_COUNT_HW_INSTRUCTIONS,
> > +               .read_format = PERF_FORMAT_TOTAL_TIME_ENABLED |
> > +                              PERF_FORMAT_TOTAL_TIME_RUNNING,
> > +               .disabled    = 1,
> 
> It'd be nice if you use a less restrictive event attribute
> so that we can test it on VM or with non-root.
> 
> How about using SOFTWARE / CPU_CLOCKS with
> exclude_kernel = 1 ?

I'm currently working on adding a new API for libperf.
So, I will respond to the above comments around the end of January.


Best Regards
Shunsuke

  reply	other threads:[~2021-12-21  8:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07  8:22 [PATCH v5 0/3] libperf: Unify scaling of counters obtained from perf_evsel__read() Shunsuke
2021-12-07  8:22 ` [PATCH v5 1/3] libperf: Move perf_counts_values__scale to tools/lib/perf Shunsuke
2021-12-07  8:22 ` [PATCH v5 2/3] libperf: Remove scaling process from perf_mmap__read_self() Shunsuke
2021-12-07  8:22 ` [PATCH v5 3/3] libperf tests: Add test_stat_multiplexing test Shunsuke
2021-12-09 23:57   ` Namhyung Kim
2021-12-21  8:18     ` nakamura.shun [this message]
2021-12-08 21:18 ` [PATCH v5 0/3] libperf: Unify scaling of counters obtained from perf_evsel__read() Jiri Olsa

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=OSBPR01MB46004A56EC0CB66FAD6EC4FCF77C9@OSBPR01MB4600.jpnprd01.prod.outlook.com \
    --to=nakamura.shun@fujitsu.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=robh@kernel.org \
    /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

all inboxes | Powered by JetHome®