From nobody Sun Feb 8 07:25:20 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41387C7EE23 for ; Mon, 5 Jun 2023 23:39:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232196AbjFEXjV (ORCPT ); Mon, 5 Jun 2023 19:39:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233465AbjFEXjI (ORCPT ); Mon, 5 Jun 2023 19:39:08 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5861AEC; Mon, 5 Jun 2023 16:39:07 -0700 (PDT) Received: from W11-BEAU-MD.localdomain (unknown [76.135.27.212]) by linux.microsoft.com (Postfix) with ESMTPSA id B7E1520BE169; Mon, 5 Jun 2023 16:39:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B7E1520BE169 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1686008346; bh=qnYype7JSfB3XhEdWuDY5z5z2M5sVSUXVc5FgH32LG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=asQxKbkkYvi6HydgOHl5hyqwliXm+PEvNYs4t6Zb8l6ekyyaVcMQA/M88jj5sGp4r d5yLQstjlC3+JfLxoevYS7mpUjHMe6G4s/SP1ovksq9UVIBuYUYHHKT+Q9C01+CfhG sUB6Rko4IyXpghGhd3lrii3dpt7Bakv+bUjgK2C8= From: Beau Belgrave To: rostedt@goodmis.org, mhiramat@kernel.org Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, ast@kernel.org, dcook@linux.microsoft.com Subject: [PATCH v2 5/5] tracing/user_events: Add persist flag documentation Date: Mon, 5 Jun 2023 16:39:00 -0700 Message-Id: <20230605233900.2838-6-beaub@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230605233900.2838-1-beaub@linux.microsoft.com> References: <20230605233900.2838-1-beaub@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" There is now a flag for user_events to use when registering events to have events continue to exist upon the last reference put. Add the new flag, USER_EVENT_REG_PERSIST, to user_events documentation files to let people know when to use it. Signed-off-by: Beau Belgrave --- Documentation/trace/user_events.rst | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Documentation/trace/user_events.rst b/Documentation/trace/user= _events.rst index f79987e16cf4..6736e5a32293 100644 --- a/Documentation/trace/user_events.rst +++ b/Documentation/trace/user_events.rst @@ -39,6 +39,14 @@ DIAG_IOCSREG. =20 This command takes a packed struct user_reg as an argument:: =20 + enum user_reg_flag { + /* Event will not delete upon last reference closing */ + USER_EVENT_REG_PERSIST =3D 1U << 0, + + /* This value or above is currently non-ABI */ + USER_EVENT_REG_MAX =3D 1U << 1, + }; + struct user_reg { /* Input: Size of the user_reg structure being used */ __u32 size; @@ -49,7 +57,7 @@ This command takes a packed struct user_reg as an argumen= t:: /* Input: Enable size in bytes at address */ __u8 enable_size; =20 - /* Input: Flags for future use, set to 0 */ + /* Input: Flags can be any of the above user_reg_flag values */ __u16 flags; =20 /* Input: Address to update when enabled */ @@ -73,10 +81,13 @@ The struct user_reg requires all the above inputs to be= set appropriately. This must be 4 (32-bit) or 8 (64-bit). 64-bit values are only allowed to= be used on 64-bit kernels, however, 32-bit can be used on all kernels. =20 -+ flags: The flags to use, if any. For the initial version this must be 0. - Callers should first attempt to use flags and retry without flags to ens= ure - support for lower versions of the kernel. If a flag is not supported -EI= NVAL - is returned. ++ flags: The flags to use, if any. Callers should first attempt to use fla= gs + and retry without flags to ensure support for lower versions of the kern= el. + If a flag is not supported -EINVAL is returned. + + **USER_EVENT_REG_PERSIST** + When the last reference is closed for the event, the event will co= ntinue + to exist until a delete IOCTL is issued by a user. =20 + enable_addr: The address of the value to use to reflect event status. Th= is must be naturally aligned and write accessible within the user program. --=20 2.25.1