From patchwork Thu Jun 8 08:44:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Savkov X-Patchwork-Id: 104871 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp136572vqr; Thu, 8 Jun 2023 01:55:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6WHIWuTnSFXvijmtN35T6twlFBV1cMsR/w6z/MLKW5rNOaqzj4X0tmESKS7Hv8LIYTmEV6 X-Received: by 2002:a17:902:efd1:b0:1b2:1b20:c45b with SMTP id ja17-20020a170902efd100b001b21b20c45bmr4863775plb.54.1686214552146; Thu, 08 Jun 2023 01:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686214552; cv=none; d=google.com; s=arc-20160816; b=IUlMdttTOreIVbEaC+tSA46fH6qUJ2gBBsTPuiM2pK58noOWhUEs5XsNxD08OQBiBO hGp/bIi5tL/dzAm21/bX0/6MrfyqvKT7xKtlH4wwYuxn2t2RtOqz6N+Zc7a8LCnkHBpR Cok/lWsI6d+CgCU7FLpQEJ39KeAEQeD9h9+/5pFLWJE35wXEZzTf3bPZTkWZ1bLOBSsS RdMA1IqX/V/vgP78eqaE1i3T1VP9kA/sGW/We4dgvmuDblJvTuQ8ckI1AcuKjsdVh7m2 l1suGfS/DIA0n6G0fohNPM0vnPNiToM4hNNp7+As40atDygiKsQ+vCnNFZlGbJe4gbPb pZuA== 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 :dkim-signature; bh=3gAyEuwafL/hxITBiKfoUbav1sLZb6lLFuGPfJnHhTI=; b=VRnLZctpXqsyS9LOWl/t2kBovIWjrxWsm/dVSGJeC3t3tL/OkTbyul8R7U4if3llmL 65mLbyaBbSv4Hw2QCCELNB3vJXTAoBDkQgdYKm3XI3ThUwWm0bsVCMJ+KT/s1z4RaDzb EltpRFGENDjNpkTSFPneXQ8olC4sUmafLXSt3ZY+pDgP15OBKyTfHKfy/5TkX1RbJhSm NP87PALndQog8ZZYCQXYNyPODt9YUCwuJvg0TPcQjg3kxXMfWQ2N2bK+7yhGMDIEQwGE nQA9NfvWhtxO0gW34ZXw4mm3vo4gfXsJNWqd4mW3T4ze0AH1yh4q6mSBpKXXpBHYgwpk ekzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EJff4ujy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f18-20020a170902ce9200b001b0347b904csi794306plg.275.2023.06.08.01.55.37; Thu, 08 Jun 2023 01:55:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EJff4ujy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235631AbjFHIpT (ORCPT + 99 others); Thu, 8 Jun 2023 04:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235565AbjFHIpN (ORCPT ); Thu, 8 Jun 2023 04:45:13 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4494026B2 for ; Thu, 8 Jun 2023 01:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686213864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3gAyEuwafL/hxITBiKfoUbav1sLZb6lLFuGPfJnHhTI=; b=EJff4ujyXLTVtUMLSTjN4jlMZOp2ue8wzqMMB6HihZQOODDCUEhkucmyKjR+833xSPiMQo O5Uep+NcGwl8ZYkfAmM+0VYFUvG+smtJrwqs+6LTWbJ9AzGsJG14XC8x2SFQ/zSEDHnJeM 6gd/sbcTz0awjOZMDQdMH/1wFM9xUaM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-516-cx6GekNUMTCtxgoAxaBUuw-1; Thu, 08 Jun 2023 04:44:23 -0400 X-MC-Unique: cx6GekNUMTCtxgoAxaBUuw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 49D738037AD; Thu, 8 Jun 2023 08:44:22 +0000 (UTC) Received: from samus.usersys.redhat.com (unknown [10.43.17.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACC9340CFD46; Thu, 8 Jun 2023 08:44:20 +0000 (UTC) From: Artem Savkov To: linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Namhyung Kim Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , linux-kernel@vger.kernel.org, Artem Savkov Subject: [PATCH v2 1/2] perf util: move symbol__new_unresolved() to util/symbol.c Date: Thu, 8 Jun 2023 10:44:06 +0200 Message-Id: <20230608084407.140323-2-asavkov@redhat.com> In-Reply-To: <20230608084407.140323-1-asavkov@redhat.com> References: <20230608084407.140323-1-asavkov@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768124110361958662?= X-GMAIL-MSGID: =?utf-8?q?1768124110361958662?= Make symbol__new_unresolved() available through util/symbol.h so it can be later used from builtin-c2c. Signed-off-by: Artem Savkov --- tools/perf/ui/browsers/hists.c | 22 ---------------------- tools/perf/util/symbol.c | 22 ++++++++++++++++++++++ tools/perf/util/symbol.h | 1 + 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 69c81759a64f9..10d2243d27504 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -2471,28 +2471,6 @@ do_annotate(struct hist_browser *browser, struct popup_action *act) return 0; } -static struct symbol *symbol__new_unresolved(u64 addr, struct map *map) -{ - struct annotated_source *src; - struct symbol *sym; - char name[64]; - - snprintf(name, sizeof(name), "%.*" PRIx64, BITS_PER_LONG / 4, addr); - - sym = symbol__new(addr, ANNOTATION_DUMMY_LEN, 0, 0, name); - if (sym) { - src = symbol__hists(sym, 1); - if (!src) { - symbol__delete(sym); - return NULL; - } - - dso__insert_symbol(map__dso(map), sym); - } - - return sym; -} - static int add_annotate_opt(struct hist_browser *browser __maybe_unused, struct popup_action *act, char **optstr, diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 6b9c55784b56a..297a903f72777 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -294,6 +294,28 @@ void maps__fixup_end(struct maps *maps) up_write(maps__lock(maps)); } +struct symbol *symbol__new_unresolved(u64 addr, struct map *map) +{ + struct annotated_source *src; + struct symbol *sym; + char name[64]; + + snprintf(name, sizeof(name), "%.*" PRIx64, BITS_PER_LONG / 4, addr); + + sym = symbol__new(addr, ANNOTATION_DUMMY_LEN, 0, 0, name); + if (sym) { + src = symbol__hists(sym, 1); + if (!src) { + symbol__delete(sym); + return NULL; + } + + dso__insert_symbol(map__dso(map), sym); + } + + return sym; +} + struct symbol *symbol__new(u64 start, u64 len, u8 binding, u8 type, const char *name) { size_t namelen = strlen(name) + 1; diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 7558735543c25..4d47748716627 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -176,6 +176,7 @@ void symbol__exit(void); void symbol__elf_init(void); int symbol__annotation_init(void); +struct symbol *symbol__new_unresolved(u64 addr, struct map *map); struct symbol *symbol__new(u64 start, u64 len, u8 binding, u8 type, const char *name); size_t __symbol__fprintf_symname_offs(const struct symbol *sym, const struct addr_location *al, From patchwork Thu Jun 8 08:44:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Savkov X-Patchwork-Id: 104870 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp136208vqr; Thu, 8 Jun 2023 01:54:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6dHYSKDOEB3M2le5ptPitETlLw4M8gjBpV5TRdDQHllQ25uqNS0khadEi8Uv6R7aJZ/zaM X-Received: by 2002:a17:902:7b8c:b0:1a1:f5dd:2dce with SMTP id w12-20020a1709027b8c00b001a1f5dd2dcemr7533750pll.6.1686214493661; Thu, 08 Jun 2023 01:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686214493; cv=none; d=google.com; s=arc-20160816; b=lWz0albmW9s26cTkl+AkQ0NUzFT43JPvN9axTfZz0VD6/lCPWXv0lkvPIAQmG2w48Q lW5vCIXGUlLGv75rleYx6czTS1vJ9BEycVfgU4OnFI0JcZQifFXYKUhu9ViErxYgyQ3k SrqitCGG1hNZhxRuEvc1eE19M47dz1bMyVhWZLn8+PLay2UBkNjGPEOP+nXsinKin8xG Izw8evCUEM6773ApNX9leB5ziHw7pmRSjfKCfZUjz5PBZIwNAYGWGE3ut0sxXNqdc/BG /UlhT/86itoxSGEu2wTG0hp+gMes0q83/tYFHjUJOEYvYKCUl/CsY6TPXbKoCrYA6y8w isXQ== 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 :dkim-signature; bh=XnU7vO/Lef60I/awCgl/js8i+Cy2VjkJQlcit7aefu0=; b=K1lxgrCO1298juK08jskvTUm67UdsB23FSmUKk9KF7negXKTn2xQlWsoUGaEVqmEYQ r9G48Ny0oBMIadTyXXs3bjnrEnwroPEAzgEJ3zRx32zIvEF7218YvX6/RfVumrfjnA6X wv20kKi1hXRZei1eObPIAEVzLDhrX22IirGhjWBPT5yDRgo+OrhBtq0drSQlKMARRruS GczAPar1F4aLwUkaUI/Bw4ywKfmIqQqciJpEwLbizspkDdH5XCckVKytKop+HJ1JNj7C i79jbCOQ5z9GbWP7oXDombSELt3TyglCcNK9TmGkI+GqdmEGnwFDn1xO6RvLHljErCmz AJ2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K8BA0uSw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kh4-20020a170903064400b001b03e2c53afsi769232plb.24.2023.06.08.01.54.40; Thu, 08 Jun 2023 01:54:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K8BA0uSw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235589AbjFHIp3 (ORCPT + 99 others); Thu, 8 Jun 2023 04:45:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235309AbjFHIpP (ORCPT ); Thu, 8 Jun 2023 04:45:15 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C257F2722 for ; Thu, 8 Jun 2023 01:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686213870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XnU7vO/Lef60I/awCgl/js8i+Cy2VjkJQlcit7aefu0=; b=K8BA0uSwXJ1nGRMauF2Cn0PbZu0kMmTe187IIVVlWTsE+V7Y99VJQurCbhKNiZJoPpdk0/ b/lUjCDE6SBEDIbDdS5pzVe/JFyD3ayzdxLqxaNtILYgLCNwcK8tDRSpBWjERchVvA6ws6 gyY0YuBEMdU3vWGua8RJTQ+4EvgmD0Y= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-D11iVY6IP12GX1ipyT5aEQ-1; Thu, 08 Jun 2023 04:44:24 -0400 X-MC-Unique: D11iVY6IP12GX1ipyT5aEQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1F361811E7F; Thu, 8 Jun 2023 08:44:24 +0000 (UTC) Received: from samus.usersys.redhat.com (unknown [10.43.17.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82E9E40CFD46; Thu, 8 Jun 2023 08:44:22 +0000 (UTC) From: Artem Savkov To: linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Namhyung Kim Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , linux-kernel@vger.kernel.org, Artem Savkov Subject: [PATCH v2 2/2] perf tools: allow running annotation browser from c2c-report Date: Thu, 8 Jun 2023 10:44:07 +0200 Message-Id: <20230608084407.140323-3-asavkov@redhat.com> In-Reply-To: <20230608084407.140323-1-asavkov@redhat.com> References: <20230608084407.140323-1-asavkov@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768124048870659570?= X-GMAIL-MSGID: =?utf-8?q?1768124048870659570?= Add a shortcut to run annotation browser for selected symbol from c2c report TUI. Signed-off-by: Artem Savkov --- tools/perf/builtin-c2c.c | 73 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 05dfd98af170b..dce8604837aec 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -24,6 +24,7 @@ #include #include #include +#include "map.h" #include "map_symbol.h" #include "mem-events.h" #include "session.h" @@ -43,6 +44,8 @@ #include "ui/progress.h" #include "pmus.h" #include "string2.h" +#include "util/annotate.h" +#include "util/dso.h" #include "util/util.h" struct c2c_hists { @@ -111,6 +114,9 @@ struct perf_c2c { char *cl_sort; char *cl_resort; char *cl_output; + + struct evlist *evlist; + struct annotation_options annotation_opts; }; enum { @@ -327,6 +333,9 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused, c2c_he__set_node(c2c_he, sample); hists__inc_nr_samples(&c2c_hists->hists, he->filtered); + if (use_browser == 1 && al.map != NULL && al.sym != NULL) + hist_entry__inc_addr_samples(he, sample, evsel, al.addr); + ret = hist_entry__append_callchain(he, sample); if (!ret) { @@ -364,6 +373,9 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused, c2c_he__set_node(c2c_he, sample); hists__inc_nr_samples(&c2c_hists->hists, he->filtered); + if (use_browser == 1 && al.map != NULL && al.sym != NULL) + hist_entry__inc_addr_samples(he, sample, evsel, al.addr); + ret = hist_entry__append_callchain(he, sample); } @@ -2612,6 +2624,43 @@ c2c_cacheline_browser__new(struct hists *hists, struct hist_entry *he) return browser; } +static void do_annotate(struct hist_browser *browser, struct evsel *evsel) { + struct map_symbol ms = { NULL, NULL, NULL }; + + if (!browser->selection || + !browser->selection->map || + !browser->selection->map->dso || + browser->selection->map->dso->annotate_warned) { + return; + } + + ms.map = browser->selection->map; + + if (!browser->selection->sym) { + if (!browser->he_selection) + return; + + ms.sym = symbol__new_unresolved(browser->he_selection->ip, + browser->selection->map); + + if (!ms.sym) + return; + } else { + if (symbol__annotation(browser->selection->sym)->src == NULL) { + ui_browser__warning(&browser->b, 0, + "No samples for the \"%s\" symbol.\n\n", + browser->selection->sym->name); + return; + } + ms.sym = browser->selection->sym; + } + + map_symbol__tui_annotate(&ms, evsel, browser->hbt, &c2c.annotation_opts); + + ui_browser__update_nr_entries(&browser->b, browser->hists->nr_entries); + ui_browser__handle_resize(&browser->b); +} + static int perf_c2c__browse_cacheline(struct hist_entry *he) { struct c2c_hist_entry *c2c_he; @@ -2621,6 +2670,7 @@ static int perf_c2c__browse_cacheline(struct hist_entry *he) int key = -1; static const char help[] = " ENTER Toggle callchains (if present) \n" + " a Annotate current symbol\n" " n Toggle Node details info \n" " s Toggle full length of symbol and source line columns \n" " q Return back to cacheline list \n"; @@ -2650,6 +2700,9 @@ static int perf_c2c__browse_cacheline(struct hist_entry *he) key = hist_browser__run(browser, "? - help", true, 0); switch (key) { + case 'a': + do_annotate(browser, evlist__first(c2c.evlist)); + break; case 's': c2c.symbol_full = !c2c.symbol_full; break; @@ -3045,6 +3098,10 @@ static int perf_c2c__report(int argc, const char **argv) int err = 0; const char *output_str, *sort_str = NULL; + annotation_options__init(&c2c.annotation_opts); + + hists__init(); + argc = parse_options(argc, argv, options, report_c2c_usage, PARSE_OPT_STOP_AT_NON_OPTION); if (argc) @@ -3118,6 +3175,16 @@ static int perf_c2c__report(int argc, const char **argv) if (err) goto out_mem2node; + c2c.evlist = session->evlist; + + if (c2c.use_stdio) { + use_browser = 0; + } else { + use_browser = 1; + symbol__annotation_init(); + annotation_config__init(&c2c.annotation_opts); + } + if (symbol__init(&session->header.env) < 0) goto out_mem2node; @@ -3127,11 +3194,6 @@ static int perf_c2c__report(int argc, const char **argv) goto out_mem2node; } - if (c2c.use_stdio) - use_browser = 0; - else - use_browser = 1; - setup_browser(false); err = perf_session__process_events(session); @@ -3202,6 +3264,7 @@ static int perf_c2c__report(int argc, const char **argv) out_session: perf_session__delete(session); out: + annotation_options__exit(&c2c.annotation_opts); return err; }