From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932911AbcIUH27 (ORCPT ); Wed, 21 Sep 2016 03:28:59 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:33379 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752814AbcIUH2z (ORCPT ); Wed, 21 Sep 2016 03:28:55 -0400 Date: Wed, 21 Sep 2016 09:26:20 +0200 (CEST) From: Thomas Gleixner To: Baolin Wang cc: Alessandro Zummo , Alexandre Belloni , Steven Rostedt , Ingo Molnar , John Stultz , Mark Brown , LKML , rtc-linux@googlegroups.com Subject: Re: [PATCH 2/2] time: alarmtimer: Add the trcepoints for alarmtimer In-Reply-To: Message-ID: References: <8c570c152c95087faa75e397c667b6d5b8d98b3b.1474177609.git.baolin.wang@linaro.org> <0d5cedb2f4ad46aa7fb07b990072bacb33517102.1474177609.git.baolin.wang@linaro.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Sep 2016, Baolin Wang wrote: > On 21 September 2016 at 06:27, Thomas Gleixner wrote: > >> + TP_fast_assign( > >> + __entry->second = rtc_time->tm_sec; > >> + __entry->minute = rtc_time->tm_min; > >> + __entry->hour = rtc_time->tm_hour; > >> + __entry->day = rtc_time->tm_mday; > >> + __entry->mon = rtc_time->tm_mon; > >> + __entry->year = rtc_time->tm_year; > >> + __entry->alarm_type = flag; > > > > What's the value of storing the alarm time in RTC format? > > As suggested by Steven, change the type of RTC value to save trace buffer. A single u64 does not take more storage space than this and it's a single store. > > 2) You store the expiry time again in RTC format. Store the information in > > a plain u64 and be done with it. > > But I still think the RTC format is more readable for debugging alarm timer. That's what post processing is for. > > What's the point of this conditional? Avoiding rtc_ktime_to_tm() ? Oh well... > > > >> + tm_set = rtc_ktime_to_tm(now); > >> + trace_alarmtimer_suspend(&tm_set, type); > > > > "now" is CLOCK_REALTIME based. You store the type of the alarm timer which > > is the first to expire and therefor is the one setting the RTC value, but > > we don't know which timer it is. Useful - NOT! > > We can know the timer by comparing the expire time. Please make it similar to the timer/hrtimer tracing so people can reuse their postprocessing scripts with minimial tweaks. Thanks, tglx