Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6216600pxv; Thu, 29 Jul 2021 09:04:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGrZlVRTcMKrFDtnJlGBEpnBqqONcr+QQAwC/Z467fIeJ2NnAeoyyr4liiBWhd1lS0e6G+ X-Received: by 2002:adf:fc0d:: with SMTP id i13mr5450959wrr.276.1627574698134; Thu, 29 Jul 2021 09:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627574698; cv=none; d=google.com; s=arc-20160816; b=SX4WkzSJHnN414TIkczgxTqhHrvbP4v4rrTemhmEaM4eQxeuPeh3Opd6AoX1qJm0Z4 kUzVzBMN5SdKrBw8NBAhwSLCoZqBKPFKK9u5jdRJ/ii2qY2SdeC/ig4iscHGmNl8Utk7 qlHz//GZt1LJ0+DDNZbVyXGldgwdPmJV6xp2YlMRushwnHDl2FAZ+dKmE6CpHnKMMGvI l72cVE9lkQmicw0TW9GTZ+fzZ7lXrYikDGSSIjbsL7rpzGJzmbz8DqSAQd9xMRs4pa7r ba9pRCM1zBDO8mCyc+8QeNK0M/2c/kRyOCSCpYzuee37JIx3wISAcJEw5xsGdppwf+Qn FsFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=IEySo3AAd01obRrkQHwYYmr59vkZaT76SeVPMWWH0ho=; b=tpHJrQq1+Pw6lQQCSuVLZkgUvd5HPFG9wH3PaRa1/PGbyE2pOxFEfX4BEQ0lla1hcB 1r/RARrChgbwAETLfqhu0sAKOb6hOH037n+TJ37N8jCvq707Xhv6OoWa2qDhhxnOpX7e jCwjJ5hdxwfTclKp2uJg/lrtl13nVx+ps7JfexgE81Y7aRjfnwzWJULdoH+Ymg03SK3d asKrR9FgeSIXgUJFyu2Tav/nPDOFAj57hDZYOzdW5epN3ZQAzcvIExynniKgy/EjeDFV 5kSHeyxi93oRZ/KBpipbVMpcqtItRJGSNQoxxjDtaRs+zz5SD17wUh1EoGPiqo6GDZ46 sNzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i1si3053810edq.390.2021.07.29.09.04.32; Thu, 29 Jul 2021 09:04:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238366AbhG2QA1 (ORCPT + 99 others); Thu, 29 Jul 2021 12:00:27 -0400 Received: from foss.arm.com ([217.140.110.172]:51362 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238179AbhG2P66 (ORCPT ); Thu, 29 Jul 2021 11:58:58 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9F3091063; Thu, 29 Jul 2021 08:58:54 -0700 (PDT) Received: from e121896.arm.com (unknown [10.57.40.10]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 483A93F73D; Thu, 29 Jul 2021 08:58:52 -0700 (PDT) From: James Clark To: acme@kernel.org, mathieu.poirier@linaro.org, coresight@lists.linaro.org, linux-perf-users@vger.kernel.org Cc: leo.yan@linaro.org, suzuki.poulose@arm.com, mike.leach@linaro.org, James Clark , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , John Garry , Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 3/6] perf tools: Add disassembly warnings for annotate --stdio Date: Thu, 29 Jul 2021 16:58:02 +0100 Message-Id: <20210729155805.2830-4-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210729155805.2830-1-james.clark@arm.com> References: <20210729155805.2830-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently 'perf annotate --stdio' (and --stdio2) will exit without printing anything if there are disassembly errors. Apply the same error handler that's used for TUI and GTK modes. This makes comparing disassembly across the different modes more consistent. Signed-off-by: James Clark --- tools/perf/util/annotate.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index aa04a3655236..1ed097bcb78a 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -2787,9 +2787,17 @@ int symbol__tty_annotate2(struct map_symbol *ms, struct evsel *evsel, struct rb_root source_line = RB_ROOT; struct hists *hists = evsel__hists(evsel); char buf[1024]; + int err; + + err = symbol__annotate2(ms, evsel, opts, NULL); + if (err) { + char msg[BUFSIZ]; - if (symbol__annotate2(ms, evsel, opts, NULL) < 0) + dso->annotate_warned = true; + symbol__strerror_disassemble(ms, err, msg, sizeof(msg)); + ui__error("Couldn't annotate %s:\n%s", sym->name, msg); return -1; + } if (opts->print_lines) { srcline_full_filename = opts->full_path; @@ -2813,9 +2821,17 @@ int symbol__tty_annotate(struct map_symbol *ms, struct evsel *evsel, struct dso *dso = ms->map->dso; struct symbol *sym = ms->sym; struct rb_root source_line = RB_ROOT; + int err; + + err = symbol__annotate(ms, evsel, opts, NULL); + if (err) { + char msg[BUFSIZ]; - if (symbol__annotate(ms, evsel, opts, NULL) < 0) + dso->annotate_warned = true; + symbol__strerror_disassemble(ms, err, msg, sizeof(msg)); + ui__error("Couldn't annotate %s:\n%s", sym->name, msg); return -1; + } symbol__calc_percent(sym, evsel); -- 2.28.0