Received: by 10.192.165.156 with SMTP id m28csp230586imm; Tue, 17 Apr 2018 09:11:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+dTK+4dFktkikUhDlajQQR24OVelYA8uH5xtgqvMr1OrrQfL64QWOSIDDxHG7iGecmFpc1 X-Received: by 10.98.75.89 with SMTP id y86mr2573973pfa.140.1523981487579; Tue, 17 Apr 2018 09:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523981487; cv=none; d=google.com; s=arc-20160816; b=DgBWLqKhbb3hbfzXfCi1aRfePGnzRxtRs49NfljTlPovth9xEFpRpKuN8+ndHPqCug 8cOrvgs+J5EbBvFRXnfymH7VIwRELjPtbrMFNImZLXmXFOGJKcKcjTKKyuRHp9nzZIbu iUlU5SXIhrBW2qNWc6V2x5ZviGaXIep/Uury1a3NboEx2jURb3ZWtIvXFPKQYW9IKALN hhsq+HjU7otU39gg4hMS8u2ZDjuJrP3gLltGi65NlHevN9QV0XZcb13j9Bga/0e5eF74 9WwA2rJhAgXRIIGbr20q5wyVHXXZFCKFOG23Cg7NdUs9eKEt9m3Qlr+yjl6gCqFfxsPa PRYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Slw8PocCCmYzdbwNLXS/fujqpGn7R3bk1cOjXJec0HE=; b=cMmAXPJLlHZ83YRCacHRTYH6hMlmQpkyIvWq7S4TCl3p/qotpd/dQ9HHY1fVEvJGiq 7Oa6pQrLEj4xTJalA5u8NZy4eVOB+tZCIxbTzKhOLk3hNlTIk1hGCbxdVvOKw/TKop3s zQvgQNCp1snlVOhW/JhX0XCUdj9ZlKa0ZdzXeeZlI14yWjfJx7zNxUxtq14+a1HytE9D eVdmtjJg+G2yIIkm/SCTDzfIoUb/odP5VizvocoHLXg27IqaSoyEjyP7kjNEs79MsIKQ B98b5iuEA8mHF8Sc0KMKIii2evsrJ6Y4dYGM/vBiYrokCy8kxHE3LzwuanSC2jT/RS3f Ogjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l12si6663558pgr.518.2018.04.17.09.11.12; Tue, 17 Apr 2018 09:11:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755625AbeDQQJV (ORCPT + 99 others); Tue, 17 Apr 2018 12:09:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36038 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755322AbeDQQJR (ORCPT ); Tue, 17 Apr 2018 12:09:17 -0400 Received: from localhost (unknown [46.44.180.42]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F1242C00; Tue, 17 Apr 2018 16:09:16 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Jiri Olsa , Arnaldo Carvalho de Melo Subject: [PATCH 4.9 07/66] perf intel-pt: Fix timestamp following overflow Date: Tue, 17 Apr 2018 17:58:40 +0200 Message-Id: <20180417155646.168314771@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180417155645.868055442@linuxfoundation.org> References: <20180417155645.868055442@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Adrian Hunter commit 91d29b288aed3406caf7c454bf2b898c96cfd177 upstream. timestamp_insn_cnt is used to estimate the timestamp based on the number of instructions since the last known timestamp. If the estimate is not accurate enough decoding might not be correctly synchronized with side-band events causing more trace errors. However there are always timestamps following an overflow, so the estimate is not needed and can indeed result in more errors. Suppress the estimate by setting timestamp_insn_cnt to zero. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/1520431349-30689-5-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 1 + 1 file changed, 1 insertion(+) --- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c @@ -1300,6 +1300,7 @@ static int intel_pt_overflow(struct inte intel_pt_clear_tx_flags(decoder); decoder->have_tma = false; decoder->cbr = 0; + decoder->timestamp_insn_cnt = 0; decoder->pkt_state = INTEL_PT_STATE_ERR_RESYNC; decoder->overflow = true; return -EOVERFLOW;