Message ID | 20240221194052.927623-5-surenb@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BC77C5478B for <linux-mm@archiver.kernel.org>; Wed, 21 Feb 2024 19:41:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 604FE6B008A; Wed, 21 Feb 2024 14:41:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4F2816B008C; Wed, 21 Feb 2024 14:41:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2CC7D6B0092; Wed, 21 Feb 2024 14:41:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 12D5A6B008A for <linux-mm@kvack.org>; Wed, 21 Feb 2024 14:41:08 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id DEC6B1A072F for <linux-mm@kvack.org>; Wed, 21 Feb 2024 19:41:07 +0000 (UTC) X-FDA: 81816829374.13.BAE602D Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf26.hostedemail.com (Postfix) with ESMTP id 48E89140013 for <linux-mm@kvack.org>; Wed, 21 Feb 2024 19:41:06 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=e6CL7XXR; spf=pass (imf26.hostedemail.com: domain of 30VHWZQYKCAQwyvirfksskpi.gsqpmry1-qqozego.svk@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=30VHWZQYKCAQwyvirfksskpi.gsqpmry1-qqozego.svk@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708544466; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nNOJH11gO16gI1CGV9wD1JhhI3G0pl89I4/43bWDXAE=; b=AmeIz05WXz0ipAlRtIMtbEz/po2phifyxpeP44bJKrwCqixkp3XWSp5ySRVYCBfbib3VIs k7cBD8TlN74NZjHM2jQvyX9WHYJoHe5iSkv8EnydaGZtKlCQo/LISpmdmkrwZtmnx6jI85 iDFGqvDv7tdFzrvBDN4Fo+ZRrMl0r2U= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=e6CL7XXR; spf=pass (imf26.hostedemail.com: domain of 30VHWZQYKCAQwyvirfksskpi.gsqpmry1-qqozego.svk@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=30VHWZQYKCAQwyvirfksskpi.gsqpmry1-qqozego.svk@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708544466; a=rsa-sha256; cv=none; b=jbgThjfY6XtqlCkbwcoto8P5PBJvxm+rtUflBSqGO59CpY+pwxlFfXBzubHzk8MaTkcopr LrPRdtcogYwiZuowet9hP7xoBxta+07bKl792p54WnvlLy0OxrWBhZtdDZsQLYU1h4n+L4 mwceDh3IOADnzlDzUieRsZvAnGO0AkM= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-608405e0340so17672687b3.0 for <linux-mm@kvack.org>; Wed, 21 Feb 2024 11:41:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708544465; x=1709149265; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=nNOJH11gO16gI1CGV9wD1JhhI3G0pl89I4/43bWDXAE=; b=e6CL7XXRWaDMIcsZbfWxowCYb0fnHNlbvRZ3v2euqlVcNXwH7MY0s0UlLshQJQKEQp bLjLLxeEmHW3zw0PzJq0B6lwXPr90Gq5kSbmnFrMo3K42lMzDWzWbi+UKRNU3Lnu7zY7 +iorZahfmpqMS8ft4eEHoNKNjPHTi3Vw5xYDVS2bSesMKoBQcVpGBesgIt1NbbWuzbbH S7IiMhw+PM+jgwCpRpa2P0rp5h/++SmeU6vlYL/ef7AH5wwaDFSoy+i/2Qg3XUIlIdl1 Gpe7Z+AfcKVaqH6+XMco3NpEZxLXQmbiP+8jmBLPu+hEB8X1cDk0839iqY6pQ48Muo7G UhVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708544465; x=1709149265; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nNOJH11gO16gI1CGV9wD1JhhI3G0pl89I4/43bWDXAE=; b=ITumXPlAU98jQlo6rsSqTrd0JCGdO1xVuYCz08YRT1wZHHGtsa6J8RO36LjCJfeuye UN02ylIrS65rnVQSoXIL3/HJjddG82M0CrazxEIKrkgrAv2ohGhNC0fiylCw9a2Ys3+4 QvDtg7jVPEwZyDz+uukyKPLMCPlAOXgmCx9qKPAcePkKgv7xHIcCnw8Lk5vAlW5UtJd+ GL80BAaSNEqHD7FBvdcJiWxoClN9E60M14cFhSxSu9wosi5aUrAC8G0OKYUgLgCO44gL pcUqIpjrChkw42TMlLaJHw4lky9zAGOgK+3yNEhhc7PhqggV+I+QNXvho/5L4VqH6pFy RNYQ== X-Forwarded-Encrypted: i=1; AJvYcCUERNWKDzBEmu7hdDSl632iGNkF/150KmmeeaGDbcEZ0ua4P79DAVvhAwrkjJY1Tm58PX/STOIrcQJ9iUPx5de/7sQ= X-Gm-Message-State: AOJu0YxEIAt0CqLXRX3/jSWtmC1R9DFk4tGbfE2m9mllpTm2qgVnfIXM nMDXK6Qu0JIw1JOqY7VqBHEvvYRChCvQOcK1QdIa+g4vBEhCk1nCob9l5i05CQpPSTWtdckoLG0 EDg== X-Google-Smtp-Source: AGHT+IFw1HW6rh2zXq6oVisO+flBpM8PZrPAxomjgm47RtsfgtCbzompT9Q8/PbN9Jjx8wnIh7u82HkUv1c= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:953b:9a4e:1e10:3f07]) (user=surenb job=sendgmr) by 2002:a81:528e:0:b0:608:94cb:6f6 with SMTP id g136-20020a81528e000000b0060894cb06f6mr174090ywb.7.1708544465320; Wed, 21 Feb 2024 11:41:05 -0800 (PST) Date: Wed, 21 Feb 2024 11:40:17 -0800 In-Reply-To: <20240221194052.927623-1-surenb@google.com> Mime-Version: 1.0 References: <20240221194052.927623-1-surenb@google.com> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog Message-ID: <20240221194052.927623-5-surenb@google.com> Subject: [PATCH v4 04/36] scripts/kallysms: Always include __start and __stop symbols From: Suren Baghdasaryan <surenb@google.com> To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, penguin-kernel@i-love.sakura.ne.jp, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, surenb@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 48E89140013 X-Rspam-User: X-Stat-Signature: p3sq4fgsjfgufkt14d8mxhsq774omskt X-Rspamd-Server: rspam01 X-HE-Tag: 1708544466-262808 X-HE-Meta: U2FsdGVkX1/nFJF0XiGXZ/5b98sOYIdsZ5lp+y8d650UjDi9ylYQS2MC8dolHB38u+/q3gzKEkJu/zZ2PAAvPbkmIpbmXAMOsBFXXg2vnvNEovgIpx0nqRJEtnv+3nguUHygO9m5RF5l6LjsVijHtrbYVTZJOM6PM/lsaVPMpMCf3/eSvXYK93fRwCoRP7brbKFW4OKmq5K13x6eVWGMWPPRV+3WmQLE7VmJPOvCUUwZmjjf/6/lhvm0DD698tGNQhedUJQUu/u5NmdWdnnlVKiiE90R/nJ/moZZLH74PRSszlr9LRz/5rC2ItK9KQ2jnFWPTF/9I5+iP44nhk9oGYyKMxb1l74VOR/J1CcFZxPxF4HhjBSIL2xVKRTb+1rQKA9MhzSjZBii1wTra0ytekyt4g+6awitU8IlWHOOl5HG8pSOlO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1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Memory allocation profiling
|
expand
|
On Wed, Feb 21, 2024 at 2:41 PM Suren Baghdasaryan <surenb@google.com> wrote: > > From: Kent Overstreet <kent.overstreet@linux.dev> > > These symbols are used to denote section boundaries: by always including > them we can unify loading sections from modules with loading built-in > sections, which leads to some significant cleanup. > > Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> > Signed-off-by: Suren Baghdasaryan <surenb@google.com> > Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 653b92f6d4c8..47978efe4797 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -204,6 +204,11 @@ static int symbol_in_range(const struct sym_entry *s, return 0; } +static bool string_starts_with(const char *s, const char *prefix) +{ + return strncmp(s, prefix, strlen(prefix)) == 0; +} + static int symbol_valid(const struct sym_entry *s) { const char *name = sym_name(s); @@ -211,6 +216,14 @@ static int symbol_valid(const struct sym_entry *s) /* if --all-symbols is not specified, then symbols outside the text * and inittext sections are discarded */ if (!all_symbols) { + /* + * Symbols starting with __start and __stop are used to denote + * section boundaries, and should always be included: + */ + if (string_starts_with(name, "__start_") || + string_starts_with(name, "__stop_")) + return 1; + if (symbol_in_range(s, text_ranges, ARRAY_SIZE(text_ranges)) == 0) return 0;