Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp69426lqa; Fri, 26 Apr 2024 14:51:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqGEOTd76sxVfFj9wDpnWmgQQ5c76s98TtlOM7vaNgneXForWgtAc83/z0vfqRJWlJZN7cF7beLjQThhupi+pli9VmKvSv1zDHD8yGlQ== X-Google-Smtp-Source: AGHT+IFjxLyFatY0DS5VrqGUG/H3j+JrE6Q5CE6DiLvLzI/+Yn7uIAfkhYp+ubhbjz4BcE/5UXS7 X-Received: by 2002:a17:902:f611:b0:1eb:3daf:ebaf with SMTP id n17-20020a170902f61100b001eb3dafebafmr1624287plg.57.1714168317467; Fri, 26 Apr 2024 14:51:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714168317; cv=pass; d=google.com; s=arc-20160816; b=d09Xb9Zm+oTTOR1EzGB3dUsb/Ijg7EWSHNwpCeJjmtdI4UEdxqzpz9OlWQ2pKkBOOK DKmSQbWDD6v2ZEf7VmTBers6TfIQlt1vpE+ISk72rUOPKs3jacS9HyMKAwIf3uhcd4TD eOrck3N87vliFzSgFU/lLgdB+4Ms3gkGrFa+cmGL7HoUb2tt3nX8GZOw+jqmYeVSa28a fVdQGBrpFxnmp1XipcFmudXpkzpRoUxL22p3lrCJ5zKwrpivlekxEuk6Ptu67sf6Im6D zaeGIWNBZyZIb1y9/Gsp1P4XoaNOu3M5fE/5fsPR0YHf+LWaeHcYM9bF8NKjD2JghDGY Hw7w== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=0TY70AEQxXTUm/lsdtUD9Dc37pY+jkLKEfcM+ir00Ks=; fh=fHhbvXgCev/wpffLVpfaAi8pPyv7hrTyhVPgsZ7HNrs=; b=TNl2xJowk+s6Iv1OvKPyYpqxpat3xAOfy3xHgsKpcBIC56zazlVd3ZB+LNEE1IMMkp WCTCT3cYtF26qv9dP0q2CDFOUTUG6GtMSicV862/olexClZRNOFSuV1hcbTXfFemEN7m A+Pc5U7AxjH9YrHa9v1HPLOa+oy5OiK0Z6dhorY2mTyJ/LUsFvl04ofQUiKTGKiFhWtK Oh8fUyRdA19nuH4XbysA+lCFOKmKDTu0WyFG89Jn44uggvU6Lwkl2i6lpxSARAZob2ZJ 6/lF1f2QLxeJl5FgVVC8DtIBKeP5o8Q89GW3QvyZ7u/oyL6+ft9ThbMSBTTN7D1Hv4o6 OAVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=farHw3iv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160714-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id z6-20020a170902ccc600b001eacb6dba71si3421615ple.138.2024.04.26.14.51.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 14:51:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=farHw3iv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160714-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 41A40B21FE8 for ; Fri, 26 Apr 2024 21:51:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77B6E37708; 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="farHw3iv" 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 9C1A463A9; 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=1714168300; cv=none; b=O3oIARxpivag2aWedIlN99qbxoUNwIM9Gc3o/CU6ikw94aP0aba//gTz3dKkxSfVmNAHGtacRJedSVf3xeMdtF5BskLI1UCLiDmLM2zoVIdWjILCOV2P9BgJvrKj8pk26mzkL4qj8ZDYPMVd7Gbdj79kKbVb9j6cnAk7dVcSUFM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714168300; c=relaxed/simple; bh=p25LKjfAYhucdY7uYC0uLj/fjyCQwe/CH3qIxeSN6so=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Hke0q34Unhe3MHl16kXIlk/2lv0Yxhty/e/MvBjDzxLBwP+u61/ENmh2F/tP9/LYfDMzGb3txnvn3ROfvEau434jiBYm0rJAxQHLj8R7qlR/jno2sdL8pps3IxZSVZQWkV0bCc3ciq1eO5WErTjQBwdCpNswK9TJVc0eWTh+sJc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=farHw3iv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B09C0C113CD; Fri, 26 Apr 2024 21:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714168300; bh=p25LKjfAYhucdY7uYC0uLj/fjyCQwe/CH3qIxeSN6so=; h=From:To:Cc:Subject:Date:From; b=farHw3ivejo20JY6s0M9U1EZ1xYkTOcab8/qV/LBEOQ6JhiaXrE6nQWexUvnVypD8 uCPmFXWykyh4XVHXUvD0eWp03922eK+lkPBQjp+TT2vxqhbSf8tVRozEghc91l8921 Utx5KNmPkEnTGZXe9ugtYzVC3/foKkXhLW8DU2K7xPZ/5R3xkhBI58UkuQQI4L6DEv AdRN7YTNT8o57ID/wari8qJuo6Vy0Ngw/YCMYulUkzpCIcbcVwfJwlDNJh+h2QGzWw VxXxXSlJMj0YzBR47VFIWqpbb8bJ4G5t38NR1YCEKMllEJn+4kZUcqav3qkVh2CmAx BHHom8MkgDlGA== 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 1/2] perf symbol: Set binary_type of dso when loading Date: Fri, 26 Apr 2024 14:51:38 -0700 Message-ID: <20240426215139.1271039-1-namhyung@kernel.org> X-Mailer: git-send-email 2.44.0.769.g3c40516874-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit For the kernel dso, it sets the binary type of dso when loading the symbol table. But it seems not to do that for user DSOs. Actually it sets the symtab type only. It's not clear why we want to maintain the two separately but it uses the binary type info before getting the disassembly. Let's use the symtab type as binary type too if it's not set. I think it's ok to set the binary type when it founds a symsrc whether or not it has actual symbols. Signed-off-by: Namhyung Kim --- tools/perf/util/symbol.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 7772a4d3e66c..63936269ec15 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1927,6 +1927,9 @@ int dso__load(struct dso *dso, struct map *map) if (next_slot) { ss_pos++; + if (dso__binary_type(dso) == DSO_BINARY_TYPE__NOT_FOUND) + dso__set_binary_type(dso, symtab_type); + if (syms_ss && runtime_ss) break; } else { -- 2.44.0.769.g3c40516874-goog