Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp658257rdb; Tue, 23 Jan 2024 10:32:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGGIgxHtfwcvzkcxERORQ2gf1D/PkPxXz0+wxLGVZckoBSKWJrrCSjGDUp/w10UJc9wiM+ X-Received: by 2002:a17:902:ed45:b0:1d5:eeba:814e with SMTP id y5-20020a170902ed4500b001d5eeba814emr3787322plb.18.1706034779156; Tue, 23 Jan 2024 10:32:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706034779; cv=pass; d=google.com; s=arc-20160816; b=q9/0nDTKVy7AJEET9fvQSTVBHgyiya6ozTIPSMemvdvjBFzuhybL9oMq8z2xAF6mUo FtjiiUvsiB+axWRPk/XflguU+0JiMmxDMAY2HfcPSYYqB1/+7hV+rQn5YUUbN2TGTwGv pl/cje9qyCeN4Dz67m0//OxsGi1eC7r+UJlAsvLpubpNf5nzTm1+jxKmFQ4RuqBoH5H4 Yh+oGFYriYxD/DbZvd7IO3gQkM4yXor3WVQqGCQ6EVB7by3ostDQhpAwLzD6vmfrlgVc SHgi9uC5MfVUj173InzTS2/4zmGGI+7L9eDX3ZstURwHRN0U2chyoRg6EZApKb1VV5td +wGQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=sfCZmvhLfCIpwvDFUHrgaTtTmPZW7f2aa1eN529pJa8=; fh=AdbslQO0k+AnvEfX3vMM2zR0Ci/sn0BMuAHQ8jbhQKE=; b=wXWc0GuyrjYIQJP8315DhnR2ayZZbrV/L7tZEmIWcSI4SeG8lWq0CC5Tyyt92sATgF nMATvAGKCsxqLpcMVc5XnU6Ka9CBovPzicec4wPSGxE2KOJTysnWjmiBOjgGEza2vQe5 x/E+XodEChTyYc2exrVgW2vffI3BZ/RDeByt0MSuOR5QjYEIr471WxICDlaFTbJbgvg6 pNnWlgE2SohM8eaQ0JpMHMU03l5ErM4/+BAaORsH1zrFMENp5RiDUl9uaJLkvjMQZ0R+ lbgsLRBH6rDb5fO7DqVZMBKqjRoccVYxiHVNaGWG1Ahc0QEIzXEajJe7yL+z1peuExBv 8Phw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-35835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35835-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u7-20020a17090341c700b001d75d88f9a0si2983081ple.466.2024.01.23.10.32.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 10:32:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-35835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35835-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5CFC1B2A2DD for ; Tue, 23 Jan 2024 18:01:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2BE9481AAE; Tue, 23 Jan 2024 18:00:56 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A36018005D; Tue, 23 Jan 2024 18:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706032855; cv=none; b=XVabeeYRodqiLdfrESFb6IRdFDuSt/nM7q+b8XMAuNEWpMWWNuq0hQho1aiajXoogENBtDV+ve1jEgTuqYUdF0CY/Sj9ZJ4OS8jXUJ21ot+opbaY8/TXxaPj1NBa86h+IW7f8UNZHyqv+DoB5MzXTHTPOIWDmuum/EF2TOngS1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706032855; c=relaxed/simple; bh=RvfSqt5SOt8vR1G28kL6h9RHI/bw2faiLEQHnH+r4WE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=O4p36S4bH6VsftteTXa95yHJt+IL4C1Mx/CdVzVNg/ywXMKwDsOJfrQgDfM8qPt8ew/9OF1xYl53AgIESLCmsfgHCmFsohkRaWE2JoLAlFkeDVe5fUbW76sspd93pJNdh7m4i9fooOEPGazijI6fk7ztctkTUJMFbgiyC3llT9g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55F92C433C7; Tue, 23 Jan 2024 18:00:54 +0000 (UTC) Date: Tue, 23 Jan 2024 13:02:25 -0500 From: Steven Rostedt To: Vincent Donnefort Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, kernel-team@android.com Subject: Re: [PATCH v12 2/6] ring-buffer: Introducing ring-buffer mapping functions Message-ID: <20240123130225.23d5da07@gandalf.local.home> In-Reply-To: References: <20240123110757.3657908-1-vdonnefort@google.com> <20240123110757.3657908-3-vdonnefort@google.com> <20240123105149.36abf019@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 23 Jan 2024 17:48:17 +0000 Vincent Donnefort wrote: > > > + * @subbufs_touched: Number of subbufs that have been filled. > > > + * @subbufs_lost: Number of subbufs lost to overrun. > > > + * @subbufs_read: Number of subbufs that have been read. > > > > Do we actually need the above 3 fields? > > > > What's the use case for them? I don't want to expose internals in the API > > unless they are needed. > > subbufs_read is gone, I just forgot to remove it here :-\. > > The two other ones are used for tracing with the hypervisor. That's why I > preemptively added them. > > I can remove them and add just append this struct later ... or just overload > this struct with another one, only shared between the kernel and the hypervisor? Yes, let's have them be different for now. Or we could just make them "reserved" and say that they are not used for now. I also think we should add a flags value too, so that when they are no longer reserved, a flag can be set to say that they are active. struct trace_buffer_meta { __u32 meta_page_size; __u32 meta_struct_len; __u32 subbuf_size; __u32 nr_subbufs; struct { __u64 lost_events; __u32 id; __u32 read; } reader; __u64 flags; __u64 entries; __u64 overrun; __u64 read; __u64 Reserved1; __u64 Reserved2; }; And that way the hypervisor would still have those available, and updated, but they are not filled for user space. The hypervisor could even set the flag field saying it's using them. That is, the first flag is: enum { TRACE_BUFFER_META_FL_SUBUF_INFO = (1 << 0), }; And if that's set, those fields are available. But we just don't set them now ;-) -- Steve