Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752778AbcLDIg3 (ORCPT ); Sun, 4 Dec 2016 03:36:29 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:59962 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752431AbcLDIg1 (ORCPT ); Sun, 4 Dec 2016 03:36:27 -0500 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 83AAD61609 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=sramana@codeaurora.org Message-ID: <5843D587.5010407@codeaurora.org> Date: Sun, 04 Dec 2016 14:06:23 +0530 From: Srinivas Ramana User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Will Deacon CC: catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH] trace: extend trace_clock to support arch_arm clock counter References: <1480666495-26536-1-git-send-email-sramana@codeaurora.org> <20161202110845.GC8266@arm.com> In-Reply-To: <20161202110845.GC8266@arm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1419 Lines: 33 On 12/02/2016 04:38 PM, Will Deacon wrote: > On Fri, Dec 02, 2016 at 01:44:55PM +0530, Srinivas Ramana wrote: >> Extend the trace_clock to support the arch timer cycle >> counter so that we can get the monotonic cycle count >> in the traces. This will help in correlating the traces with the >> timestamps/events in other subsystems in the soc which share >> this common counter for driving their timers. > > I'm not sure I follow this reasoning. What's wrong with nanoseconds? In > particular, the "perf" trace_clock hangs off sched_clock, which should > be backed by the architected counter anyway. What does the cycle counter in > isolation tell you, given that the frequency isn't architected? > > I think I'm missing something here. > > Will > Having cycle counter would help in the cases where we want to correlate the time with other subsystems which are outside cpu subsystem. local_clock or even the perf track_clock uses sched_clock which gets suspended during system suspend. Yes, they are backed up by the architected counter but they ignore the cycles spent in suspend. so, when comparing with monotonically increasing cycle counter, other clocks doesn't help. It seems X86 uses the TSC counter to help such cases. Thanks, -- Srinivas R -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.