lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241202150516.3cf52584@gandalf.local.home>
Date: Mon, 2 Dec 2024 15:05:16 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Mike Rapoport <rppt@...nel.org>
Cc: Christophe Leroy <christophe.leroy@...roup.eu>, Masami Hiramatsu
 <mhiramat@...nel.org>, Mark Rutland <mark.rutland@....com>, Linux Trace
 Kernel <linux-trace-kernel@...r.kernel.org>, Mathieu Desnoyers
 <mathieu.desnoyers@...icios.com>, Peter Zijlstra <peterz@...radead.org>,
 LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ftrace: Show timings of how long nop patching took

On Mon, 2 Dec 2024 08:37:19 +0200
Mike Rapoport <rppt@...nel.org> wrote:

> > > On powerpc I get:
> > > 
> > > 25850 pages:14 groups: 3
> > > ftrace boot update time = 0 (ns)
> > > ftrace module total update time = 0 (ns)  
> > 
> > Hmm, does powerpc support "trace_clock_local()" at early boot? I
> > probably can just switch from using "ftrace_now()" to using
> > ktime_get_real_ts64(). Hmm.  
> 
> The calls to timekeeping_init() and time_init() are after ftrace_init() so
> unless an architecture sets up some clock in setup_arch() like x86 does
> there won't be a clock to use.

Hmm, maybe I should add:

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index be62f0ea1814..362a125d7bcc 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -8588,14 +8588,23 @@ tracing_read_dyn_info(struct file *filp, char __user *ubuf,
 		return -ENOMEM;
 
 	r = scnprintf(buf, DYN_INFO_BUF_SIZE,
-		      "%ld pages:%ld groups: %ld\n"
-		      "ftrace boot update time = %llu (ns)\n"
-		      "ftrace module total update time = %llu (ns)\n",
+		      "%ld pages:%ld groups: %ld\n",
 		      ftrace_update_tot_cnt,
 		      ftrace_number_of_pages,
-		      ftrace_number_of_groups,
-		      ftrace_update_time,
-		      ftrace_total_mod_time);
+		      ftrace_number_of_groups);
+
+	if (ftrace_update_time) {
+		r += scnprintf(buf + r, DYN_INFO_BUF_SIZE - r,
+			       "ftrace boot update time = %llu (ns)\n",
+			       ftrace_update_time);
+	} else {
+		r += scnprintf(buf + r, DYN_INFO_BUF_SIZE - r,
+			       "ftrace boot update time = [Unavailable]\n");
+	}
+
+	r += scnprintf(buf + r, DYN_INFO_BUF_SIZE - r,
+		       "ftrace module total update time = %llu (ns)\n",
+		       ftrace_total_mod_time);
 
 	ret = simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
 	kfree(buf);

Which should turn the above to:

  25850 pages:14 groups: 3
  ftrace boot update time = [Unavailable]
  ftrace module total update time = 0 (ns)

Which should at least make it not confusing.

I'm assuming that the module timings are zero because no modules were loaded?

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ