Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp69441lqa; Fri, 26 Apr 2024 14:51:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5XL7tv+SU3s+h+kMYW5nItEi1qUWhc1NBiyzkxeO457liDRW2sSMAv1I9kADa0eMAHOto4D9sabldlb8D+1mj3zsmDgYjBPUJhlCiHQ== X-Google-Smtp-Source: AGHT+IFbtHV2PKzTrM6p2ZO8542M8NQZdRapAwG/RmUtrxAU/Sol75XS5OtwljA6HZOIOkPnQvmJ X-Received: by 2002:a17:903:2409:b0:1eb:1129:7f15 with SMTP id e9-20020a170903240900b001eb11297f15mr3657924plo.46.1714168319502; Fri, 26 Apr 2024 14:51:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714168319; cv=pass; d=google.com; s=arc-20160816; b=AsyswdxO74F+Y/itaoQZW9TSoTJSLyStypIUDlFzEdG5q3g8YLhckbk1enqo3CF/YF 909UoA2t4Zqs8WAG5gdUGvIZh74d5h1hy9V0W++ss6YrIdGASGreHh4hSb/3hD5WYyEY j1MWUC2fs/B6pwjGOkpGuj0R8+YN/JFfi/hubREaScXQp1znBQV8Qf1ckh+Zy3l3rnc6 qoN6/9ad9Ax2wnvhQVe4+Ryp8LBORqGeSe9qyj8REL5a0dz9gu7GGDNRjEW5hIXB1m4x sTS9UEnR1UY/XZ6fTVW7ZD2N5CKJKqVvjc9h6EiejoeaeHOLAhy75h4WhxGE8VSIZ527 cUew== 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=0YS7U4xQ8twpfcRi0Qb/5zm2AUZvCTK/7oE4BGBCvgI=; fh=fHhbvXgCev/wpffLVpfaAi8pPyv7hrTyhVPgsZ7HNrs=; b=K8AebfbENoQFdDL7ZniK8trQVKg7MrXs6IBh2GvEeawmVnbkHAkTY4StLwisg6Tid0 ciUt2C7O/H2iEdCicoTLab5nnuRrRCJClvdr2FOS31CmEdeOuLIeBmFp5qvjZRXXaZ+8 GxoxTCMH2nZQhQZx+UhjjX7hF6mbr562YUHh4ptgBClHZGBtH0ZRyMDz44LkAUlkTHjO sN72ymvRHyTeVb47Lp3h7Sxh1Kw6t/w1Bm87bOI76ch4ir8UyeRiRRT3heVDtpLj6qyW KvQw9clPoaHiq78wZt7N0hlYVk4L1kxiCr4JTknTFdte2/KwZCG2rSmrA/Kc/ubNf0Ub EMYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HiCRcSnM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160715-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id w20-20020a1709027b9400b001e2ad612671si15204956pll.348.2024.04.26.14.51.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 14:51:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HiCRcSnM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160715-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 85963B22417 for ; Fri, 26 Apr 2024 21:51:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0E8C381B9; Fri, 26 Apr 2024 21:51:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HiCRcSnM" 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 E8958374C6; Fri, 26 Apr 2024 21:51:40 +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=1714168301; cv=none; b=KEyq6wt6iokfmY+icUoyJheKlIzr4bRimKfW/OKk/eQETUX+RoAoy7eQKn+ES6rjWZdmnbLJnInkvK/qqct1CvPZjYK4hEf42CEw3HIRCEkK77uvX1i29AcRib2koD5ZuzzgDORP6T7AXCaVYmcnmmnjMXRinp0NsXg9hvmn2o4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714168301; c=relaxed/simple; bh=ILtUrOVDvMYtd4HDjAPc/XxCz7q3QopNgkfhinc9zBI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HW2u07vwNQSHRLk2YH5NrKOBH6khfaXy3Z579slg/LW/YcxESR/aVFijEm2Xtx357lVOTV9tBb7WFXtLxavHVHELvgJxJdqinv2reNk+kwLtmVwv/NmaCwjN1CmVqPSFVsImbW4qMA6VFeNKVyPW7EBbKtAi/6qPJjbC+8fifDo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HiCRcSnM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D629C32781; Fri, 26 Apr 2024 21:51:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714168300; bh=ILtUrOVDvMYtd4HDjAPc/XxCz7q3QopNgkfhinc9zBI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HiCRcSnMUWcNrIUaPcY1Nr4AnVEEsTUuVRWxbzdbXFdfrfk8s13/kcRSCd9RF9qAJ eO+NuQVEfnRch3atuuatG9F804CIF2s4hpou2jNsTCT0Cff5PI3AzlP58deJ0nFve5 +Gi/eNd5nh7gbUAQRXvY1luLe6yVb8PuRtJPKJo4J96bzAMTWOhmuSDsBd9zsRy0yF GSEoqm1XpzTAykd0xXL/xWHIs1bePm+n+2lLNSrHKXorWvtdznWoYL5PO+i6WC6Zhf ZxPrhEGEf2C3Fi5HS19bqitzL59xqntGeYsw51g9WvIWOmgvk9xGSMBFSmzYnf5dKh nqB2rD5xJehQA== 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 2/2] perf symbol: Simplify kernel module checking Date: Fri, 26 Apr 2024 14:51:39 -0700 Message-ID: <20240426215139.1271039-2-namhyung@kernel.org> X-Mailer: git-send-email 2.44.0.769.g3c40516874-goog In-Reply-To: <20240426215139.1271039-1-namhyung@kernel.org> References: <20240426215139.1271039-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 In dso__load(), it checks if the dso is a kernel module by looking the symtab type. Actually dso has 'is_kmod' field to check that easily and dso__set_module_info() set the symtab type and the is_kmod bit. So it should have the same result to check the is_kmod bit. Signed-off-by: Namhyung Kim --- tools/perf/util/symbol.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 63936269ec15..50969c687135 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1811,10 +1811,7 @@ int dso__load(struct dso *dso, struct map *map) goto out; } - kmod = dso__symtab_type(dso) == DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE || - dso__symtab_type(dso) == DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP || - dso__symtab_type(dso) == DSO_BINARY_TYPE__GUEST_KMODULE || - dso__symtab_type(dso) == DSO_BINARY_TYPE__GUEST_KMODULE_COMP; + kmod = dso__is_kmod(dso); if (dso__kernel(dso) && !kmod) { if (dso__kernel(dso) == DSO_SPACE__KERNEL) -- 2.44.0.769.g3c40516874-goog