Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1226310imm; Tue, 5 Jun 2018 11:00:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKJfuSKAZsfbilFn+WzN3ITEln8XAWA4fByjdENpPANTDFrjARUHomM30bxs0qvKXna0rAY X-Received: by 2002:a17:902:229:: with SMTP id 38-v6mr27643894plc.384.1528221611238; Tue, 05 Jun 2018 11:00:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528221611; cv=none; d=google.com; s=arc-20160816; b=YKOKl30Y6GlNKDvfV5+ve8p3Wg/rFBLeF9vFs0FTa2nzZ+oV/F+iWeje1rG3aAlKNx Z0JKmieBb/vNVkxUhGl+FSZRqKj7gqxbERnGKP5kAqw4DYduXpx/Cs9SC+6KKN9hOjpU tp12kwTwoD/sdmpQFMwQ2kR+N9Irkz6HQggsRAv4oL3KJSxGNzUIdS0A6WNC920RADx0 tqU5/mYfByJN99g69f2jXzIOnQOCSrD0Dx9S5yrSoNXUT2Z2i7/dfpqLUYLdbOPGMsb6 +LCU+/ZWSGUoRafE/KINV8iN7bwhr4l40NaQxWPL2/4f5nExnMPu1lZYOxmUxGjzUxTD m+4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=iEJMjvVFql8+ZKKG4sKPGQvg8qcl3JSxc7NAvNmEUi0=; b=N7wDKOUsMoNyehGhHMHk1LHn9r1kePW/8NE2UatsBVNsg+mCXFS0AbphKi9W6PXySY y4MaJnLzyWqt6wHhXLruhcvEN3Zmj7dMZXlXjhWnu8luFQ7FarElPUKCaPR89m4iWovW oU+MHy54qOnJrUqYg2D62GEBPiMtLObp1hd59jIs5XejrLxBJ7quePLrnT+Gvz9EUmtw 6Sdykl/+0hpwKDkWYP91/WCn+dosNbZTghk0W6u7+EjR+j1kp1e6sTAUQYfE4RxgapUg tbyINRcBe7NCuaWb7ek+S0y5HC16Fd0uHoWw2KcfONtQvdArPKFH7sqjVg9HwMjdEjcB bhUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sQJ06xOQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e88-v6si9446797pfk.198.2018.06.05.10.59.57; Tue, 05 Jun 2018 11:00:11 -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=sQJ06xOQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753013AbeFER7Q (ORCPT + 99 others); Tue, 5 Jun 2018 13:59:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:46348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752732AbeFERwI (ORCPT ); Tue, 5 Jun 2018 13:52:08 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (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 4A0212083B; Tue, 5 Jun 2018 17:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528221127; bh=mhXeHuiQZ8eMsiHAbafXbNqJeLJ3EFLxseTsBMo2ZsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sQJ06xOQy2TIvmVs+eDuuCoNQ6KDYeju0nEj1jX5ysg/Wgi8FtjYYgx8PbqtPsQbR AWNFgQYNsXJmmcxFHhFJfXPDHankGzWZaKVayfUu5xQN6BexjmPVUKTFXpOx/Akv4m +7sKiYVThPxUrVoFr/ktsRfoJzLprRwApOQrcMdk= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , Wang Nan Subject: [PATCH 29/46] perf script: Check if evsel has callchains before trying to use it Date: Tue, 5 Jun 2018 14:50:13 -0300 Message-Id: <20180605175030.32549-30-acme@kernel.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180605175030.32549-1-acme@kernel.org> References: <20180605175030.32549-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo We were checking just if callchain processing was asked for by the user, not if the evsel itself has callchains, and since we can have some evsels with callchains and others without, check that. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-inxl7k49q9f9w1se039fbxuw@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- 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 48e940efb3cb..b3bf35512d21 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -606,7 +606,7 @@ static int perf_sample__fprintf_start(struct perf_sample *sample, if (PRINT_FIELD(COMM)) { if (latency_format) printed += fprintf(fp, "%8.8s ", thread__comm_str(thread)); - else if (PRINT_FIELD(IP) && symbol_conf.use_callchain) + else if (PRINT_FIELD(IP) && evsel__has_callchain(evsel) && symbol_conf.use_callchain) printed += fprintf(fp, "%s ", thread__comm_str(thread)); else printed += fprintf(fp, "%16s ", thread__comm_str(thread)); -- 2.14.3