Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp645536rwl; Wed, 29 Mar 2023 06:49:47 -0700 (PDT) X-Google-Smtp-Source: AKy350bvgDcL3Y+Ubw9Zs3KWxSzNl0DbPJncUaTKnQwneVCfOcbdh5EowtbIkXqREUxYnDk2W6q1 X-Received: by 2002:a05:6a20:465d:b0:de:af2f:fdeb with SMTP id eb29-20020a056a20465d00b000deaf2ffdebmr12993096pzb.3.1680097787626; Wed, 29 Mar 2023 06:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680097787; cv=none; d=google.com; s=arc-20160816; b=a8d/uxCYiohkXBJLXUgjC7JlHJEsNSJRZZRXdbZ13kWUheT/zmYEQSRJvSTTVN9nhx mpEBiPRQldHrvaJV3bkqtkp3Qq1cxdLRUZk2vx0/Y/jcdO6UJth9L4mwMaifobPTo1E6 BkDZKFfEvnb/8NyMJ444nYeIyPobVn8qQpNvEiJRoqIk76+jAn+k3Cc95IvReeQuYcqS jPeNmzHn5EnpFc4AbgY4OCRkFu/+npkYm/NpzeANGCf0imbpPG14/Fyt+fAq+Guq62FO 7YQ1Qy5fU5IlB/qDm8uULpRTUOTGSE/XF3MLoB1iVFn+wZqAkjbzNnI9MNZ8Fsz9MF5n V4Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Lr0t+fan+quyPw/H+785OvKm5MuXobsbaEghlf/9/Q0=; b=iwS8oAwOaUW8aJRE8+4WeUsuVziIY6jg/RtYX7iG8UVUuNla/DkoGOId9A9rAXWn9v /e2FMB6agPHr2O/7YWfzMWgVdTEtEGdxvRmh7KuDE1lsu8FJrefLIsjEnRhXtQYeMOUF Yq2N/dsv8RsxW2MuENjFtpOw4wyC9U4C27fDPy11H5SWF/x1LP5bt6TrjuW0KdRm11tg eBTG/yZkVLE38e1d/PUsymy7xiklALzzsuvTd4saVE2QV5yMTDrIFEikBf07JTeXTxDM koHKX3xXBcK2kckL2ltRUIc7Nx1b3KyAL8yvSHCEAHqY6EgIB5B98KZmtQ7dKC7jDLlX yhbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a056a001a4900b00625ff8521e7si31307384pfv.242.2023.03.29.06.49.36; Wed, 29 Mar 2023 06:49:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230383AbjC2NhF (ORCPT + 99 others); Wed, 29 Mar 2023 09:37:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230365AbjC2NhD (ORCPT ); Wed, 29 Mar 2023 09:37:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47D664EF5; Wed, 29 Mar 2023 06:36:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E85ABB819BA; Wed, 29 Mar 2023 13:36:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BC3DC433D2; Wed, 29 Mar 2023 13:36:53 +0000 (UTC) Date: Wed, 29 Mar 2023 09:36:46 -0400 From: Steven Rostedt To: Vincent Donnefort Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v2 1/2] ring-buffer: Introducing ring-buffer mapping functions Message-ID: <20230329093602.2b3243f0@rorschach.local.home> In-Reply-To: References: <20230322102244.3239740-1-vdonnefort@google.com> <20230322102244.3239740-2-vdonnefort@google.com> <20230328224411.0d69e272@gandalf.local.home> <20230329070353.1e1b443b@gandalf.local.home> <20230329085106.046a8991@rorschach.local.home> <20230329091107.408d63a8@rorschach.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Mar 2023 14:31:07 +0100 Vincent Donnefort wrote: > We can say we update cpu_buffer->reader_page->read on the get_reader_page ioctl, > to the most recent value possible, which will have the consequence of actually > "flushing" those events? Yes. It should be no different than doing a normal read of the trace_pipe_raw file, which does the same. > > If the reader decides to read events past this value then it just can't expect > them to not be duplicated? > > I suppose it'd be down the reader to store meta->read somehwere? > > prev_read = meta->read > ioctl(fd, TRACE_MMAP_IOCTL_GET_READER_PAGE) > /* read events from prev_read to meta->read */ Yes, in fact it shouldn't need to call the ioctl until after it read it. Maybe, we should have the ioctl take a parameter of how much was read? To prevent races? That is, it should pass in the page->commit that it used to to read the pages. -- Steve