lkml.org 
[lkml]   [2021]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 3/3] libperf tests: Add test_stat_multiplexing test
Date
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
\
 
 \ /
  Last update: 2021-12-21 09:26    [W:0.048 / U:1.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site