lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <OSBPR01MB46004A56EC0CB66FAD6EC4FCF77C9@OSBPR01MB4600.jpnprd01.prod.outlook.com>
Date:   Tue, 21 Dec 2021 08:18:22 +0000
From:   "nakamura.shun@...itsu.com" <nakamura.shun@...itsu.com>
To:     Namhyung Kim <namhyung@...nel.org>
CC:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>, Rob Herring <robh@...nel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        linux-perf-users <linux-perf-users@...r.kernel.org>,
        Jiri Olsa <jolsa@...nel.org>
Subject: Re: [PATCH v5 3/3] libperf tests: Add test_stat_multiplexing test

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ