Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp698842rdb; Fri, 1 Sep 2023 01:15:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrxOXYdAZamb/zWpzOI3OTyZEmBxWp+huaYGxV/Hcttf7FJ4AApidCG3tmRdZg8m6fGKEM X-Received: by 2002:a05:6a20:9390:b0:140:fd3b:5d4c with SMTP id x16-20020a056a20939000b00140fd3b5d4cmr2399340pzh.38.1693556138998; Fri, 01 Sep 2023 01:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693556138; cv=none; d=google.com; s=arc-20160816; b=Y3eZO1j6VMrLQW6/AgVcYK/sWyddYNbHn4QxxeyYYvO8NQh368B4VsEkqguiweuxxF UWyxUsBI1b5oZV38jNTN0g5Btr9Df1lVgt2snpYSMF1Czf1KdpH6qb7lzr+t5hcrf0Bj slKWlA6+51QthahmHKxhOiqIPW4qvhoZbw6Q290c/b6d3KXCsYiUkjPD4fV3AgTyDdi3 MEI9iB1xAfLs9iRzaKxCaKbbgegoP83RbcGU305QQVq6g5Y6cHwXqDKaNX7u/3SE+jH1 pFr4ppA7rIYaai8fav7jDLHIpo8vBdxQ8QFpNdrAS5fyQMQFRM2tSc8J5uiDZL5BNBsu QfPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:cc:to:from:date; bh=Ty8hZeZGWM6SXipc7a8pVqiVqJT6w+fZRYR73OG4fag=; fh=rOm3VzAVuQNL8thaQiGMeGIu9derbkyIuDii0K17V8k=; b=sQUMhNIHY2npdlQn1xPbZn0lHfUu2oppGWMEXNCbwB5rpfTDDtRlDjCSyRz8YK8WU3 STuu8HzeZVR6EgadoccJyKwNxWxa23dEoFjmDeO1yhg9Ryq9AkKP9F9S3fBQppj7g3xp pzLbstGMBfTRqbk8FrJyBJ3W9Zq0zzQdNc/jLApRygLLZwgIH3l7P36VJ6R04Bna64ao t7aZaF5L4TBilhfthoX0gTbl0yJghm72IDBLFCNTXjVnET8RHOtA/w+yTLdcfNcfydRV 6MDjWFbzEKjMKCzLeSVEk3tRh0pbsOokpxn9xW7OgpBD4wecezJgQvvQ2ztE/d4fL5Iu IJSg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a056a00230900b0068beea8071esi2594518pfh.221.2023.09.01.01.15.34; Fri, 01 Sep 2023 01:15:38 -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 S242340AbjHaP4q (ORCPT + 30 others); Thu, 31 Aug 2023 11:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231980AbjHaP4p (ORCPT ); Thu, 31 Aug 2023 11:56:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 092541A3 for ; Thu, 31 Aug 2023 08:56:42 -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 ams.source.kernel.org (Postfix) with ESMTPS id B6A27B8233E for ; Thu, 31 Aug 2023 15:56:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49CAEC433C8; Thu, 31 Aug 2023 15:56:38 +0000 (UTC) Date: Thu, 31 Aug 2023 11:56:35 -0400 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Masami Hiramatsu , Mark Rutland , Ajay Kaher , Eric Vaughn , Sishuai Gong , Uros Bizjak , Valentin Schneider , Yue Haibing , Zhang Zekun , Zheng Yejian Subject: [GIT PULL] tracing: Updates for 6.6 Message-ID: <20230831115635.1bdea0d7@rorschach.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS autolearn=no 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 Linus, [ Note, there's a minor conflict which should be fixed by: mutex_lock(&trace_types_lock); - if (unlikely(tr->current_trace && iter->trace->name != tr->current_trace->name)) { + if (unlikely(tr->current_trace != iter->trace)) + /* Close iter->trace before switching to the new current tracer */ + if (iter->trace->close) + iter->trace->close(iter); - *iter->trace = *tr->current_trace; + iter->trace = tr->current_trace; + /* Reopen the new current tracer */ + if (iter->trace->open) + iter->trace->open(iter); + } mutex_unlock(&trace_types_lock); ] Tracing updates for 6.6: User visible changes: - Added a way to easier filter with cpumasks: # echo 'cpumask & CPUS{17-42}' > /sys/kernel/tracing/events/ipi_send_cpumask/filter - Show actual size of ring buffer after modifying the ring buffer size via buffer_size_kb. Currently it just returns what was written, but the actual size rounds up to the sub buffer size. Show that real size instead. Major changes: - Added "eventfs". This is the code that handles the inodes and dentries of tracefs/events directory. As there are thousands of events, and each event has several inodes and dentries that currently exist even when tracing is never used, they take up precious memory. Instead, eventfs will allocate the inodes and dentries in a JIT way (similar to what procfs does). There is now metadata that handles the events and subdirectories, and will create the inodes and dentries when they are used. Note, I also have patches that remove the subdirectory meta data, but will wait till the next merge window before applying them. It's a little more complex, and I want to make sure the dynamic code works properly before adding more complexity, making it easier to revert if need be. Minor changes: - Optimization to user event list traversal. - Remove intermediate permission of tracefs files (note the intermediate permission removes all access to the files so it is not a security concern, but just a clean up.) - Add the complex fix to FORTIFY_SOURCE to the kernel stack event logic. - Other minor clean ups. Please pull the latest trace-v6.6 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-v6.6 Tag SHA1: 1065c0c85cfdb141b5cc2064b6e379fd564f0779 Head SHA1: 8c96b70171584f38940eb2ba65b84eee38b549ba Ajay Kaher (9): eventfs: Implement tracefs_inode_cache tracefs: Rename and export some tracefs functions eventfs: Implement eventfs dir creation functions eventfs: Implement eventfs file add functions eventfs: Implement eventfs lookup, read, open functions eventfs: Implement functions to create files and dirs when accessed eventfs: Implement removal of meta data from eventfs eventfs: Move tracing/events to eventfs test: ftrace: Fix kprobe test for eventfs Eric Vaughn (1): tracing/user_events: Optimize safe list traversals Sishuai Gong (1): tracefs: Avoid changing i_mode to a temp value Steven Rostedt (Google) (5): tracing: Add back FORTIFY_SOURCE logic to kernel_stack event structure tracing: Remove unnecessary copying of tr->current_trace tracing: Add free_trace_iter_content() helper function tracing: Require all trace events to have a TRACE_SYSTEM tracefs: Remove kerneldoc from struct eventfs_file Uros Bizjak (1): ring_buffer: Use try_cmpxchg instead of cmpxchg Valentin Schneider (9): tracing/filters: Dynamically allocate filter_pred.regex tracing/filters: Enable filtering a cpumask field by another cpumask tracing/filters: Enable filtering a scalar field by a cpumask tracing/filters: Enable filtering the CPU common field by a cpumask tracing/filters: Optimise cpumask vs cpumask filtering when user mask is a single CPU tracing/filters: Optimise scalar vs cpumask filtering when the user mask is a single CPU tracing/filters: Optimise CPU vs cpumask filtering when the user mask is a single CPU tracing/filters: Further optimise scalar vs cpumask comparison tracing/filters: Document cpumask filtering Yue Haibing (1): tracing: Remove unused function declarations Zhang Zekun (1): ftrace: Remove empty declaration ftrace_enable_daemon() and ftrace_disable_daemon() Zheng Yejian (1): tracing: Set actual size after ring buffer resize ---- Documentation/trace/events.rst | 14 + fs/tracefs/Makefile | 1 + fs/tracefs/event_inode.c | 807 +++++++++++++++++++++ fs/tracefs/inode.c | 157 +++- fs/tracefs/internal.h | 29 + include/linux/ftrace.h | 5 - include/linux/trace_events.h | 2 + include/linux/tracefs.h | 23 + kernel/trace/ring_buffer.c | 20 +- kernel/trace/trace.c | 99 +-- kernel/trace/trace.h | 14 +- kernel/trace/trace_entries.h | 2 +- kernel/trace/trace_events.c | 76 +- kernel/trace/trace_events_filter.c | 302 +++++++- kernel/trace/trace_events_user.c | 15 +- kernel/trace/trace_export.c | 9 + .../ftrace/test.d/kprobe/kprobe_args_char.tc | 9 +- .../ftrace/test.d/kprobe/kprobe_args_string.tc | 9 +- 18 files changed, 1424 insertions(+), 169 deletions(-) create mode 100644 fs/tracefs/event_inode.c create mode 100644 fs/tracefs/internal.h ---------------------------