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: <OSBPR01MB4600730F77F5D2E5EA009227F7F59@OSBPR01MB4600.jpnprd01.prod.outlook.com>
Date:   Wed, 20 Apr 2022 08:22:50 +0000
From:   "nakamura.shun@...itsu.com" <nakamura.shun@...itsu.com>
To:     'Jiri Olsa' <olsajiri@...il.com>
CC:     "peterz@...radead.org" <peterz@...radead.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "acme@...nel.org" <acme@...nel.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "alexander.shishkin@...ux.intel.com" 
        <alexander.shishkin@...ux.intel.com>,
        "jolsa@...hat.com" <jolsa@...hat.com>,
        "namhyung@...nel.org" <namhyung@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-perf-users@...r.kernel.org" <linux-perf-users@...r.kernel.org>
Subject: RE: [RFC PATCH v2 0/7] libperf: Add interface for overflow check of
 sampling events

Hi jirka

> On Mon, Apr 11, 2022 at 08:23:54AM +0000, nakamura.shun@...itsu.com wrote:
> > Hi jirka
> >
> > Sorry for the late reply.
> >
> > > >
> > > > Shunsuke Nakamura (7):
> > > >   libperf tests: Fix typo in the error message
> > > >   libperf: Move 'open_flags' from tools/perf to evsel::open_flags
> > > >   libperf: Add perf_evsel__{refresh, period}() functions
> > > >   libperf: Introduce perf_{evsel, evlist}__open_opt with extensible
> > > >     struct opts
> > > >   libperf: Add perf_evsel__check_overflow() functions
> > > >   libperf test: Add test_stat_overflow()
> > > >   libperf test: Add test_stat_overflow_event()
> > >
> > > I'm getting:
> > >
> > > [root@...va perf]# make tests
> > > running static:
> > > - running tests/test-cpumap.c...OK
> > > - running tests/test-threadmap.c...OK
> > > - running tests/test-evlist.c...OK
> > > - running tests/test-evsel.c...FAILED tests/test-evsel.c:286 failed
> > > to overflow count FAILED tests/test-evsel.c:286 failed to overflow count
> > >   FAILED (2)
> > > FAILED tests/main.c:13 test evsel
> > > make: *** [Makefile:162: tests] Error 255
> > >
> > Thanks for telling me.
> > However, we could not reproduce the test failure in our environment.
> > Could you please tell me the results of your test with the addition of V=1?
> 
> sorry, forgot to answer this one..
> 
Thanks for the information.


> [root@...va perf]# LD_LIBRARY_PATH=. ./tests-shared -v
> - running tests/test-cpumap.c...OK
> - running tests/test-threadmap.c...OK
> - running tests/test-evlist.c...
> Event  0 -- Raw count = 231217013, run = 10196083, enable = 22183091
>          Scaled count = 503046909 (45.96%, 10196083/22183091) Event  1 --
> Raw count = 247219790, run = 10946246, enable = 22182044
>          Scaled count = 500979080 (49.35%, 10946246/22182044) Event  2 --
> Raw count = 268999685, run = 11943490, enable = 22180868
>          Scaled count = 499573115 (53.85%, 11943490/22180868) Event  3 --
> Raw count = 291383974, run = 12941069, enable = 22179798
>          Scaled count = 499405241 (58.35%, 12941069/22179798) Event  4 --
> Raw count = 314293846, run = 13938576, enable = 22178649
>          Scaled count = 500095052 (62.85%, 13938576/22178649) Event  5 --
> Raw count = 337393782, run = 14935798, enable = 22177192
>          Scaled count = 500974014 (67.35%, 14935798/22177192) Event  6 --
> Raw count = 360218294, run = 15933314, enable = 22175507
>          Scaled count = 501340982 (71.85%, 15933314/22175507) Event  7 --
> Raw count = 365516630, run = 16179860, enable = 22173686
>          Scaled count = 500922194 (72.97%, 16179860/22173686) Event  8 --
> Raw count = 365180177, run = 16178058, enable = 22171705
>          Scaled count = 500472130 (72.97%, 16178058/22171705) Event  9 --
> Raw count = 341205844, run = 15233252, enable = 22169603
>          Scaled count = 496571454 (68.71%, 15233252/22169603) Event 10 --
> Raw count = 318204949, run = 14234754, enable = 22167081
>          Scaled count = 495524887 (64.22%, 14234754/22167081) Event 11 --
> Raw count = 296671131, run = 13236210, enable = 22164791
>          Scaled count = 496792783 (59.72%, 13236210/22164791) Event 12 --
> Raw count = 276639189, run = 12237128, enable = 22162629
>          Scaled count = 501020477 (55.22%, 12237128/22162629) Event 13 --
> Raw count = 255437518, run = 11238588, enable = 22160497
>          Scaled count = 503677361 (50.71%, 11238588/22160497) Event 14 --
> Raw count = 232427791, run = 10239844, enable = 22158353
>          Scaled count = 502958545 (46.21%, 10239844/22158353)
>    Expected: 500221918
>    High: 503677361   Low:  231217013   Average:  500223614
>    Average Error = 0.00%
> Event  0 -- overflow flag = 0x1, POLL_UP = 1, other signal event = 0 Event  1 --
> overflow flag = 0x2, POLL_UP = 1, other signal event = 0 Event  2 -- overflow
> flag = 0x4, POLL_UP = 1, other signal event = 0 Event  3 -- overflow flag = 0x8,
> POLL_UP = 1, other signal event = 0 OK
> - running tests/test-evsel.c...
>         loop = 65536, count = 328183
>         loop = 131072, count = 655863
>         loop = 262144, count = 1320613
>         loop = 524288, count = 2621943
>         loop = 1048576, count = 5243383
>         loop = 65536, count = 66349
>         loop = 131072, count = 131789
>         loop = 262144, count = 264697
>         loop = 524288, count = 528484
>         loop = 1048576, count = 1056485
>         period = 1000000
>         overflow limit = 3, overflow count = 2, POLL_IN = 2, POLL_UP = 0, other
> signal event = 0 FAILED tests/test-evsel.c:286 failed to overflow count

This test was using standard signals (SIGIO), but after changing to real-time signals,
I confirmed that the test succeeded.
When using standard signals, it seems that if there is an overlapping timing of standard signals,
the signals generated later will be dropped.


>         period = 1000000
>         overflow limit = 3, overflow count = 5, POLL_IN = 4, POLL_UP = 1, other
> signal event = 0 FAILED tests/test-evsel.c:286 failed to overflow count

Fixed implementation of overflow counter not clearing on test failure.


>   FAILED (2)
> FAILED tests/main.c:13 test evsel
> 
I will post a v3 patch with the above fixes.

Best Regards
Shunsuke

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ