From patchwork Thu Feb 8 18:10:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 198524 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp355973dyd; Thu, 8 Feb 2024 10:11:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWuWSNYPAdFhhPFo/n8odWIGlSs6D4J3+dijZ4CkFnBBBrbQ8XlGGi793YxstOSILA0Ho6ssz9xL13couGFR7EsDgBmQw== X-Google-Smtp-Source: AGHT+IEab3j9WYIqY1LTdJrbKJ/pwxx37iDOe3Rr6M/PhnpjiSaycOprTvA/AGMuWsohx9p0RkDd X-Received: by 2002:a05:6870:c191:b0:218:e626:fd32 with SMTP id h17-20020a056870c19100b00218e626fd32mr289717oad.7.1707415912028; Thu, 08 Feb 2024 10:11:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707415911; cv=pass; d=google.com; s=arc-20160816; b=RYm8mZgPgC8ZBI/3WDruj1dzg/V/sHoDMW6lLRT8XFXco27602S6VwzH7w5gKYTHB/ yzKLU+HWHF1dRrlDOI8SgWYOhNcMDqjfs7tNg1rtElIGwKJv+nu/K/MxO5R2Ae4UM6bg qxKZwSU/syuH17p/T2LyogAYqbR1EVhLDZ/pVl3zKxKziiuRF0PvNlzV5+l/PtBJVC3a CGORqShqUcaWexwjTBUgh6Wr/gnzgXXjVJT6TpSJ1qL2bRqQtN2Mkf0XCQnETH0U+Czh HzHu/HdVpRqfbCPIa8naZN9LFwVp8rkzAthbTm/8HQnRLsC88Uml0a8piQ4PZ0Lrzd8l ywGA== 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=CFVFZUSRc32IwvlGkcCJ1XDfFZApViMMmwX9aVaUPwk=; fh=u6tftHOvokzjobq1SJnsmrBwyF4uWgEtJNFJwvk19jQ=; b=KuVVFoU5vZ273RDhWBAeORtapcKZWAJaQKSzct1VNiuLg/ulJnMxaYWNRLRChyGAWY /+J97GkHUh3gQFnQubN9le1WdHip+nne3vtSavUiJHwPShm7DuWM7sADQb7RMtMGt4Tp K4i9FTeuPNx/BHjs+IP7rUiTLDg9nXNA6Y7J8wKGYExY8tGdkdTBiUvWaOeHkzlZPRH0 AjxkIDacVDoIOEvdNgmZ+wgk4Iz1YLR+zeLy9K3j1mri5LfNXfpoEl0XFgX7+6A1hR3J DCf7o366l+W95WTpe6o3CtDwt30rxVlhC+xp+iRLQWAxvTM+aaRXkQMXj9BvuwuHXDO/ g0NQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tzYbapY4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-58516-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58516-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCVm9DnjTYXtfrANkvnlk4FeJf3+D2knf7OXBcsbxUX6bZC5ksZNMsmmHDN7huBsl06/3NSFltnxiNkhNmiGRrnXcfygog== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k7-20020a633d07000000b005dc496a3597si153315pga.417.2024.02.08.10.11.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 10:11:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58516-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tzYbapY4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-58516-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58516-ouuuleilei=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 6D29128B465 for ; Thu, 8 Feb 2024 18:10:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A540385C55; Thu, 8 Feb 2024 18:10:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tzYbapY4" 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 0978E82874; Thu, 8 Feb 2024 18:10:27 +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=1707415828; cv=none; b=uIAGhnSTx/qMNGD8q2TKanq/fWwyst2m+D8H3eFsTB7s/FzD4TVUnpOWeIeYYZIncKdDUeZ5iiTv+FlP7JtucxpZP+YzzWNl2hZvtr9N04DXQA78BzkfZmY8IB/Mzif6qZPuFUrweQYF+haE1Y1KW3c2tADuGS5mTwUmydQo06c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707415828; c=relaxed/simple; bh=eQyIxKVP5DgJx/KOhgg4TQvfeRw6XlPrn08qg5cmN/E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XGeOyzfRN0OsLUJkqcDyWNuIpZJyv4GQUohJUB2KrnXt61Cm8gP26zhGHbpv0gYkeq0EJV9uJrEmEVJGOyfBYIO+n+s7e8clvqDKIsDCOMDoqA0STwLl5gtN9f87YNz5y89lROLMepcV47es4KOYMO3z4xR1y1Qy9zLI8CXqLjs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tzYbapY4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30CD0C433C7; Thu, 8 Feb 2024 18:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707415827; bh=eQyIxKVP5DgJx/KOhgg4TQvfeRw6XlPrn08qg5cmN/E=; h=From:To:Cc:Subject:Date:From; b=tzYbapY4lgYyq276P4mqyg/VNN1w6rbElCtcA7rX6GpTnepoSY5QwH9o4Hoc9dgj/ QRr4u+4Tc8x9CvPn5yWfhr5Nf7qsyMcUNHXs/JroNiglLzLT7T7kVhAn6JWrlkUezh 0+C9NYtEobgL/BTB0NuDHVF/ebVvTyQyA25xPqvSM00IvdJqvOHBB6LwsOsGyrrnxN j5N+WLT5ojxCdw9LHFOvuwuVeaNxLh8j+jAjPK28pWjXF+CttoXb1A/OyL0ZpPkwwA Cp9Os+2/QNIZx45P7LvavxwkImg3UXZR8ZV0JSC3dtPFNowTAhLSRebMGqCl4XTu35 5w4O1rUda/aEg== From: Namhyung Kim To: Arnaldo Carvalho de Melo , Ian Rogers Cc: Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: [PATCH] perf tools: Remove misleading comments on map functions Date: Thu, 8 Feb 2024 10:10:25 -0800 Message-ID: <20240208181025.1329645-1-namhyung@kernel.org> X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790355347792528660 X-GMAIL-MSGID: 1790355347792528660 When it converts sample IP to or from objdump-capable one, there's a comment saying that kernel modules have DSO_SPACE__USER. But commit 02213cec64bb ("perf maps: Mark module DSOs with kernel type") changed it and makes the comment confusing. Let's get rid of it. Signed-off-by: Namhyung Kim Reviewed-by: Ian Rogers Acked-by: Arnaldo Carvalho de Melo --- tools/perf/util/map.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index cf5a15db3a1f..14a5ea70d81e 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -553,10 +553,6 @@ u64 map__rip_2objdump(struct map *map, u64 rip) if (dso->rel) return rip - map__pgoff(map); - /* - * kernel modules also have DSO_TYPE_USER in dso->kernel, - * but all kernel modules are ET_REL, so won't get here. - */ if (dso->kernel == DSO_SPACE__USER) return rip + dso->text_offset; @@ -585,10 +581,6 @@ u64 map__objdump_2mem(struct map *map, u64 ip) if (dso->rel) return map__unmap_ip(map, ip + map__pgoff(map)); - /* - * kernel modules also have DSO_TYPE_USER in dso->kernel, - * but all kernel modules are ET_REL, so won't get here. - */ if (dso->kernel == DSO_SPACE__USER) return map__unmap_ip(map, ip - dso->text_offset);