Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp568876rwl; Wed, 29 Mar 2023 05:58:03 -0700 (PDT) X-Google-Smtp-Source: AKy350ZM7CfeQNAED+zaUWZUJbLB7kIPjlZE8k2nYPFpn6b9wXngd7QbozPaH+1AIsLg9AyPyCbL X-Received: by 2002:a17:903:886:b0:1a1:bcaa:aaea with SMTP id kt6-20020a170903088600b001a1bcaaaaeamr17821606plb.3.1680094683224; Wed, 29 Mar 2023 05:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680094683; cv=none; d=google.com; s=arc-20160816; b=r6qi6c8o6+vKdFE6J5kF2wxObFB4ZwB6itz7OyXRB5MUjxaGaDt7EAj4ED2gbdASLd qWhmbAdtphgbt3sUX85/rZbomtSAVe3YKua5SeJVqJY2hH3nrBnzEAaA849mSb+bQCVE n3+dgFzeMPgjuMGlFPW9iTtHwPGDIJAABfkFI1oY2yLmWYW1E+wqbDJOjQjZuvKFtvr+ Mx3iWczawWS8bYHYFS7A7evs6tAl1p3SSn0+HhHNVp/pR+oEiOBoDsIczP7oW2jT59no EIf3znfIIpngGtq1nIvI2o2tACFpNO9dQduMUY/PhBzUjfmv+wR87A4eu0mzTTftObOg 2Vzw== 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=V5+2IQbT1ZLjvfDRgTrr34+SPUO9advmwhrVMdZCMqk=; b=lM/f+gG2Y0U8TFVEfXjT8GRSa76XgIk0qBeHqwlhmF6baeg9naLAu0V9Y4HbyEYUxS ZvnoLCY3GoViq7d3GlVtOeWbyNb7gpE64S+30m7SpVPsjykEtd6cktoSeqG9KAim0eIU 86kb5FIKU6bgJiWw0k6k9fT/GoC2A/OMGBNdvahjKQwiRVZYdHnNuSgNGK6bhw3DKOGQ igEfcq3gDmY2uc+cOLyVo2HbQCCEHXIsLEHHMlWTLICAjxLPMwVz8CcLsiy1/17+hv94 w0FFZhM/fwj5bswH4f9QjaGPdZr17cRvFNkNLhh6hiLCPJM3XMJaAzC5DTuNeQEqaGgb izYA== 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 jz7-20020a170903430700b001a24c038c76si6382197plb.512.2023.03.29.05.57.52; Wed, 29 Mar 2023 05:58:03 -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 S229817AbjC2MvT (ORCPT + 99 others); Wed, 29 Mar 2023 08:51:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbjC2MvQ (ORCPT ); Wed, 29 Mar 2023 08:51:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AE511707; Wed, 29 Mar 2023 05:51:16 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 2D8EF61CDE; Wed, 29 Mar 2023 12:51:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAFC5C433D2; Wed, 29 Mar 2023 12:51:13 +0000 (UTC) Date: Wed, 29 Mar 2023 08:51:06 -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: <20230329085106.046a8991@rorschach.local.home> In-Reply-To: <20230329070353.1e1b443b@gandalf.local.home> References: <20230322102244.3239740-1-vdonnefort@google.com> <20230322102244.3239740-2-vdonnefort@google.com> <20230328224411.0d69e272@gandalf.local.home> <20230329070353.1e1b443b@gandalf.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 07:03:53 -0400 Steven Rostedt wrote: > struct ring_buffer_meta_page_header { > #if __BITS_PER_LONG == 64 > __u64 entries; > __u64 overrun; > #else > __u32 entries; > __u32 overrun; > #endif > __u32 pages_touched; > __u32 meta_page_size; > __u32 reader_page; /* page ID for the reader page */ > __u32 nr_data_pages; /* doesn't take into account the reader_page */ > }; Oh, I guess we should also expose the amount read on the reader page, that gets updated on the ioctl. That is, if the first time we read the reader page and the page is not full and unmap the pages, and then new events were added to the reader page, we should not re-read the events that were read previously. That is, expose cpu_buffer->reader_page->read -- Steve