Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11792740pjo; Thu, 2 Jan 2020 14:22:13 -0800 (PST) X-Google-Smtp-Source: APXvYqzxaHIflzmgVTg+4Uc1O2B4WZR0uSvQCZsUc2RnRiObIr/HOHDs16G53Zd+euT+fKYNwO8l X-Received: by 2002:a05:6830:1bda:: with SMTP id v26mr91104031ota.314.1578003733054; Thu, 02 Jan 2020 14:22:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003733; cv=none; d=google.com; s=arc-20160816; b=rYPXNA73kD2MqeRO3kVciydG7eCHDJ2eGXUhIB4fEgHqqfYdrYpcNjr+05bdjvlG45 rDY/DYXl6uf0A/CFudAvrTIXFHk62xTZVieEy1tBoxFwUZdIxYCmWyRL0QLMLxDp7Khn zb+xc/Yhg7pJTdveg8WKxrwFVx+fxhkRI9SknnVGKcipmq5jaRiA/GL1m46EcaZRmKtk SzcQp5tsa4J6uG+gXiKX41gCr0Lq7eRCKNH5Y9/BwE9sLZsg0pvKakRKGAxpN2V6bC7u zpqSGUeYkQX3N47afN29NmhM9Wy5CLDRc8sZFIRQhS/WlvMdLrhqQOs0yNvy5ZlSx2iX TL6w== 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=/Rw8rzilZ1/bm5myyd3qzWn2EQH8dYstnmILHXHZ5sI=; b=ZYxF0w+Ufi9jPXqmwNkbVHpjOY+jOZg9X3wQgb7EZqFPRcaJJ3XWuzgIganwLvsR/C BOfICbVTk6DBgfHlSSLophmU+BPzc9G8iYKRRttrV4+hYHuaRvfos0Tv4timM1alpaWC wWuOR/Q7B/VAvqWopczSSQWu4yhVhw1vTKgS0LhPSvl1rW+29V/CcUVmhFttpTPgcvyH w/3Nk7RQJyCsF9yQpBnieZHKtqTg2FPodS5nR3QEpFvzvv3bz+l3HGufELuhriWcc2i7 cXia6tOkewLVbv8Otj5binlse6ZSJ4E0fbunPFXcqD3Y89Bk7kL3ypZ3imL+vdltE2qw SrKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XZbjoDoG; 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 w1si26520317oia.169.2020.01.02.14.22.00; Thu, 02 Jan 2020 14:22:13 -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=XZbjoDoG; 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 S1728949AbgABWVJ (ORCPT + 99 others); Thu, 2 Jan 2020 17:21:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:39684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728943AbgABWVH (ORCPT ); Thu, 2 Jan 2020 17:21:07 -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 4C06721582; Thu, 2 Jan 2020 22:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003665; bh=bYBlGQ76oF4r5ksCFJzmbgT5wpBN8C0wyZkAm30cKPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XZbjoDoGJW/c3NX1OSvLDeivz3FUpDHTb3B89jLoW4byZg6pbjeQ07DhRWWeAJXGj tBsXEj/DvLRKxzYbaUc+Fci/NgHO8Yayxbr9qSaoqgtcPlvFZznqrXAw2oB1KBrbYb iP3nWo1meJKO5qqFc+0ksFX1YY6/90cwZeb/91Rk= 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 4.19 064/114] perf script: Fix brstackinsn for AUXTRACE Date: Thu, 2 Jan 2020 23:07:16 +0100 Message-Id: <20200102220035.520418674@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@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 a4c78499c838..1200973c77cb 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -428,7 +428,7 @@ static int perf_evsel__check_attr(struct perf_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