Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp318818rdd; Tue, 9 Jan 2024 05:20:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqq4LwIxlsgPkJCkpk1Q6AL41UliIGB9kLhZloixAVvcYAmoyqm0EQLJXcjpLLMA0sYlX6 X-Received: by 2002:a05:6a20:7d8c:b0:199:98df:d5a0 with SMTP id v12-20020a056a207d8c00b0019998dfd5a0mr4928927pzj.40.1704806409781; Tue, 09 Jan 2024 05:20:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704806409; cv=none; d=google.com; s=arc-20160816; b=PA9zfXMwYUycyCy/TggwXSxxdmd3bLuedT2v0BAcG7hpP8dIrM8pPbN6AjQItYCkrz 9VoqXM1+C5NXoDzl6MRa8BGczCUfTwjqQhsSBc15f1aNpZGeBjJ+kA0OBvPujRYWZ9WY nFUw4a2JFLhBUeg+5DceCaqieWzS5DVSbdF5q+juJSoNEyqFeHlGGkJDD0wkhOZ0cxqS BUSv+kb2HTk4oOq+hwPS89o4TZrVLl2eMXVcyk6JW2p9SCzEpXEylZ7HU4ruxmFpY/nb goMvL4HgPTsDEfI/wbmv8hKEorXL5RjmS/DBkRUQJxE+sQ3NQlA9djPZF6rjZvARJTc+ CxjQ== ARC-Message-Signature: i=1; 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=4W2eZR3fiMr0ay6DUwHCigKyAW0CoHHvuKTqxy8imsw=; fh=RgzLGBoasBFBaYzygqDfqjTbi/jF4k8V6Y1cJQMO4QE=; b=KPDWa9oWHhc5/ZSGLXPf/BNVwTJbtYzsoau+6APrybIs7fZkgbV/4pbKH5zP+6D7mI otDIVVVT3/q8bzdiU4/DWl22QlSJeeI43ISgx/L0W/X3sFEWsca01Dq4C0gzcG/E3KAF wzP/WtYKRV1MnBAkZMKTBXVa+7Ua3Nyycm10ik8s8WGWyKg8fempbGURKTvh1j2aJ205 FJTGgB+MwQyO8R5IBjD4ZK3ROpJWc1WIlhEUtM/wRTAwgCiq7F7VjDV/PiSeeWTkHMvK F23adGF1cG6L/TCFFV2KXtXuwny8udYBGQxCx/cxLrfCnFIhQDOTAIJLUUWdURzW/8Bn sAtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20887-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s68-20020a625e47000000b00690f9e835d8si1442381pfb.132.2024.01.09.05.20.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 05:20:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20887-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DB37F286565 for ; Tue, 9 Jan 2024 13:20:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B2E138F95; Tue, 9 Jan 2024 13:20:01 +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 B0A9926AF7; Tue, 9 Jan 2024 13:20:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8408FC433F1; Tue, 9 Jan 2024 13:19:59 +0000 (UTC) Date: Tue, 9 Jan 2024 08:20:57 -0500 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: Vincent Donnefort , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, kernel-team@android.com Subject: Re: [PATCH v10 0/2] Introducing trace buffer mapping by user-space Message-ID: <20240109082057.2bb6da70@gandalf.local.home> In-Reply-To: <20240109220445.5683e4af0cea6b034945b2bb@kernel.org> References: <20240105094729.2363579-1-vdonnefort@google.com> <20240109220445.5683e4af0cea6b034945b2bb@kernel.org> 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 Hi Masami, thanks for looking at this. On Tue, 9 Jan 2024 22:04:45 +0900 Masami Hiramatsu (Google) wrote: > > The tracing ring-buffers can be stored on disk or sent to network > > without any copy via splice. However the later doesn't allow real time > > processing of the traces. A solution is to give userspace direct access > > to the ring-buffer pages via a mapping. An application can now become a > > consumer of the ring-buffer, in a similar fashion to what trace_pipe > > offers. > > I think this is very nice feature. But this series seems just a feature, > no document and no example code. Can you add 2 patches to add those? > I know libtracefs already provide a support code, but I think it is > better to have a test code under tools/testing/selftests/ring_buffer. Yeah, we should have sample code and a test. > > I also wonder what happen if other operation (e.g. taking snapshot) happens > while mmaping the ring buffer. Hmm, good point. We should disable snapshots when mapped, and also prevent mapping with latency tracer if we are not already doing that. -- Steve