Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11789220pjo; Thu, 2 Jan 2020 14:18:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwhOe2bdFWZTfcd7ap5Sft22ebuuG37maoh+0IhbeDb82Brrho2xNXgJVaJskn6mroGeMP5 X-Received: by 2002:aca:fcd0:: with SMTP id a199mr2974313oii.143.1578003514813; Thu, 02 Jan 2020 14:18:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003514; cv=none; d=google.com; s=arc-20160816; b=AjezB1Dy5s1VVYeQ215ZqLSjTxF51szq834Y5iScABb7//K70c/thOCr3jyfgyy+zP 9GZw2TnnmeTajn6AFqOOY/f99PrI6ADnugKdISg+iuabgSsDPXgqqwkLQ50/ogjPyfXC EBK+Mp3i1YiMlUEOIbyRAHCThpxr+MOVM+wACgIF4omqVvSDITCshtOJ5OmAQJP25FOo AwKvJbRx/yHZUzdg0Rvt//FTq1texSpcRbpkQlnOv2uz1HfYrzhN9ICUXLd724Y3wjna qfJdKqucKyWrENRkRtF7fVr/z9zqrbyUL4Moq5X2Oa2fi8dSvZhRIGna19uPuYFQ+xa/ hlnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MVaiNCbbbKDEO8yCeF68p1xOkkY7XwFI00VdsaKMLjI=; b=Qn11qB03Qgo8gvYLOarwiKWSW23p8xzKR+TD1Hp3TJSzysX1URZ3YsAK5wwyNo6h20 9bmq/wFNAbaO6v4N2Qm3GUuyKDq5w6DWsNmx22Cq/JeTgZCboUgQXczqVNx4iqVWW+J7 lbgwrkOZ99uL+YR05nvEUrPwFuNtXAXk5B39dtFKeo5SaXRoSqpRXZuKMxLzxV/EuShx yeiGkJUHajaYVRrDZJCxzgCxvSv3IQ0Re+UbJJt53mOjpaCT5Y338RrjibdsYj3sB9Y/ uUM4A2WDUPZUtAzDYABh0ghYMOD3m7WFkc3MRPzay5oQI5Dtg5q7lUbSc2If+m60YUZ8 Sgxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PbtkJzfI; 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 g138si23816012oib.190.2020.01.02.14.18.23; Thu, 02 Jan 2020 14:18:34 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=PbtkJzfI; 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 S1727657AbgABWQe (ORCPT + 99 others); Thu, 2 Jan 2020 17:16:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:58510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbgABWQd (ORCPT ); Thu, 2 Jan 2020 17:16:33 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A34CE227BF; Thu, 2 Jan 2020 22:16:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003392; bh=uUdRSJuEgaeN4PO+iSnIHjeRDg0cdco+F75KCCfYWWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PbtkJzfIPMhw1Y2ImVigOe4zf16/hnsR0I8uf3C8h+awpRL4Ah5NETEAaA2aFpvh2 JTzmI8x6mflVfGK4H072w9w6+RjOZNCrCxr3AjzONu3UDepGEVZ4Efjw090JNLka9R OHHHLM8kI4G4Ae8oeXJzH+QR3nj+rOIi0kO9+a48= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andi Kleen , Adrian Hunter , Jiri Olsa , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.4 116/191] perf script: Fix brstackinsn for AUXTRACE Date: Thu, 2 Jan 2020 23:06:38 +0100 Message-Id: <20200102215842.264432860@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adrian Hunter [ Upstream commit 0cd032d3b5fcebf5454315400ab310746a81ca53 ] brstackinsn must be allowed to be set by the user when AUX area data has been captured because, in that case, the branch stack might be synthesized on the fly. This fixes the following error: Before: $ perf record -e '{intel_pt//,cpu/mem_inst_retired.all_loads,aux-sample-size=8192/pp}:u' grep -rqs jhgjhg /boot [ perf record: Woken up 19 times to write data ] [ perf record: Captured and wrote 2.274 MB perf.data ] $ perf script -F +brstackinsn --xed --itrace=i1usl100 | head Display of branch stack assembler requested, but non all-branch filter set Hint: run 'perf record -b ...' After: $ perf record -e '{intel_pt//,cpu/mem_inst_retired.all_loads,aux-sample-size=8192/pp}:u' grep -rqs jhgjhg /boot [ perf record: Woken up 19 times to write data ] [ perf record: Captured and wrote 2.274 MB perf.data ] $ perf script -F +brstackinsn --xed --itrace=i1usl100 | head grep 13759 [002] 8091.310257: 1862 instructions:uH: 5641d58069eb bmexec+0x86b (/bin/grep) bmexec+2485: 00005641d5806b35 jnz 0x5641d5806bd0 # MISPRED 00005641d5806bd0 movzxb (%r13,%rdx,1), %eax 00005641d5806bd6 add %rdi, %rax 00005641d5806bd9 movzxb -0x1(%rax), %edx 00005641d5806bdd cmp %rax, %r14 00005641d5806be0 jnb 0x5641d58069c0 # MISPRED mismatch of LBR data and executable 00005641d58069c0 movzxb (%r13,%rdx,1), %edi Fixes: 48d02a1d5c13 ("perf script: Add 'brstackinsn' for branch stacks") Reported-by: Andi Kleen Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20191127095322.15417-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/builtin-script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 6dba8b728d23..3983d6ccd14d 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -448,7 +448,7 @@ static int perf_evsel__check_attr(struct evsel *evsel, "selected. Hence, no address to lookup the source line number.\n"); return -EINVAL; } - if (PRINT_FIELD(BRSTACKINSN) && + if (PRINT_FIELD(BRSTACKINSN) && !allow_user_set && !(perf_evlist__combined_branch_type(session->evlist) & PERF_SAMPLE_BRANCH_ANY)) { pr_err("Display of branch stack assembler requested, but non all-branch filter set\n" -- 2.20.1