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] [day] [month] [year] [list]
Message-ID: <20241203101750.62a85ca2@gandalf.local.home>
Date: Tue, 3 Dec 2024 10:17:50 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Christophe Leroy <christophe.leroy@...roup.eu>
Cc: Mike Rapoport <rppt@...nel.org>, 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 Tue, 3 Dec 2024 08:21:49 +0100
Christophe Leroy <christophe.leroy@...roup.eu> wrote:

> > 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.  
> 
> Well. Maybe, but at the end what we need is the measured value, if it 
> only works on x86 it is just pointless, isn't it ?
> 
> trace_clock_local() calls sched_clock()
> 
> I don't know about other architectures, but on powerpc sched_clock() is:
> 
> 	notrace unsigned long long sched_clock(void)
> 	{
> 		return mulhdu(get_tb() - boot_tb, tb_to_ns_scale) << tb_to_ns_shift;
> 	}
> 
> boot_tb, tb_to_ns_scale and tb_to_ns_shift are not known before 
> time_init() is called.
> 
> But get_tb() returns a valid value already so it is possible to get the 
> ticks and do the calculation later with tb_to_ns()

We could add code to make that work for all archs via arch_xxx() functions.

But as the merge window is already closed, I'll just submit a
"[Unavailable]" patch to Linus as a "fix" and then for the next merge
window we can have code that will allow architectures to print real timings.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ