From patchwork Thu Sep 14 16:35:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 13999 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp479673vqi; Thu, 14 Sep 2023 09:42:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5LmUeWMHdqOBUY6cE89kw3WLrk2bWfSRBR+1ycEgFHf9glZoonxoqtaQ1tH+2iJvi45KC X-Received: by 2002:a05:6a20:f391:b0:10c:7c72:bdf9 with SMTP id qr17-20020a056a20f39100b0010c7c72bdf9mr5767537pzb.29.1694709754930; Thu, 14 Sep 2023 09:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694709754; cv=none; d=google.com; s=arc-20160816; b=TbLJRyy6deKjeCaIDC/el4MTss2cdZJJqNkqcJ1VwqbXWQ5pUbnixPkXyFyQrlhvNf ql5lrBLVCKhuahrgo8/nmw9PdlwHu9S7wPbFvTJm/wdYS6BCwLkfC+2fKWrJ9gQhrIPf eyi110ZK1qYVOZxAJL64it3BU328xKZW0qsPRcnRH2bDOPTv/ujMWPzZ+k+IwtK/7DSf xaQNbwMf5oNTjkzlDmAHk+73kzk8ooVO7KmO6gfTIc2pYxrSRTOdI8iCR92Et/6uVI/w Q3YFpZOo12UWRT+LZSxo/oUrWi97/Wmg1Ty2dZIrcFUwA9JpQOJyDQAxbHycUZIXx4na 7Qkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:user-agent:message-id; bh=f5eVNsGP9xvwSYwMcXL+rpEnDbb/h20Na6fjjoGGXpE=; fh=rjFf2Qs0A83L06RBhuRXHLiK/k7VWIWgHuoJoNWJMnQ=; b=0nTYQA+epfEVySiIkpoL1ppUi+Pv/wtX/LMFSAlg9+9iTOKYc6qNkFXPPkmEtg2lSv IRTBK2q25lhSCHOa2+xzFvYe7vsFvRMwgpa3mLDJ9LOs0EYxAi4Wz1f003A7zESJMb0c EZm3crR+DlKCGQguqGzfakwSUd0qyJQGb8/uXIFlMPte9fnkh1cKOUG7ocFnXTlrVPT2 /CiMHnFhJIy/dXUeDqDlfIkgw+0mZh61guqmw/FBWNxP4GlY178mM06CKBxTa+UZKEv5 luB0/qas/EUqMw+sp6vLN48OuJ8Z0d/tCDA+OwSy1b56usl6WGaYQNrireozcRZrTS0j Dxdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id fa25-20020a056a002d1900b0068e2cf2161fsi1893290pfb.155.2023.09.14.09.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 09:42:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 52D7980C5A25; Thu, 14 Sep 2023 09:35:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238303AbjINQfS (ORCPT + 33 others); Thu, 14 Sep 2023 12:35:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230023AbjINQfR (ORCPT ); Thu, 14 Sep 2023 12:35:17 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FAFE1FD7; Thu, 14 Sep 2023 09:35:13 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2578C433C7; Thu, 14 Sep 2023 16:35:12 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qgpJX-000tV7-0l; Thu, 14 Sep 2023 12:35:35 -0400 Message-ID: <20230914163504.884804272@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 14 Sep 2023 12:35:04 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Ajay Kaher , chinglinyu@google.com, lkp@intel.com, namit@vmware.com, oe-lkp@lists.linux.dev, amakhalov@vmware.com, er.ajay.kaher@gmail.com, srivatsa@csail.mit.edu, tkundu@vmware.com, vsirnapalli@vmware.com Subject: [PATCH 0/2 v3] tracing: Remove eventfs_files by use of callbacks Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 14 Sep 2023 09:35:24 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777031976040680648 X-GMAIL-MSGID: 1777031976040680648 This is a bit of a redesign of the way the eventfs is created. It no longer creates a descriptor representing every file but instead just the directories. These descriptors get an array of entries that represent the files within it (but not for sub directories). Each entry has a name and a callback, where the name is the name of the file (used for lookup) and a callback that is used to create the dentry and inode for the file. This saves more memory, this approach may be possible to create a dynamic way of doing this for other pseudo file systems. The second patch fixes the kprobe selftests yet again, and the function that it uses to attach to was renamed once again. Changes since v2: https://lore.kernel.org/all/20230913025855.615399273@goodmis.org/ - Removed the show_eventfs_dentries patch and queued that for mainline. - Rebased on top of the queued mainline tree, as the show_eventfs_dentries patch was modified. - Updated the numbers in the change log to reflect the latest code. (Things actually got better!) Changes since v1: https://lore.kernel.org/all/20230801001349.520930329@goodmis.org/ - Rebased on mainline and some minor clean ups. - Fixed kprobe selftest Steven Rostedt (Google) (2): eventfs: Remove eventfs_file and just use eventfs_inode tracing/selftests: Update kprobe args char/string to match new functions ---- fs/tracefs/event_inode.c | 763 +++++++++++---------- fs/tracefs/event_show.c | 51 +- fs/tracefs/inode.c | 2 +- fs/tracefs/internal.h | 54 +- include/linux/trace_events.h | 2 +- include/linux/tracefs.h | 29 +- kernel/trace/trace.c | 7 +- kernel/trace/trace.h | 4 +- kernel/trace/trace_events.c | 315 ++++++--- .../ftrace/test.d/kprobe/kprobe_args_char.tc | 4 +- .../ftrace/test.d/kprobe/kprobe_args_string.tc | 4 +- 11 files changed, 691 insertions(+), 544 deletions(-)