Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030706AbaGRRFD (ORCPT ); Fri, 18 Jul 2014 13:05:03 -0400 Received: from mail-vc0-f181.google.com ([209.85.220.181]:32878 "EHLO mail-vc0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030432AbaGRRFB (ORCPT ); Fri, 18 Jul 2014 13:05:01 -0400 MIME-Version: 1.0 In-Reply-To: <20140717220849.735bec65@gandalf.local.home> References: <20140630144017.2abc48ba@gandalf.local.home> <20140717220849.735bec65@gandalf.local.home> Date: Fri, 18 Jul 2014 10:05:00 -0700 Message-ID: Subject: Re: [PATCH-v2] tracing: Fix wraparound problems in "uptime" tracer From: Tony Luck To: Steven Rostedt Cc: Linux Kernel Mailing List , Ingo Molnar , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , " Xie XiuQi" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 17, 2014 at 7:08 PM, Steven Rostedt wrote: >> Do we really need to convert to nanoseconds? Couldn't we just return >> jiffies: > > Sure, and we can make it a "counter". That is, the counters don't hide > 1000 counts on output. Can you explain that a bit more ... how do we mark it as a "counter"? >> u64 notrace trace_clock_jiffies(void) >> { >> return jiffies_64 - INITIAL_JIFFIES; >> } Hmm it seems that we make it hard for applications to see what HZ value the kernel is actually using. All user-facing interfaces should convert to USER_HZ (100). So we should say: u64 notrace trace_clock_jiffies(void) { return jiffies_64_to_clock_t(jiffies_64 - INITIAL_JIFFIES); } Do we need to change anything in Documentation/trace/ftrace.txt? Currently it says: uptime: This uses the jiffies counter and the time stamp is relative to the time since boot up. -Tony -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/