Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48E49C433F5 for ; Mon, 13 Dec 2021 10:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235649AbhLMKBm (ORCPT ); Mon, 13 Dec 2021 05:01:42 -0500 Received: from sin.source.kernel.org ([145.40.73.55]:45818 "EHLO sin.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238974AbhLMJ4Q (ORCPT ); Mon, 13 Dec 2021 04:56:16 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 76266CE0E6B; Mon, 13 Dec 2021 09:56:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 232E8C34603; Mon, 13 Dec 2021 09:56:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1639389372; bh=ybFAwcSXdIy4tT/s09golkOAvRym3nZx/tRRa4EusaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XWopd8IBUDUWuD8xQdJoAbse8o6FzcRusNZdDAXzsDJbclu7LFHVVMfrx6oc1tILG 7iCEJjegjPt+iI1QY/RH7o0CzgW7aDqfAXSYbUuO95TbbkO9fc2xR0+6TgdHjUq8xX 5Az5xqQhfLcJ+nExpSc3c8K8fBY4vuptjupsPwpg= 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 5.15 077/171] perf intel-pt: Fix sync state when a PSB (synchronization) packet is found Date: Mon, 13 Dec 2021 10:29:52 +0100 Message-Id: <20211213092947.663677024@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211213092945.091487407@linuxfoundation.org> References: <20211213092945.091487407@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adrian Hunter commit ad106a26aef3a95ac7ca88d033b431661ba346ce upstream. When syncing, it may be that branch packet generation is not enabled at that point, in which case there will not immediately be a control-flow packet, so some packets before a control flow packet turns up, get ignored. However, the decoder is in sync as soon as a PSB is found, so the state should be set accordingly. Fixes: f4aa081949e7b6 ("perf tools: Add Intel PT decoder") Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org # v5.15+ Link: https://lore.kernel.org/r/20211210162303.2288710-3-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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c @@ -3607,7 +3607,7 @@ static int intel_pt_sync(struct intel_pt } decoder->have_last_ip = true; - decoder->pkt_state = INTEL_PT_STATE_NO_IP; + decoder->pkt_state = INTEL_PT_STATE_IN_SYNC; err = intel_pt_walk_psb(decoder); if (err)