Received: by 10.223.176.5 with SMTP id f5csp3865466wra; Mon, 29 Jan 2018 21:30:23 -0800 (PST) X-Google-Smtp-Source: AH8x225DNHPQ/y1OFVspi1V7x4HGHErpOSWha4vgJ79Q5YlLXOkJnoxRaSGJ3MXb1srmLy8uz+UC X-Received: by 2002:a17:902:2bc5:: with SMTP id l63-v6mr17070074plb.108.1517290223196; Mon, 29 Jan 2018 21:30:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517290223; cv=none; d=google.com; s=arc-20160816; b=U1+M+oEIj9098uzloLnmyLXgLGn18vD6VW5h03BgQw/WuM5k/e0Cfxq2gcCe9IaGsh jZC0hr25WhbkrvCtc655dACKu7525f/Z3iJDG5cEpl2Ov9f/AT7bAqEG/+SQZQNeCQGJ 00U1VvdOuQ2seQYMB7GkAI168u1ZwoIaeaVAbiy4VdUe8KxLRYdnY9Da150KsWH6rajE tT3HF7Gpgr8vZiSQHnT9TJmBCsz/IpBRiCloDdkjXAWkvp+o+D+N7Z2eunnTGATmZ7c5 d6wi87q4wvpp+nE3wQ8b2UeMLHFyJv1EGnjQfH9erq/XEOy847h+WsyXutAXaKj/xfnE 79gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=+QuUiK3rXEcgJ737C5/JEigOpNXIYSlIsQWGVFKlAcE=; b=mc3uTUoBi51FKjoVnV222EdHDuwV0KVHvXdgfaqBq+fRtNhrqV9Kg5/xCVhnHn40Uc JVvjm9zOVUoPSmABE76Hvac0syaaxp+7xh+P2w7gcOv25KhFoPk4NjeL4UqMVJqnHbLR 112WQ7FMo+Iys1au/L963HVZxKo1Xl2Ggdy6wnIjzsaqSZrn5biZ1Q++t7WpuMTrJroJ bS5zahUMYTLA9dsw31lsdtO6OPu4taH7eBYombYTI3RLkuh1U2ZVKy8KkFun1S3DcyKn Jnz/mNgyPoRCSk4+hlY5CJfM6vre5U30NZLAh1ZDimDZCwJ/jJ6De2S8jypb0i0A3fBE lPyQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n2si8533662pgq.169.2018.01.29.21.30.08; Mon, 29 Jan 2018 21:30:23 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752827AbeA3F3e (ORCPT + 99 others); Tue, 30 Jan 2018 00:29:34 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50238 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752809AbeA3F30 (ORCPT ); Tue, 30 Jan 2018 00:29:26 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0U5SjvG040881 for ; Tue, 30 Jan 2018 00:29:25 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ftjfag8wn-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 30 Jan 2018 00:29:25 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 30 Jan 2018 05:29:23 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 30 Jan 2018 05:29:20 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0U5TKWU37355626; Tue, 30 Jan 2018 05:29:20 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0E2D752041; Tue, 30 Jan 2018 04:21:37 +0000 (GMT) Received: from bangoria.in.ibm.com (unknown [9.124.31.69]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id F0D3B52043; Tue, 30 Jan 2018 04:21:35 +0000 (GMT) From: Ravi Bangoria To: acme@kernel.org Cc: alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, Ravi Bangoria Subject: [PATCH 2/2] perf trace: Fix call-graph output Date: Tue, 30 Jan 2018 11:00:53 +0530 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180130053053.13214-1-ravi.bangoria@linux.vnet.ibm.com> References: <20180130053053.13214-1-ravi.bangoria@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18013005-0016-0000-0000-0000051D43EA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18013005-0017-0000-0000-00002859DEBB Message-Id: <20180130053053.13214-3-ravi.bangoria@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-30_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801300071 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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]) Fixes: bd3dda9ab0fb ("perf trace: Allow overriding global --max-stack per event") Signed-off-by: Ravi Bangoria --- 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..e90f5c3 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; -- 1.8.3.1