From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B9CC3D6464 for ; Wed, 4 Mar 2026 22:03:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772661780; cv=none; b=g4cm6p/IKSjb4MDLl0vHArDCc3Nxv+hn9mo0Pd4pO0n02MD0TqRBuoQY3NURwU43bkKkzRUxGPfs7T1Gteb8PiXjJbgMmlJDaOSnw69PJLinPXFJs1RCDSVahDSK77X/QSL/ckJpWOUxRgMt5WPdMZMNgzCSnecpLvJzp760vdA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772661780; c=relaxed/simple; bh=6UmrcNEmfvnKK6jbCaKrhuBxd2QA9AWlZN4Z/e2CNzE=; h=Message-ID:Date:From:To:Cc:Subject; b=M8FV+y8z7PjkWYYxNpdLxr5PIpVBwJpyEDcxkhbv3BEtdNSZFK//JO9s8Bw5OnH7v8y241s9UgC9nzAshXLzYqZZyOUlOaiY6E9zRTtYkYNwMrjuQiLYTvt+Raey3Is+WMDJFbkQKs2uN7O3fh4ndA4r1VdNIOl4+P4fNZ2ux3I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fZz00jON; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fZz00jON" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69D79C19425; Wed, 4 Mar 2026 22:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772661780; bh=6UmrcNEmfvnKK6jbCaKrhuBxd2QA9AWlZN4Z/e2CNzE=; h=Date:From:To:Cc:Subject:From; b=fZz00jON4YDPlj+kyFeEadxFFr0gvui3IoNMeLgs1Ql4DXqGWHJPYaMqxrINcW18k ymCIzJ6Gz9RlsdEJJTfVMdqbA1CwN9JKtBw/3zak7nv53E3SFn8YkE9Odssk7AN5rR uYqtLm/kd/Y3VGwkFzk6MZ31dFZDOzLn4P9El995TZR42FxLBpyRYClF++RHhmbp8Z uIOXqqhUkWRx7fvYzPMvndch/s3pvlKvCmhupNzgGfP9CGDCHCuVD6pZAzW0kVvtjC TCOLJIZF0WIycfH7H6iAolTW4707oZEh/QQIO1LNLX0dpCJlQ0waR7Xd0CNQXYaSzZ go2vipcMnwNdQ== Received: from rostedt by gandalf with local (Exim 4.99.1) (envelope-from ) id 1vxuJd-00000003CQG-1SXU; Wed, 04 Mar 2026 17:03:37 -0500 Message-ID: <20260304220319.218314827@kernel.org> User-Agent: quilt/0.69 Date: Wed, 04 Mar 2026 17:03:19 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [for-linus][PATCH 0/6] tracing: Fixes for v7.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: tracing fixes for v7.0: - Fix thresh_return of function graph tracer The update to store data on the shadow stack removed the abuse of using the task recursion word as a way to keep track of what functions to ignore. The trace_graph_return() was updated to handle this, but when function_graph tracer is using a threshold (only trace functions that took longer than a specified time), it uses trace_graph_thresh_return() instead. This function was still incorrectly using the task struct recursion word causing the function graph tracer to permanently set all functions to "notrace" - Fix thresh_return nosleep accounting When the calltime was moved to the shadow stack storage instead of being on the fgraph descriptor, the calculations for the amount of sleep time was updated. The calculation was done in the trace_graph_thresh_return() function, which also called the trace_graph_return(), which did the calculation again, causing the time to be doubled. Remove the call to trace_graph_return() as what it needed to do wasn't that much, and just do the work in trace_graph_thresh_return(). - Fix syscall trace event activation on boot up The syscall trace events are pseudo events attached to the raw_syscall tracepoints. When the first syscall event is enabled, it enables the raw_syscall tracepoint and doesn't need to do anything when a second syscall event is also enabled. When events are enabled via the kernel command line, syscall events are partially enabled as the enabling is called before rcu_init. After rcu_init, they are disabled and re-enabled so that they can be fully enabled. The problem happened is that this "disable-enable" is done one at a time. If more than one syscall event is specified on the command line, by disabling them one at a time never makes the counter go to zero, and the raw_syscall is not disabled and enabled. Instead, disable all events and re-enabled them all, as that will ensure the raw_syscall event is also disabled and re-enabled. - Disable preemption in ftrace pid filtering The ftrace pid filtering attaches to the fork and exit tracepoints to add or remove pids that should be traced. They access variables protected by RCU (preemption disabed). Now that tracepoint callbacks are called with preemption, this protection needs to be added explicitly, and not depend on the functions being called with preemption disabled. - Disable preemption in event pid filtering The event pid filtering needs the same preemption disabling guards as ftrace pid filtering. - Fix accounting of the memory mapped ring buffer on fork Memory mapping the ftrace ring buffer sets the vm_flags to DONTCOPY. But this does not prevent the application from calling madvise(MADVISE_DOFORK). This causes the mapping to be copied on fork. After the first tasks exits, the mapping is considered unmapped by everyone. But when he second task exits, the counter goes below zero and triggers a WARN_ON. Since nothing prevents two separate tasks from mmapping the ftrace ring buffer (although weird the two will mess each other up), there's no reason to stop the memory from being copied on fork. Update the vm_operations to have an ".open" handler to update the accounting and let the ring buffer know someone else has it mapped. git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace/fixes Head SHA1: e39bb9e02b68942f8e9359d2a3efe7d37ae6be0e Huiwen He (1): tracing: Fix syscall events activation by ensuring refcount hits zero Masami Hiramatsu (Google) (1): tracing: Disable preemption in the tracepoint callbacks handling filtered pids Qing Wang (1): tracing: Fix WARN_ON in tracing_buffers_mmap_close Shengming Hu (2): fgraph: Fix thresh_return clear per-task notrace fgraph: Fix thresh_return nosleeptime double-adjust Steven Rostedt (1): ftrace: Disable preemption in the tracepoint callbacks handling filtered pids ---- include/linux/ring_buffer.h | 1 + kernel/trace/ftrace.c | 2 ++ kernel/trace/ring_buffer.c | 21 ++++++++++++++ kernel/trace/trace.c | 13 +++++++++ kernel/trace/trace_events.c | 54 ++++++++++++++++++++++++++---------- kernel/trace/trace_functions_graph.c | 19 +++++++++---- 6 files changed, 89 insertions(+), 21 deletions(-)