Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp839295ybi; Fri, 12 Jul 2019 05:30:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhaaUmkF6eIILU5ZlANW0nsRHpRFUiSLy/7o1cax4NAxOG16vcl4gwnCYx+pONkN/xWtNo X-Received: by 2002:a17:902:2f84:: with SMTP id t4mr5632230plb.57.1562934647968; Fri, 12 Jul 2019 05:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934647; cv=none; d=google.com; s=arc-20160816; b=Z2MCteQxHXTTuooJvZvX+3AnV1PL1Ubiyt4Unt3uzXLTwQyT2vLzJteh/iXuF3o7nB ipOPmcawH1w+mda12zrOB6rSh08gSatJgWeHatG+y/qiYFHKNblkpt2z6xTcZH+y0SnD emgDnkVZ1UvFGkPmxaTYo+tQ2hqwAIc8vciSC3O4D6taFYFrBr+mqOjkyvhG5m4YXwSx kpKxFLggK8pc/lxWnr0at9e87IjmucWMm3n2OAu2FoSbmzjeHFOJAO4vpit9hBjVubF0 6SJI9f8ds/ZI8ms57QmM/C3URb2sWF6bD0+IViv9qN4hQEOirs65aurB80VuHJcWIC+z 2KUQ== 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=+DsCy+Y3q5tjRdZvofItYUZ9H0oN38n2Qr/A4qzvFpI=; b=JRC8OZMlgVFTTC/i3V74RYdbdUwV50pUmRbfqTTjf8ScbasHIP/z+Eq2Jup/dKTTn7 y6nopt43YwC1fNClwoQ6f26ckoradn5fiMuLw6vSAjjh1amhFCLZmPzilbQ5wzhV343i nxEHNWPRbBRymmSgeeBOBb0JcF2OpRqCUmjgKzI1KfFMYSghK259I6WMCLSvKFFXy9SI Ahg49NrBrCnwTU7ZOqQFQphzxgMAxqtnSsMX8GBluXFscI/U9m3Vm0tPaHOBsOetRbiY 3R/essLWVoJSzDs8qFsGP8EIdCE1camAG0JKpkfTg+KY7+kQYDTxlCz6jRTGc2ZtVyb6 ZlAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IasJ+ymD; 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 q8si7729873pjp.61.2019.07.12.05.30.32; Fri, 12 Jul 2019 05:30:47 -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; dkim=pass header.i=@kernel.org header.s=default header.b=IasJ+ymD; 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 S1728647AbfGLM31 (ORCPT + 99 others); Fri, 12 Jul 2019 08:29:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:44226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728965AbfGLM3X (ORCPT ); Fri, 12 Jul 2019 08:29:23 -0400 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 B93122084B; Fri, 12 Jul 2019 12:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934562; bh=D2VTrJzb/FdnbhX7hxtC5ANEV/bOOI1BLQ+Fkr1aGJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IasJ+ymDf6+ZTtbAO1eVgJ/g5bzyK098U0JaMQi7lIi66Dk01jaw/dm+htRYU4gs9 2nimu5G1SdEvapBqjq0NofksqQr/V65RJ0GLNFBluT4mTGS77hjmTELNHuL9dyu1/S UXj2LCbTp34Ngt7BIKOZkQuyt6EL6rQLAn6u9Br8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Arnaldo Carvalho de Melo , Jiri Olsa Subject: [PATCH 5.1 096/138] perf intel-pt: Fix itrace defaults for perf script Date: Fri, 12 Jul 2019 14:19:20 +0200 Message-Id: <20190712121632.448053537@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@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 commit 26f19c2eb7e54015564ff133b91983a74e84541b upstream. Commit 4eb068157121 ("perf script: Make itrace script default to all calls") does not work because 'use_browser' is being used to determine whether to default to periodic sampling (i.e. better for perf report). The result is that nothing but CBR events display for perf script when no --itrace option is specified. Fix by using 'default_no_sample' and 'inject' instead. Example: Before: $ perf record -e intel_pt/cyc/u ls $ perf script > cmp1.txt $ perf script --itrace=cepwx > cmp2.txt $ diff -sq cmp1.txt cmp2.txt Files cmp1.txt and cmp2.txt differ After: $ perf script > cmp1.txt $ perf script --itrace=cepwx > cmp2.txt $ diff -sq cmp1.txt cmp2.txt Files cmp1.txt and cmp2.txt are identical Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: stable@vger.kernel.org # v4.20+ Fixes: 90e457f7be08 ("perf tools: Add Intel PT support") Link: http://lkml.kernel.org/r/20190520113728.14389-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/intel-pt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -2588,7 +2588,8 @@ int intel_pt_process_auxtrace_info(union } else { itrace_synth_opts__set_default(&pt->synth_opts, session->itrace_synth_opts->default_no_sample); - if (use_browser != -1) { + if (!session->itrace_synth_opts->default_no_sample && + !session->itrace_synth_opts->inject) { pt->synth_opts.branches = false; pt->synth_opts.callchain = true; }