From nobody Tue Dec 16 05:58:01 2025 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 0794815746B for ; Tue, 14 Jan 2025 15:52:52 +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=1736869973; cv=none; b=h5NOfZ399CAkTXjPookkNq0MJUOMR0eAplgeo+6FrsSiby1cZbDWbrrsET9QOHaST6pGMJmpz2VMYFI03GQmZTdw9Se7p7SVceKz2CYi56MxmzqXqjk6xLc4Ko6kCC/5UX7QfCD6OVzwOe+AR5AJCgZQtiBvgZ17gEoFjYlKUKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736869973; c=relaxed/simple; bh=BXCsJfd99h9pyfS2dbto1htlilv4VmM+ZQBQ4Mtb+Wc=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=pTOG0PvJbmg8SaGUddgI/5hCCnOuHeVIbsdnXp8iGsOmJlO0aS2P4Fv4/Oh+wRI4ia8LtqHEGkDtKdj97oiVxwfCBSST7fB4utlPt7GE8DqVH0c5FmQ5rsLq+OghjQm5RI174wdnUTOzSM6V6GaCJKCPOrDUQV3qFDIwKMdopPA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08795C4CEDD; Tue, 14 Jan 2025 15:52:51 +0000 (UTC) Date: Tue, 14 Jan 2025 10:52:52 -0500 From: Steven Rostedt To: LKML Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers Subject: [for-linus][PATCH] ftrace: Document that multiple function_graph tracing may have different times Message-ID: <20250114105252.2cc71e08@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Another update for v6.13: - Document multiple function graph having slightly different timings Now that function graph tracer infrastructure is separate, this also allows the function graph tracer to run in multiple instances (it wasn't able to do so before). If two instances ran the function graph tracer and traced the same functions, the timings for them will be slightly different because each does their own timings and collects the timestamps differently. Document this to not have people be confused by it. git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace/fixes Head SHA1: 94d529a3255ce65496e932173d7f13e801170597 Steven Rostedt (1): ftrace: Document that multiple function_graph tracing may have differ= ent times ---- Documentation/trace/ftrace.rst | 6 ++++++ 1 file changed, 6 insertions(+) --------------------------- commit 94d529a3255ce65496e932173d7f13e801170597 Author: Steven Rostedt Date: Tue Jan 14 10:12:02 2025 -0500 ftrace: Document that multiple function_graph tracing may have differen= t times =20 The function graph tracer now calculates the calltime internally and for each instance. If there are two instances that are running function gra= ph tracer and are tracing the same functions, the timings of the length of those functions may be slightly different: =20 # trace-cmd record -B foo -p function_graph -B bar -p function_graph s= leep 5 # trace-cmd report [..] bar: sleep-981 [000] ...1. 1101.109027: funcgraph_entry: = 0.764 us | mutex_unlock(); (ret=3D0xffff8abcc256c300) foo: sleep-981 [000] ...1. 1101.109028: funcgraph_entry: = 0.748 us | mutex_unlock(); (ret=3D0xffff8abcc256c300) bar: sleep-981 [000] ..... 1101.109029: funcgraph_exit: = 2.456 us | } (ret=3D0xffff8abcc256c300) foo: sleep-981 [000] ..... 1101.109029: funcgraph_exit: = 2.403 us | } (ret=3D0xffff8abcc256c300) bar: sleep-981 [000] d..1. 1101.109031: funcgraph_entry: = 0.844 us | fpregs_assert_state_consistent(); (ret=3D0x0) foo: sleep-981 [000] d..1. 1101.109032: funcgraph_entry: = 0.803 us | fpregs_assert_state_consistent(); (ret=3D0x0) =20 Link: https://lore.kernel.org/all/20250114101806.b2778cb01f34f5be9d23ad= 98@kernel.org/ =20 Cc: Mark Rutland Cc: Mathieu Desnoyers Suggested-by: Masami Hiramatsu Link: https://lore.kernel.org/20250114101202.02e7bc68@gandalf.local.home Signed-off-by: Steven Rostedt (Google) diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst index 272464bb7c60..2b74f96d09d5 100644 --- a/Documentation/trace/ftrace.rst +++ b/Documentation/trace/ftrace.rst @@ -810,6 +810,12 @@ Here is the list of current tracers that may be config= ured. to draw a graph of function calls similar to C code source. =20 + Note that the function graph calculates the timings of when the + function starts and returns internally and for each instance. If + there are two instances that run function graph tracer and traces + the same functions, the length of the timings may be slightly off as + each read the timestamp separately and not at the same time. + "blk" =20 The block tracer. The tracer used by the blktrace user