From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161503AbcHEP2v (ORCPT ); Fri, 5 Aug 2016 11:28:51 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:39142 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753931AbcHEP2t (ORCPT ); Fri, 5 Aug 2016 11:28:49 -0400 Subject: Re: [RFC][PATCH 1/3] tracing: Added hardware latency tracer To: Steven Rostedt References: <20160804145708.158968389@goodmis.org> <20160804145839.856286626@goodmis.org> <20160805142521.GA21312@linutronix.de> <20160805104413.781611b5@gandalf.local.home> Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Ingo Molnar , Andrew Morton , Clark Williams , Thomas Gleixner , Jon Masters , Daniel Wagner , Carsten Emde From: Sebastian Andrzej Siewior Message-ID: <866492b0-182c-4810-e738-6d19605c858f@linutronix.de> Date: Fri, 5 Aug 2016 17:28:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160805104413.781611b5@gandalf.local.home> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/05/2016 04:44 PM, Steven Rostedt wrote: > On Fri, 5 Aug 2016 16:25:21 +0200 > Sebastian Andrzej Siewior wrote: > >> * Steven Rostedt | 2016-08-04 10:57:09 [-0400]: >> >>> diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c >>> new file mode 100644 >>> index 000000000000..08dfabe4e862 >>> --- /dev/null >>> +++ b/kernel/trace/trace_hwlat.c >> … >>> +/* Macros to encapsulate the time capturing infrastructure */ >>> +#define time_type u64 >>> +#define time_get() trace_clock_local() >>> +#define time_to_us(x) div_u64(x, 1000) >>> +#define time_sub(a, b) ((a) - (b)) >>> +#define init_time(a, b) (a = b) >>> +#define time_u64(a) a >> >> Do we need a macro for this? In the old code we could choose between >> CONFIG_TRACING but now we don't. >> > > Probably not, I kept it for two reasons. 1) to keep the same logic as > what was in PREEMPT_RT, and 2) in case we can come up with a better > clock. I assumed it was a leftover. > But it's not that important. Should it be nuked? They do somewhat make > the code easier to read. that time_get() is close to ktime_get() which is almost u64 nowadays. So it might not be that cool for upstream. A hwlat prefix makes the whole thing not prettier. 1. PREEMPT_RT. Do I need any changes? I assumed I could keep this 1:1 (once it is merged) and throw the current hwlat out. 2. a better clock is an argument. But why would you have a better clock for hwlat and not for the whole tracing infrastructure? If you want to keep it, keep it. I just assumed it was a leftover. > > -- Steve Sebastian