From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935248AbcJFWkv (ORCPT ); Thu, 6 Oct 2016 18:40:51 -0400 Received: from terminus.zytor.com ([198.137.202.10]:46288 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935033AbcJFWkm (ORCPT ); Thu, 6 Oct 2016 18:40:42 -0400 Date: Thu, 6 Oct 2016 15:40:28 -0700 From: tip-bot for Adrian Hunter Message-ID: Cc: tglx@linutronix.de, acme@redhat.com, mingo@kernel.org, hpa@zytor.com, adrian.hunter@intel.com, jolsa@redhat.com, linux-kernel@vger.kernel.org Reply-To: jolsa@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, acme@redhat.com, mingo@kernel.org, adrian.hunter@intel.com, hpa@zytor.com In-Reply-To: <1475062896-22274-1-git-send-email-adrian.hunter@intel.com> References: <1475062896-22274-1-git-send-email-adrian.hunter@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf intel-pt: Fix estimated timestamps for cycle-accurate mode Git-Commit-ID: 51ee6481fa8e879cc942bcc1b0af713e158b7a98 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 51ee6481fa8e879cc942bcc1b0af713e158b7a98 Gitweb: http://git.kernel.org/tip/51ee6481fa8e879cc942bcc1b0af713e158b7a98 Author: Adrian Hunter AuthorDate: Wed, 28 Sep 2016 14:41:35 +0300 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 5 Oct 2016 08:15:29 -0300 perf intel-pt: Fix estimated timestamps for cycle-accurate mode In cycle-accurate mode, timestamps can be calculated from CYC packets. The decoder also estimates timestamps based on the number of instructions since the last timestamp. For that to work in cycle-accurate mode, the instruction count needs to be reset to zero when a timestamp is calculated from a CYC packet, but that wasn't happening, so fix it. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org # v4.3+ Link: http://lkml.kernel.org/r/1475062896-22274-1-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c index 7591a0c..3d1d446 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c @@ -1353,6 +1353,8 @@ static void intel_pt_calc_cyc_timestamp(struct intel_pt_decoder *decoder) timestamp, decoder->timestamp); else decoder->timestamp = timestamp; + + decoder->timestamp_insn_cnt = 0; } /* Walk PSB+ packets when already in sync. */