From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.72 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796324437; b=Q6HWK6g9UHDk+K4WsXvB+Zcl+sWSAovIUFtE73skRVAtIe3QH9eICKitqAEIM77tuq1v qXBRoG5gcGkwFIwbB4/hTp2khpeTevIfYgRxcColr97bbeK9SOyF+AoPn15+v+Lc/2Fy3 1oUQVzqz7exhcixR9D2kx4ejXfPxJHolKG3+lWdvMdG+NuCTcgXf1OT16YZLtkCvcmMF7 008FDPEsy/X35fluhdw+TkR0GxYV/DT9qXnLeHtHedUN8FGO8WMinOmfGlGK1wkFaJPb9 fgSoy0UTWqiw4omuBtaMdOc3Bb3DGYnmZt6ZGNaOMipLfdyFFjBkgzAJ1w7dRF3jTPw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796324437; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=ucTQWaiUGxzddP5WHqB8NXrG7q8j2qsS+1OlaDUFy2w=; b=AErmriStHmr3afYSWFzlYOd8Nmllr5ODNDbcvQaKpQ/LXBtvzHi6MoOXATFZVeLw0LEu yydY8D+hibi6ORuig5/VnOHccK8HpA9reQ1u//Bmqy9PUQPAlnQMXqTL9ues0zyruRQWi STFKOlGHu0rfdJM5CtlqGVotsupllDsIR10QZpMfKxm1opEr+TJ9ASwyqsNgK0Fm3SwBq UjLEL0BLhJSdcj09xzpQ04sfKzOUp3C/qmc2LTJjsWNcV3QeqDvwZxGosXrgrtmowpzNg vWS7xSzBauVMuE2wafSTFfngZwAmUYzciX87q8aU3O1c1xS+0VTUGLjdyMbeaEo2leQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--vdonnefort.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=DQoA2WaA; arc=none smtp.remote-ip=209.85.221.72 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D8DC60A5BFE for ; Thu, 3 Dec 2026 19:00:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9D8DC60A5BFE Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--vdonnefort.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=DQoA2WaA Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-4c6ed3aad4cso103200f8f.1 for ; Thu, 03 Dec 2026 11:00:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796324435; x=1796929235; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ucTQWaiUGxzddP5WHqB8NXrG7q8j2qsS+1OlaDUFy2w=; b=DQoA2WaAyMKtRbip1RicqD7skqvem80BhvQ+2Wp43lXJQVpUmhOK+Hv5GjcdoV4i4y dL6oOpp12Nsmid9M+xtoNoYmpfEnnzRhXHInDU50z02N810EeaWdMxFUlZIT6hUTRGX1 brB2kSACwIWPyFWhPKJLuF0GEH3AJZBa1dq25Bx/TsmW8QsIyh/uJY9/w5zjELlwLh+O 670yMwn789yhuAGIqxUf11K4QyLWh2P9Josj4JxRiINn/AY/YExE8AoR9Ahgf1Jh66nn 59oCsUtnYMAz11TSc50UVcBBcdqtsMhJiNxUWimpYx2JnTcwDQRJb64xlpRoeEG4mAUw +Mqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796324435; x=1796929235; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ucTQWaiUGxzddP5WHqB8NXrG7q8j2qsS+1OlaDUFy2w=; b=bsevohRlGWjzFxvQe6w7/kJauljz0W2AJRq6E8yYDuH+XCyYhOiGaMU8INzKnquoCz w1YWrNRzeL3cb5b842tg61R54XsNTmPk7Ye+qGUD4QHeMCc9DlkrqmBHES3k6Ozv34rk Cul8iIti5aJPLpdoSMmM8tXVs7GbeSqdrkkf9F1et5k6qeYh8zUdBHYgL7Sl0p904xel tQunUsj0ZoNnXX+Ig71nqvIDEGserk12AeVQZlL2BIfrdRU7cJaDPkaByvjXJ+XiVLcr aayl3UG270heEdkmdocAU5+/rKIblr8RenCPkvzUwTZlLy5stC3fwxjyAvgTElx9MoV2 /pgg== X-Forwarded-Encrypted: i=1; AL+hErHNeU/RNdJqNw4bqDmgRHjoSryR64M3Wy62ZgS9c/M47PMSMyfCB0hQHLAfb1fE2nLM/ZasZhMiJc46eGV1cOOrOYY=@vger.kernel.org X-Gm-Message-State: APuU4Z+WN6JEX4qcx6bWo5fw9HO9WjYTpi7j49HM6Za/hLNUIJcgEl4G P2D1L+cHJb+s+S8B069utL9zZcSq74OcyYsoaDZPQE7enzERsR8kTXGoW7cfeaqITy3/u+M/O2u H1Q2ITNzhk6tngnsIscr28w== X-Received: from wrn5.prod.google.com ([2002:a05:6000:2b85:b0:4b8:7c3f:5b3]) (user=vdonnefort job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:4009:b0:4ab:7c3:101 with SMTP id ffacd0b85a97d-4abb514617emr88750808f8f.22.1796324434575; Thu, 03 Dec 2026 11:00:34 -0800 (PST) Date: Thu, 3 Dec 2026 19:00:06 +0000 In-Reply-To: <20261203190007.2431041-1-vdonnefort@google.com> X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261203190007.2431041-1-vdonnefort@google.com> X-Mailer: git-send-email 2.56.1.915.g69d5ec7298-goog Message-ID: <20261203190007.2431041-19-vdonnefort@google.com> Subject: [PATCH v10 18/19] Documentation: tracing/remotes: Add detailed tracefs layout From: Vincent Donnefort To: rostedt@goodmis.org, mhiramat@kernel.org, linux-trace-kernel@vger.kernel.org Cc: mathieu.desnoyers@efficios.com, kernel-team@android.com, linux-kernel@vger.kernel.org, Vincent Donnefort Content-Type: text/plain; charset="UTF-8" Add a description for each tracefs file available in a trace remote instance. Signed-off-by: Vincent Donnefort --- Documentation/trace/remotes.rst | 66 +++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/Documentation/trace/remotes.rst b/Documentation/trace/remotes.rst index 1f9d764f69aa..b02ebed4a03f 100644 --- a/Documentation/trace/remotes.rst +++ b/Documentation/trace/remotes.rst @@ -19,8 +19,8 @@ for which the host kernel can see and expose to user space. Register a remote ================= -A remote must provide a set of callbacks `struct trace_remote_callbacks` whom -description can be found below. Those callbacks allows Tracefs to enable and +A remote must provide a set of callbacks `struct trace_remote_callbacks` whose +description can be found below. Those callbacks allow Tracefs to enable and disable tracing and events, to load and unload a tracing buffer (a set of ring-buffers) and to swap a reader page with the head page, which enables consuming reading. @@ -28,8 +28,66 @@ consuming reading. .. kernel-doc:: include/linux/trace_remote.h Once registered, an instance will appear for this remote in the Tracefs -directory **remotes/**. Buffers can then be read using the usual Tracefs files -**trace_pipe** and **trace**. +directory **remotes/**. The files within this directory allow configuring +and reading the remote buffer (see `The File System` below). + +The File System +=============== +A remote tracing instance is represented by a directory in Tracefs under +**remotes/**. The layout and files within it are very similar to standard ftrace +instances. Inside the remote directory, the following files and directories are +available: + + tracing_on + This file allows enabling or disabling the remote tracing. + + buffer_size_kb + This file displays and allows changing the size of the per-CPU ring + buffers used by the remote. It also shows if the buffer is **loaded** or + **unloaded**. To change the size, the remote buffers must be unloaded + first. Remote buffers are automatically unloaded when **tracing_on** is + off, no one is reading the buffer (either by accessing **trace_pipe** or + when **dmesg** is on) and no events remain in the buffer. + + trace + Display the human-readable content of the remote buffers. Reading this + file is non-consuming. Writing to this file clears the ring buffers. + + trace_pipe + Similar to **trace** but reading it consumes the events from the ring + buffers (consuming read). It blocks if there are no new events. + + dmesg + When enabled, all events from the remote are redirected to the kernel + dmesg. This is similar to the **tp_printk** option for in-kernel events. + It counts as a reader of the remote buffers and prevents unloading. + + dump_on_panic + When enabled, the remote tracing buffer is dumped to the console when a + kernel panic occurs. + + poll_ms + Modifies the polling interval for the trace_remote. + + per_cpu/ + This directory contains subdirectories for each possible CPU (e.g., + **cpu0/**, **cpu1/** ...) + + per_cpu/cpuX/trace + This is similar to the **trace** file, but it will only display the data + specific for the CPU. If written to, it only clears the specific CPU + buffer. + + per_cpu/cpuX/trace_pipe + This is similar to the **trace_pipe** file, and is a consuming read, but + it will only display (and consume) the data specific to the CPU. + + events/ + This directory contains remote events that can be enabled or disabled. + + events/enable + Allows enabling or disabling all the remote events. + Declare a remote event ====================== -- 2.56.1.915.g69d5ec7298-goog