Received: by 2002:ab2:687:0:b0:1f4:6588:b3a7 with SMTP id s7csp111357lqe; Tue, 9 Apr 2024 16:51:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQuSp2RZm2ipoqCLn7zXaY/tnxa0w4jCeHLfJeGS8jKv0hiAVkWJURv/VlhXXbNtEUWVGxvby0x54QmSWLqIfxeH7NYEs9t3THcaGkXQ== X-Google-Smtp-Source: AGHT+IFrmjFH+KTN0bcfCErvLrrWZIZ9S8paSylUilYjZ2cZJep6dTdeovNkuB3cf5DiphTpJgd5 X-Received: by 2002:a17:903:1112:b0:1e3:f6cb:51fe with SMTP id n18-20020a170903111200b001e3f6cb51femr1928777plh.23.1712706671494; Tue, 09 Apr 2024 16:51:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712706671; cv=pass; d=google.com; s=arc-20160816; b=ujBEqtQM+EqEqbi8oO+e+hpEqp71Y8G6ZloiS89DY68SjAJ1iV33jZk7UvwoJSxUcH RyVWd3fBDIh4CItmOhlsPzegOTqAngn8fiCriLDvjM/ZGSMQT4BASrPl9ub31YM+Mua7 thFeLY1v/DpCwj9oslrns3SEcuuKV0yLxK6MYK5DCOEK970jvdLobXuvqdTIg5WOOKeP Kisy1XIk6HWCcQG3yVBr+FjQIklfPfT1uwk/7OHJNE4idPZgQt2M+OvnNgdyr2W1oCRq TRurBphWn6Hss/ludQGK3ovqXOFtdjbyUKHLf8JDVrF/Evxe5ZePwfkwU/4gWhNzcewL ayoQ== 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=RhCmuJFVT3R4Rk1PXys4+5eo+SgpuFAxy5KWmbMpQ6Y=; fh=fHhbvXgCev/wpffLVpfaAi8pPyv7hrTyhVPgsZ7HNrs=; b=BH2Rj+Z+epCOb6VRp7XgCpUczxXVQds5qFn79ze0Cmcni/IAKo0yW9W6w9BFauUFwL qbQg+LcEEb1fshTStrA647Zgl5B/dgKsLIVD8S9iP3ek8rchrtR5j6blXRjxf066BuTC 1PmtYSF1Nx3D/HLWzO/YywQ8C2e7sZ0pdj+uwX0n9vOqeFNCI459TNnGKDRmNjYbVQKn iJYXaVsNL6Q2tkuRxb87z0CeJrOtXE+1hEISUx5VLHLrMOiVB42f8qTHDAv0Rb6n3zJ/ YHJ3ZqohtJsIOastuL4WGnglLW7uil2KT7Z5LRw4IMlBh/046k28XLrfgTMF50NJ+JCr 6kiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XC5ZdLtD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-137731-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137731-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 c12-20020a170903234c00b001e45c829498si4097782plh.560.2024.04.09.16.51.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 16:51:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137731-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=XC5ZdLtD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-137731-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137731-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 2A5CA287553 for ; Tue, 9 Apr 2024 23:51:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F06F815A49E; Tue, 9 Apr 2024 23:50:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XC5ZdLtD" 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 87AF115957A; Tue, 9 Apr 2024 23:50:04 +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=1712706604; cv=none; b=Ie1G4Q/29X0/p16n68O1sOO/I9YI44WzZNnyJnoCiAVKsz0aSd94ad1uTFGsLYR0/XFw2Y5Jg5gYhKmx5/wD7Jk1lGw6GRBSGym8yB+MAFHGGM01GKU016dGUgeqPri1OQpV8hBnGxEdcnrZqtnzUhg73TeTrW6rwuSlDu14cuY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712706604; c=relaxed/simple; bh=PHHmaY/dJfgbrb1xjAz7ZXHpkxQRYYdnC61SjjaGTOk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bVJ/lXhCmVe5wWFkge8i/723MpkpPfj3ZBC48+wysBlMW5cAEPumoetIYnv/+fZweJlGIaVR/gNh4Ff8GIC0EAe33YV928h0w4iNwzJjCCAHiObW4D+fK3Ev4RKaGefzeSja2kfyfW3XUIy8x4NS+vtYI78tqdcBuIqI3JMiWsQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XC5ZdLtD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AC44C43390; Tue, 9 Apr 2024 23:50:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712706604; bh=PHHmaY/dJfgbrb1xjAz7ZXHpkxQRYYdnC61SjjaGTOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XC5ZdLtDw+8tQjRubaQDyZmQrtnywONrn24Tldeg7Mp/JM9IbN92e2Z4XpbdLElO8 nG4CXMkj5xiPsAUnFVrAW3wD14YhmuhvrtkwSJaBz77DHZksdXjHVD0p7oXoD2kjy9 PEEoWIwR6CqdL6vLCZQEhVRsSVXEZtblOPdmXfu9IpPHKJoGGeOzFAUuNJ59YSiYkc 3SORnlNxr20Ubt+mC59v3c6fc1S/AWPtHMucEbY4cxfMV7ioQqd84WANf0lE/zVfAO qekqa8+TJN9pYmbROL9t0fJn4JmHPDn1Y0AsmULEiURLKA0n4imSeP7Es4Hcxw35gi HFriir49I6P4w== 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 6/6] perf report: Do not collect sample histogram unnecessarily Date: Tue, 9 Apr 2024 16:50:00 -0700 Message-ID: <20240409235000.1893969-7-namhyung@kernel.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog In-Reply-To: <20240409235000.1893969-1-namhyung@kernel.org> References: <20240409235000.1893969-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 the data type profiling and make sure the annotation has the annotated_source before calling symbol__disassemble(). 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 11da27801d88..7e034d2f2adb 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