linux-debuggers.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Brennan <stephen.s.brennan@oracle.com>
To: Randy Dunlap <rdunlap@infradead.org>, Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-debuggers@vger.kernel.org
Subject: Re: [PATCH 1/1] kernel/config: Introduce CONFIG_DEBUG_INFO_IKCONFIG
Date: Wed, 04 Oct 2023 10:56:42 -0700	[thread overview]
Message-ID: <87jzs26zl1.fsf@oracle.com> (raw)
In-Reply-To: <2d690a95-67c6-45cb-91a1-4fbac09e1224@infradead.org>

Randy Dunlap <rdunlap@infradead.org> writes:
> Hi,
>
> On 10/4/23 09:58, Stephen Brennan wrote:
>> The option CONFIG_IKCONFIG allows the gzip compressed kernel
>> configuration to be included into vmlinux or a module. In these cases,
>> debuggers can access the config data and use it to adjust their behavior
>> according to the configuration. However, distributions rarely enable
>> this, likely because it uses a fair bit of kernel memory which cannot be
>> swapped out.
>
> x86_64 allmodconfig is 91 KB gzipped... oh well.

Yeah, and info like BTF is much larger, yet this is the config setting
that gets trimmed out by distros :(

(This is not a criticism of BTF, just an observation)

Unfortunately I don't control it and am just trying to work around it :)

> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>

Thanks!
Stephen

>> This means that in practice, the kernel configuration is rarely
>> available to debuggers.
>> 
>> So, introduce an alternative, CONFIG_DEBUG_INFO_IKCONFIG. This strategy,
>> which is only available if IKCONFIG is not already built-in, adds a
>> section ".debug_linux_ikconfig", to the vmlinux ELF. It will be stripped
>> out of the final images, but will remain in the debuginfo files. So
>> debuggers which rely on vmlinux debuginfo can have access to the kernel
>> configuration, without incurring a cost to the kernel at runtime.
>> 
>> Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
>> ---
>>  include/asm-generic/vmlinux.lds.h |  3 ++-
>>  kernel/Makefile                   |  1 +
>>  kernel/configs-debug.S            | 18 ++++++++++++++++++
>>  lib/Kconfig.debug                 | 14 ++++++++++++++
>>  4 files changed, 35 insertions(+), 1 deletion(-)
>>  create mode 100644 kernel/configs-debug.S
>
>
> -- 
> ~Randy

      reply	other threads:[~2023-10-04 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04 16:58 [PATCH 0/1] Introduce CONFIG_DEBUG_INFO_IKCONFIG Stephen Brennan
2023-10-04 16:58 ` [PATCH 1/1] kernel/config: " Stephen Brennan
2023-10-04 17:52   ` Randy Dunlap
2023-10-04 17:56     ` Stephen Brennan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzs26zl1.fsf@oracle.com \
    --to=stephen.s.brennan@oracle.com \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-debuggers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).