Received: by 10.223.176.5 with SMTP id f5csp2988139wra; Mon, 5 Feb 2018 13:39:44 -0800 (PST) X-Google-Smtp-Source: AH8x225ZL97iErUN/vMnaDSOcWGQmy+NVP72uA6qAVx0q3TBeLsv7E5+jV25q/qkn6xjfdr9wrru X-Received: by 10.101.65.71 with SMTP id x7mr132616pgp.379.1517866783920; Mon, 05 Feb 2018 13:39:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517866783; cv=none; d=google.com; s=arc-20160816; b=wXiy+NsHxGuej6vrIQyWlmbNqovCowEo6QO1vPiOz/KXfpB3mOstUAx+nbxXI833Ef L4DOFmMEmYI0xOVZa2UnHwO7lbFkAWSeSY0/pS/nUx7a4MsJto95gJv46rDCHxSNXdpK Jg9AZobTbrf5NOj6knEsLaqgcpg19eZEfEl79Xmowiixpf8nNET35M59IQSijeZ0+fBS LU5dNRAZeQlUO5E9aTEEgedYtVgZUTDKqbyZXTuKS0xRCEUV3E60jBjoAPkbqni9DGNo aaXwVxNHx0OKwMnc73Kd83SlhWa2qBWD4WckmqSFSjZBSnNORdNVH90cuzwV/ozzzQRX zlAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=77sUN9XMNiZke0GvYGAC1biJjMoaXIdj90SPkHz0ebY=; b=0z0b94FkEiMNZL5+LDXcHEAljhJNbXgxUYcw27FBbEeOKkOmk4bCUhzFCCjGSNvmrY 8GhNBmSB4qCAxT6jJ870gge3+PP2yabfvOZbDl62PBUyTiSZLgU0WUUFL8qC5J3uV7cG +mQz6i2nYfF1vtaBKmQrvoWFjCvITN6/ag7I+bNFhKK4LyyqNB3n4S0uteQbTAImeDg6 XIBEplS8reqC7BdtevMvgmbNXdvruz5UR+kQpGITfZt88sI9s/VvdhrSE55PCio8P4ZI UDgP9N6O1kZ1B6wskJaZOPH/+vzY3nqNnYraTwK8+0W3Udu5f9bJtloS9/Dm4xv50HPT UbyQ== 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 r5-v6si1227668plo.443.2018.02.05.13.39.29; Mon, 05 Feb 2018 13:39:43 -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; 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 S1752318AbeBEVid (ORCPT + 99 others); Mon, 5 Feb 2018 16:38:33 -0500 Received: from terminus.zytor.com ([65.50.211.136]:33831 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752022AbeBEVi1 (ORCPT ); Mon, 5 Feb 2018 16:38:27 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w15LbIan031664; Mon, 5 Feb 2018 13:37:18 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w15LbHsO031660; Mon, 5 Feb 2018 13:37:17 -0800 Date: Mon, 5 Feb 2018 13:37:17 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Ravi Bangoria Message-ID: Cc: alexander.shishkin@linux.intel.com, ravi.bangoria@linux.vnet.ibm.com, tglx@linutronix.de, jolsa@redhat.com, namhyung@kernel.org, hpa@zytor.com, mingo@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org Reply-To: jolsa@redhat.com, alexander.shishkin@linux.intel.com, ravi.bangoria@linux.vnet.ibm.com, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com, namhyung@kernel.org In-Reply-To: <20180130053053.13214-3-ravi.bangoria@linux.vnet.ibm.com> References: <20180130053053.13214-3-ravi.bangoria@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf trace: Fix call-graph output Git-Commit-ID: 3a9e9a47092e302f3c75ababebfc16e196400a93 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 3a9e9a47092e302f3c75ababebfc16e196400a93 Gitweb: https://git.kernel.org/tip/3a9e9a47092e302f3c75ababebfc16e196400a93 Author: Ravi Bangoria AuthorDate: Tue, 30 Jan 2018 11:00:53 +0530 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 5 Feb 2018 13:53:45 -0300 perf trace: Fix call-graph output Recently, Arnaldo fixed global vs event specific --max-stack usage with commit bd3dda9ab0fb ("perf trace: Allow overriding global --max-stack per event"). This commit is having a regression when we don't use --max-stack at all with perf trace. Ex, $ ./perf trace record -g ls $ ./perf trace -i perf.data 0.076 ( 0.002 ms): ls/9109 brk( 0.196 ( 0.008 ms): ls/9109 access(filename: 0x9f998b70, mode: R 0.209 ( 0.031 ms): ls/9109 open(filename: 0x9f998978, flags: CLOEXEC This is missing call-traces. After patch: $ ./perf trace -i perf.data 0.076 ( 0.002 ms): ls/9109 brk( do_syscall_trace_leave ([kernel.kallsyms]) [0] ([unknown]) syscall_exit_work ([kernel.kallsyms]) brk (/usr/lib64/ld-2.17.so) _dl_sysdep_start (/usr/lib64/ld-2.17.so) _dl_start_final (/usr/lib64/ld-2.17.so) _dl_start (/usr/lib64/ld-2.17.so) _start (/usr/lib64/ld-2.17.so) 0.196 ( 0.008 ms): ls/9109 access(filename: 0x9f998b70, mode: R do_syscall_trace_leave ([kernel.kallsyms]) [0] ([unknown]) Signed-off-by: Ravi Bangoria Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Fixes: bd3dda9ab0fb ("perf trace: Allow overriding global --max-stack per event") Link: http://lkml.kernel.org/r/20180130053053.13214-3-ravi.bangoria@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-trace.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 17d11de..e7f1b18 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -1661,9 +1661,12 @@ static int trace__resolve_callchain(struct trace *trace, struct perf_evsel *evse struct callchain_cursor *cursor) { struct addr_location al; + int max_stack = evsel->attr.sample_max_stack ? + evsel->attr.sample_max_stack : + trace->max_stack; if (machine__resolve(trace->host, &al, sample) < 0 || - thread__resolve_callchain(al.thread, cursor, evsel, sample, NULL, NULL, evsel->attr.sample_max_stack)) + thread__resolve_callchain(al.thread, cursor, evsel, sample, NULL, NULL, max_stack)) return -1; return 0;