From patchwork Thu Jun 15 13:05:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 108537 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp652382vqr; Thu, 15 Jun 2023 06:56:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7BT5NfcduOiRTBWgaAJHkZYvq0IteZunxVwuVNI5fk96ikJmPwTmo9ANhn8LBp9yuU3sQW X-Received: by 2002:a05:6a00:16d1:b0:638:edbc:74ca with SMTP id l17-20020a056a0016d100b00638edbc74camr5692988pfc.0.1686837361413; Thu, 15 Jun 2023 06:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686837361; cv=none; d=google.com; s=arc-20160816; b=Itc2qaucBpKzAAl+Ks1EEhVxhmpI2ePzfhQuNJgLllG7q6QpelqObGiz0ABNyK6XzR CGnVve2pRl0KOwACQHrbGgLjIgE3ZFybdaA4XcoHdSmwpjolfQ6qkFOitjIpXYEfwV7f 960hEhLQVKXiqTNBMSDm923O3aljOM9+jG9GSN1R4h2FW//+tMZMp4RUT6tvokxU3kef uNj5UUJk5OGlYXIlWfePhJjMjrC0OD7VFe5SfP54VDfzMMIJvDq2lyQwVdKI6J6VYTXl /jqYBQyhi6DftQVjO30X52pQPJbKHwDbGCgBEvoa4t1wOg9P5qOudMFMY46+rumJOf0X lLYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=fokOP9X+AKiilzyHiw4wv0ZL37U73aNwqMJC59Yzzpc=; b=nIf5VL7bv4p0fpdd7VR1fIEFXI59ZNGB3ZDc72D8aIhUGu+VQqnIsLlrZ9hAB1Ru8T GBq6tsoUw8h4SL9a2P2HLwBH/aHNWEFBf418aYDQ3t6+prqSxpl3gtggZCBcV/i8kq1j 1Bv1bnssgzJNsNnl9sCAUOoAwphoYWsclsXyxJe9Ki0jIfD7401y65AMHHqbcGU2cjU7 Kbl+Z5ljLOa9zucNI9J58NuakhKjCgyWk3rf2bnPDWKmpfwQ/sq9dw/ftPYwZsaEhKhx iAfWb3UJ/AAmF/0i14k5t59K6Ierq7EZ8mpo5g/2n1S7HQVLNkiqmk4DpZwK62cSOtLs oFXQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k26-20020aa79d1a000000b006650ccb39e9si9142252pfp.294.2023.06.15.06.55.49; Thu, 15 Jun 2023 06:56:01 -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 S1344428AbjFONge (ORCPT + 99 others); Thu, 15 Jun 2023 09:36:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344169AbjFONfb (ORCPT ); Thu, 15 Jun 2023 09:35:31 -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 9F9C22D4C for ; Thu, 15 Jun 2023 06:35:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E751263BBE for ; Thu, 15 Jun 2023 13:34:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C481CC433CD; Thu, 15 Jun 2023 13:34:18 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1q9n7B-000TtA-2s; Thu, 15 Jun 2023 09:34:17 -0400 Message-ID: <20230615133417.709819338@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 15 Jun 2023 09:05:46 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Beau Belgrave Subject: [for-linus][PATCH 15/15] tracing/user_events: Document auto-cleanup and remove dyn_event refs References: <20230615130531.200384328@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768777173177185276?= X-GMAIL-MSGID: =?utf-8?q?1768777173177185276?= From: Beau Belgrave Now user_events auto-cleanup upon the last reference by default. This makes it not possible to use the dynamics event file via tracefs. Document that auto-cleanup is enabled by default and remove the refernce to /sys/kernel/tracing/dynamic_events file to make this clear. Link: https://lkml.kernel.org/r/20230614163336.5797-7-beaub@linux.microsoft.com Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) --- Documentation/trace/user_events.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Documentation/trace/user_events.rst b/Documentation/trace/user_events.rst index f79987e16cf4..e7b07313550a 100644 --- a/Documentation/trace/user_events.rst +++ b/Documentation/trace/user_events.rst @@ -14,10 +14,6 @@ Programs can view status of the events via /sys/kernel/tracing/user_events_status and can both register and write data out via /sys/kernel/tracing/user_events_data. -Programs can also use /sys/kernel/tracing/dynamic_events to register and -delete user based events via the u: prefix. The format of the command to -dynamic_events is the same as the ioctl with the u: prefix applied. - Typically programs will register a set of events that they wish to expose to tools that can read trace_events (such as ftrace and perf). The registration process tells the kernel which address and bit to reflect if any tool has @@ -144,6 +140,9 @@ its name. Delete will only succeed if there are no references left to the event (in both user and kernel space). User programs should use a separate file to request deletes than the one used for registration due to this. +**NOTE:** By default events will auto-delete when there are no references left +to the event. Flags in the future may change this logic. + Unregistering ------------- If after registering an event it is no longer wanted to be updated then it can