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] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 07 Sep 2019 09:40:29 -0400
From:   "Valdis Klētnieks" <valdis.kletnieks@...edu>
To:     Theodore Dubois <tbodt@...gle.com>
Cc:     a.p.zijlstra@...llo.nl, linux-kernel@...r.kernel.org,
        kernelnewbies@...nelnewbies.org
Subject: Re: perf_event wakeup_events = 0

On Fri, 06 Sep 2019 16:28:24 -0700, Theodore Dubois said:
> The man page for perf_event_open(2) says that recent kernels treat a 0
> value for wakeup_events the same as 1, which I believe means it will
> notify after a single sample. However, strace on perf(1) shows that it
> uses wakeup_events=0, and it's definitely not waking up on every
> sample (it seems to be waking up every few seconds.)
> tools/perf/design.txt says "Normally a notification is generated for
> every page filled". Is the documentation wrong, or am I
> misunderstanding something?

       wakeup_events, wakeup_watermark
              This  union sets how many samples (wakeup_events) or bytes (wakeup_watermark) happen before an overflow
              notification happens.  Which one is used is selected by the watermark bit flag.

              wakeup_events counts only PERF_RECORD_SAMPLE record types.  To receive overflow  notification  for  all
              PERF_RECORD types choose watermark and set wakeup_watermark to 1.

              Prior  to Linux 3.0, setting wakeup_events to 0 resulted in no overflow notifications; more recent ker?
              nels treat 0 the same as 1.

My reading of that is that in pre-3.0 kernels, you could choose to not get overflow
notifications, and now you'll get them whether or not you wanted them.

Under "overflow handling", we see:

       Overflows are generated only by sampling events (sample_period must have a nonzero value).

So the reason strace says perf is only waking up every few seconds is probably
because you either launched perf with options that only create trace events, or
it takes several seconds for an overflow to happen on a sampling event. A lot
of those fields are u64 counters, and won't overflow anytime soon.  Even the
u32 counters can take a few seconds to overflow....


Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ