Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp159272lqg; Wed, 10 Apr 2024 20:35:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsMpbktCyxH+hlTrzc3RFMFwYZdaAtRIeE2umNu7g2WO7sAzdri+7OJlB2O50/IxbRuQ5SheHS0d/am6b9iSjWsqct+Xd+W/pMFcsY2w== X-Google-Smtp-Source: AGHT+IHd+kRioH6vSwsFtLeUCAl8F0ma7jyVdSr98lq5DRkFnY3Cp6WRELEolEJH4TOln4RjdL4y X-Received: by 2002:a05:6a20:8407:b0:1a8:e7ac:1165 with SMTP id c7-20020a056a20840700b001a8e7ac1165mr5114561pzd.45.1712806519374; Wed, 10 Apr 2024 20:35:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712806519; cv=pass; d=google.com; s=arc-20160816; b=Y3sxzYEZ0Uol7mIOjJcLCrEIiViWzPtXZleGUogWI6od/EpAopu4b5Gwc6Yhf/d8kb k1dfrFuNzLFEbN25kl7Eh1yMBQqEWqJqnpweW451C9xYGSTvo1UkpcEtdDhQmgHHUZbb GNeNJBjf0I6+GkOS36kahhpucLsm/WuMevjFZRr6z+Q/hjfL0uczluhWDSayB5nQgpo3 YpnH3/cu5vDE2RY7wa/8nDV9UR+tcQQkJ4tXx7S+qtWchy0PdKoYAx9u36OyW3X3ZV+6 SCyzC3gLL+XYf/OKYgK8lyai3p7jMuC0EP8xl17if2D3CQHPhwY02jxyUQuJVZSHf7MU 7Cfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vanx+kZEqf8x/eUTyEFA4/9XTenFBjfRxwYTcwLzr4o=; fh=fHhbvXgCev/wpffLVpfaAi8pPyv7hrTyhVPgsZ7HNrs=; b=aib9SdGvIlKtVMdsitwoV88U5A7TnWW9N5QA7ef4qrJDv5OcNbtVzJmB6NsSQ8bZRD pU8cuI/KdKv+2f22TaLXGX43b/TkPokifK/cuKOLUez/xCxP70Gc4ACo1ucN46K9+If6 N6jRyYsYZq5/RAJPdm3L8R7KpBvyvncWsvE9TTU68bgIY4KlXuiFw/KvrVH2sjmRDMz0 AeUgVl3mdAusl+hGrGiL9ibfS2UAI4P4uH/7sHiGON682C2zOVWaRrCG0dBo/8TTG2x1 NMkAARdXu3L0AYqD1cLDr5wtZ75UkvhtxFls1Uq7lVSo3WsrMTv/JFimPlL65kWeE+jR PVVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PSJ6lXHS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139720-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139720-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b7-20020a170903228700b001e0bcccc806si459149plh.441.2024.04.10.20.35.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 20:35:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139720-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PSJ6lXHS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139720-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139720-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A225A284DD3 for ; Thu, 11 Apr 2024 03:34:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B803413C3D3; Thu, 11 Apr 2024 03:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PSJ6lXHS" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D31E113C3D0; Thu, 11 Apr 2024 03:33:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712806381; cv=none; b=oK6Tg+Mlb+GruNZWGp2mbSrgWeq8MAqyXDSNh2/rRWUUPpXQ8dumSq1foofzlnzMH+VUBdD1YJY4HsNrBcCR5JrVzTsU7TEMufuQB5CqCrtiaVbHsszievb87b+Edvf6s5m0zBxdX1PlgPbTD0cDEbxGuJG4BOZAZ73wvBcpJxo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712806381; c=relaxed/simple; bh=oLLdTTKJKvZGCT3VxJu2I0H1lKPF7WqOrG568ajKlas=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rgc33aAoDt1FaruYugLHwal2OKEtY6LHP1I36x2zsIZFf3BJOULhOS73gJVQLS/wfQ9b+yqk+PBw9XONWi1Uvj+fjJp2RWS9q1d5HfYY8+MlcNA/EMsPVbqGXEKLzEdm1Eyn+8ZBhGYEI/CGcGFrvQr9bEQYz+CZ0DdFCp5WvGQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PSJ6lXHS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB6F7C433B2; Thu, 11 Apr 2024 03:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712806381; bh=oLLdTTKJKvZGCT3VxJu2I0H1lKPF7WqOrG568ajKlas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PSJ6lXHSqpVia7i39B7tkei/wFKc3ImfQLi1p/LKSrZxHBonbM8fkzVOBmGUFL2JM DbRYt6bxJNdcRBcmkH0yz4Uo+RsO0+2t1BQgBQxdb4tysPzkVGw6bEXSxw0e6SFFYt QvasCY4bIaJkXqm806C8T9bitwJ/qBLvqPR1+CsNZyPAGOf/5gdkAaqkCv5+0+K2I3 qSkny1VjXI2pGTpeawAnOC5+V6g1tsMjeUoKbZ8g0fJK8Zo5bsETkpV1+6P64rO2hs t0mD5emTuepJ6EtKFzes6k+f56f8r5uX4IQwF9e/qXY15hwfuOcHH/UXyZ2eYmvmRJ KmlcVe1nrI4VA== From: Namhyung Kim To: Arnaldo Carvalho de Melo , Ian Rogers , Kan Liang Cc: Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: [PATCH 7/7] perf report: Do not collect sample histogram unnecessarily Date: Wed, 10 Apr 2024 20:32:56 -0700 Message-ID: <20240411033256.2099646-8-namhyung@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240411033256.2099646-1-namhyung@kernel.org> References: <20240411033256.2099646-1-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The data type profiling alone doesn't need the sample histogram for functions. It only needs the histogram for the types. Let's remove the condition in the report_callback to check if data type profiling is selected and make sure the annotation has the 'struct annotated_source' instantiated before calling symbol__disassemble(). Reviewed-by: Ian Rogers Signed-off-by: Namhyung Kim --- tools/perf/builtin-report.c | 2 +- tools/perf/util/annotate.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index aaa6427a1224..dafba6e030ef 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -172,7 +172,7 @@ static int hist_iter__report_callback(struct hist_entry_iter *iter, struct mem_info *mi; struct branch_info *bi; - if (!ui__has_annotation() && !rep->symbol_ipc && !rep->data_type) + if (!ui__has_annotation() && !rep->symbol_ipc) return 0; if (sort__mode == SORT_MODE__BRANCH) { diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index ec79c120a7d2..7595c8fbc2c5 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -908,6 +908,13 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel, args.arch = arch; args.ms = *ms; + + if (notes->src == NULL) { + notes->src = annotated_source__new(); + if (notes->src == NULL) + return -1; + } + if (annotate_opts.full_addr) notes->src->start = map__objdump_2mem(ms->map, ms->sym->start); else -- 2.44.0.478.gd926399ef9-goog