Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1049082iob; Wed, 4 May 2022 13:31:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznxQ4R1qz2BZBYOXEGsQ+OeVJE8mfk0KtxnLHGEIwlOaAliH47FV5LISGipPV6O7tbJNJj X-Received: by 2002:a63:5f57:0:b0:3c5:f9b9:bc5f with SMTP id t84-20020a635f57000000b003c5f9b9bc5fmr2477543pgb.163.1651696296515; Wed, 04 May 2022 13:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651696296; cv=none; d=google.com; s=arc-20160816; b=AwzG6/0r2sWHl9J3lRnUn/LA41EknapSD7j2RNybnyL9m2fox00MYo7Mi7ZETf1d4w 4wmhM57OKYggLbwout3CUaeeDSPUYmZg7Y2xRSIWevnNKC/SKNv/sCv9i+PDdBejzBFu FS1Av/xmjdJF8lhxWb0wn8bPt8cW9xxRy5nMy8YZ5VQhujC4NhnJFjkP765Rs3kSO4PS 1OUIkKPkBH76IqVxZ/Q6tcuz10/glBc/C3olbOjMCaiFC6LcomCImuX/GE8HEDCK3fVX oX2m2oO17z6iCChP6+ruFxX/VYvfd/m1KuKLihSdi62EPLyW8IiSTcVNlyW9KDmQ2ri3 JcAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KN2OgWjaq9TuL3H2W9baxnjIV13zFOUem/Jj9Yvpsck=; b=PmmAU5ohZwmXoTI81EmKD2oVni0DHBWbBMdPQmlo6U48TIyGRZBXuwCa+F6NrmlygI NsBCkvx7QKyFHwAvyZFB4L+UdHB/yNuG2tpvikvlJVc0GvrPyvSHxKNm5By2YMcmhOQa R/uTRKAg5coH+G/yXAeqT9Bvq1Ges7iWngS8EPRGDPZhzDEKd7NltvWH+naxeMnZwaQ9 vZkiSpjxzFQFRLyHPfZWx9rOLzHBtNvrXOl/X1OcFXjMeF73pnFuuFWd1KUzPj6AFVy5 WfRMwgMc2LY8EjsufZQ27isDwyNtZssoWHSyGZvgfVhKiIj+pwbu6GG4yaw0dyGYbSQG xzEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2H7Jym7K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l69-20020a638848000000b003c1725602b4si18178105pgd.627.2022.05.04.13.31.21; Wed, 04 May 2022 13:31:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2H7Jym7K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359244AbiEDRwk (ORCPT + 99 others); Wed, 4 May 2022 13:52:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358305AbiEDRPt (ORCPT ); Wed, 4 May 2022 13:15:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66DC656778; Wed, 4 May 2022 09:59:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5EC9D618E5; Wed, 4 May 2022 16:59:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E496C385B0; Wed, 4 May 2022 16:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683546; bh=M05diHhyYiiMEP1p7zkxEXwq4j6rWdnNMZv4K8SaFYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2H7Jym7K6ueX2CfTy4vqkpCLsc+hA2rbOgp3hInhmQ/kWOw4mlxGqbeLJtgbiKQyH yHHChO5btBIayRin9RgIXrBxFxcjm5oS7bkRvVWNc1/hlXYFuAaAJdrG9KCrjxCRPd cuXq1E9chwi60eR08E8RCiLaqKdaZT8WHirhgDMA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Namhyung Kim , Ian Rogers , Heiko Carstens , Ingo Molnar , Jiri Olsa , John Garry , Leo Yan , Mark Rutland , Masami Hiramatsu , Mathieu Poirier , Michael Ellerman , Michael Petlan , Peter Zijlstra , Song Liu , Will Deacon , linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Arnaldo Carvalho de Melo Subject: [PATCH 5.17 200/225] perf symbol: Remove arch__symbols__fixup_end() Date: Wed, 4 May 2022 18:47:18 +0200 Message-Id: <20220504153128.010052041@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153110.096069935@linuxfoundation.org> References: <20220504153110.096069935@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Namhyung Kim commit a5d20d42a2f2dc2b2f9e9361912062732414090d upstream. Now the generic code can handle kallsyms fixup properly so no need to keep the arch-functions anymore. Fixes: 3cf6a32f3f2a4594 ("perf symbols: Fix symbol size calculation condition") Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Heiko Carstens Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Michael Petlan Cc: Peter Zijlstra Cc: Song Liu Cc: Will Deacon Cc: linux-s390@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20220416004048.1514900-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/arch/arm64/util/machine.c | 21 --------------------- tools/perf/arch/powerpc/util/Build | 1 - tools/perf/arch/powerpc/util/machine.c | 25 ------------------------- tools/perf/arch/s390/util/machine.c | 16 ---------------- tools/perf/util/symbol.c | 5 ----- tools/perf/util/symbol.h | 1 - 6 files changed, 69 deletions(-) delete mode 100644 tools/perf/arch/powerpc/util/machine.c --- a/tools/perf/arch/arm64/util/machine.c +++ b/tools/perf/arch/arm64/util/machine.c @@ -8,27 +8,6 @@ #include "callchain.h" #include "record.h" -/* On arm64, kernel text segment starts at high memory address, - * for example 0xffff 0000 8xxx xxxx. Modules start at a low memory - * address, like 0xffff 0000 00ax xxxx. When only small amount of - * memory is used by modules, gap between end of module's text segment - * and start of kernel text segment may reach 2G. - * Therefore do not fill this gap and do not assign it to the kernel dso map. - */ - -#define SYMBOL_LIMIT (1 << 12) /* 4K */ - -void arch__symbols__fixup_end(struct symbol *p, struct symbol *c) -{ - if ((strchr(p->name, '[') && strchr(c->name, '[') == NULL) || - (strchr(p->name, '[') == NULL && strchr(c->name, '['))) - /* Limit range of last symbol in module and kernel */ - p->end += SYMBOL_LIMIT; - else - p->end = c->start; - pr_debug4("%s sym:%s end:%#" PRIx64 "\n", __func__, p->name, p->end); -} - void arch__add_leaf_frame_record_opts(struct record_opts *opts) { opts->sample_user_regs |= sample_reg_masks[PERF_REG_ARM64_LR].mask; --- a/tools/perf/arch/powerpc/util/Build +++ b/tools/perf/arch/powerpc/util/Build @@ -1,5 +1,4 @@ perf-y += header.o -perf-y += machine.o perf-y += kvm-stat.o perf-y += perf_regs.o perf-y += mem-events.o --- a/tools/perf/arch/powerpc/util/machine.c +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include -#include -#include -#include // page_size -#include "debug.h" -#include "symbol.h" - -/* On powerpc kernel text segment start at memory addresses, 0xc000000000000000 - * whereas the modules are located at very high memory addresses, - * for example 0xc00800000xxxxxxx. The gap between end of kernel text segment - * and beginning of first module's text segment is very high. - * Therefore do not fill this gap and do not assign it to the kernel dso map. - */ - -void arch__symbols__fixup_end(struct symbol *p, struct symbol *c) -{ - if (strchr(p->name, '[') == NULL && strchr(c->name, '[')) - /* Limit the range of last kernel symbol */ - p->end += page_size; - else - p->end = c->start; - pr_debug4("%s sym:%s end:%#" PRIx64 "\n", __func__, p->name, p->end); -} --- a/tools/perf/arch/s390/util/machine.c +++ b/tools/perf/arch/s390/util/machine.c @@ -35,19 +35,3 @@ int arch__fix_module_text_start(u64 *sta return 0; } - -/* On s390 kernel text segment start is located at very low memory addresses, - * for example 0x10000. Modules are located at very high memory addresses, - * for example 0x3ff xxxx xxxx. The gap between end of kernel text segment - * and beginning of first module's text segment is very big. - * Therefore do not fill this gap and do not assign it to the kernel dso map. - */ -void arch__symbols__fixup_end(struct symbol *p, struct symbol *c) -{ - if (strchr(p->name, '[') == NULL && strchr(c->name, '[')) - /* Last kernel symbol mapped to end of page */ - p->end = roundup(p->end, page_size); - else - p->end = c->start; - pr_debug4("%s sym:%s end:%#" PRIx64 "\n", __func__, p->name, p->end); -} --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -101,11 +101,6 @@ static int prefix_underscores_count(cons return tail - str; } -void __weak arch__symbols__fixup_end(struct symbol *p, struct symbol *c) -{ - p->end = c->start; -} - const char * __weak arch__normalize_symbol_name(const char *name) { return name; --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -241,7 +241,6 @@ const char *arch__normalize_symbol_name( #define SYMBOL_A 0 #define SYMBOL_B 1 -void arch__symbols__fixup_end(struct symbol *p, struct symbol *c); int arch__compare_symbol_names(const char *namea, const char *nameb); int arch__compare_symbol_names_n(const char *namea, const char *nameb, unsigned int n);