From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0F00C43331 for ; Sat, 7 Sep 2019 13:41:13 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AAE9B206CD for ; Sat, 7 Sep 2019 13:41:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAE9B206CD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.1) (envelope-from ) id 1i6axH-0004Uq-Pt; Sat, 07 Sep 2019 09:40:43 -0400 Received: from omr2.cc.ipv6.vt.edu ([2607:b400:92:8400:0:33:fb76:806e] helo=omr2.cc.vt.edu) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.1) (envelope-from ) id 1i6axE-0004Uk-4o for kernelnewbies@kernelnewbies.org; Sat, 07 Sep 2019 09:40:40 -0400 Received: from mr2.cc.vt.edu (mail.ipv6.vt.edu [IPv6:2607:b400:92:9:0:9d:8fcb:4116]) by omr2.cc.vt.edu (8.14.4/8.14.4) with ESMTP id x87Deb5w005222 for ; Sat, 7 Sep 2019 09:40:38 -0400 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mr2.cc.vt.edu (8.14.7/8.14.7) with ESMTP id x87DeWf7008435 for ; Sat, 7 Sep 2019 09:40:37 -0400 Received: by mail-qk1-f199.google.com with SMTP id c7so4625523qkc.2 for ; Sat, 07 Sep 2019 06:40:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=yFUeLoQShDR+4twQHthnh9JSioQjP2ZsNxvdKLKbDu8=; b=WzBc7JV1fhnutr2AUFNmKgFou2ti0Rg1iJPdyVVKdQEDeEV1DWcdrfSdH7Ij+lD2aX pLvvHhJ5rPGA+V9LaatVKeWYt+UJuv26j+OBS1D3CwDs4QurFoYDP7V74gHFJocK9VVb +qGLFQLYP8Iix6ytPZybm6PJfZFizhRyo8tThJeh2x67pGedlzTQOxIRF2FYJuQL9atx OwJy6EqhxKMTvKeyKoi3e24ojCfbQKgNCduraVnuZsu3L3NpvaxegDJR+pdH7OS8cfGe ZoCFKEEtymDCqxVMcVN2IUBJqaN45CPJHHlA+F8gVrt2NAcYSwO45a+yrIGG1LfOp8vp EMlA== X-Gm-Message-State: APjAAAUwqf+6nxJTY08TxDC8weQNYSdtu66o1HrWjS5FLHnYbSGIEz2v rOvbnQnipr6h4pcJhbzDV774E6h6dmDFPTXBCEJfhgaIOhImwsHSSLVE5WNWHMNFMAmH2i1rWcJ TQ1fAbt6dLBdo2XKcQFUPAPY5QhhWY1fDU1lplko= X-Received: by 2002:ae9:f506:: with SMTP id o6mr14816381qkg.368.1567863632591; Sat, 07 Sep 2019 06:40:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2CAlmxIqQbfDmtk2u4wRTGn+ncmmjIfcHnO2DRVxMBlEeunNWGN9SB/a0CGOohtJAPPo/RA== X-Received: by 2002:ae9:f506:: with SMTP id o6mr14816364qkg.368.1567863632317; Sat, 07 Sep 2019 06:40:32 -0700 (PDT) Received: from turing-police ([2601:5c0:c001:4341::359]) by smtp.gmail.com with ESMTPSA id a4sm5812696qtb.17.2019.09.07.06.40.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2019 06:40:30 -0700 (PDT) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: Theodore Dubois Subject: Re: perf_event wakeup_events = 0 In-Reply-To: References: Mime-Version: 1.0 Date: Sat, 07 Sep 2019 09:40:29 -0400 Message-ID: <943813.1567863629@turing-police> Cc: kernelnewbies@kernelnewbies.org, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============7120600169753726991==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============7120600169753726991== Content-Type: multipart/signed; boundary="==_Exmh_1567863629_4251P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1567863629_4251P Content-Type: text/plain; charset=us-ascii 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.... --==_Exmh_1567863629_4251P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQIVAwUBXXOzTAdmEQWDXROgAQI0ORAAhzyWz2/envWdQp6CiUDuijiIHo2vesWE A1eU14T5lwVnxGQ0Z+R2/syFlPjBvx3TgRzRh24/JOcA07FnKNrWjRfEsuGeq+1Y E8oSniutgEyPEKsEBLTOKTIqa9rWX/6ci7tWrujAgQ3FUW+zfKTX3F1P0tp+FAed i2Mjo39nmSjG8TfmB5E3rlm08tnHlG3VlbWdMkdF3SiHyb47cMrMJNjpomrKi0PK oBbqwgCRukjvcylQhvEgGHswJw8syoBc4wsgkV6USUl3BI8bzFFtHFeWpWK4uMuh eU9VU2zBLWDtf6c8KwGzhFhQAPlvvgclNAH0aGdYPLEsTuFC1VsKz0rpVA/uDU/s a/Oz6yQbeOtciH85emN890MmByEkMgonmgczRA/MtuZXLFS+mDhmN9DubGqbTYaw BW7Vaz9Dmz6AXSblPdhG2CZQT106ZBWE9UXRWH20TFgbAew5U6g9X6OGzTPwM/Z1 mzefZ7HNWUK+XpXaD+voHSdRKZfnQh8pL/2m+gTW42BRudzajS0nKMAjull1huB+ Mf+RX3uH3wbuLNuG10oJeflT9X12YQyeZgpmC9a5FkehcE5hvgOa1J0s5M2MrXAt 5Xa/qIyDJ79GAd+oSAG8ENR3CbHclwVemsAfzcRSUa/yscsM6QIEKSYGiMa28n+E GkRivLsNxdg= =ZDUo -----END PGP SIGNATURE----- --==_Exmh_1567863629_4251P-- --===============7120600169753726991== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============7120600169753726991==--