linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qais Yousef <qais.yousef@arm.com>
To: "Joel Fernandes (Google)" <joel@joelfernandes.org>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	ast@kernel.org, atishp04@gmail.com, dancol@google.com,
	Dan Williams <dan.j.williams@intel.com>,
	dietmar.eggemann@arm.com, gregkh@linuxfoundation.org,
	Guenter Roeck <groeck@chromium.org>,
	Jonathan Corbet <corbet@lwn.net>,
	karim.yaghmour@opersys.com, Kees Cook <keescook@chromium.org>,
	kernel-team@android.com, linux-doc@vger.kernel.org,
	linux-kselftest@vger.kernel.org,
	linux-trace-devel@vger.kernel.org,
	Manoj Rao <linux@manojrajarao.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	mhiramat@kernel.org, rdunlap@infradead.org, rostedt@goodmis.org,
	Shuah Khan <shuah@kernel.org>,
	yhs@fb.com
Subject: Re: [PATCH v6 1/2] Provide in-kernel headers to make extending kernel easier
Date: Tue, 9 Apr 2019 16:00:34 +0100	[thread overview]
Message-ID: <20190409150034.qkeceveap4tblk25@e107158-lin.cambridge.arm.com> (raw)
In-Reply-To: <20190408212855.233198-1-joel@joelfernandes.org>

On 04/08/19 17:28, Joel Fernandes (Google) wrote:
> Introduce in-kernel headers which are made available as an archive
> through proc (/proc/kheaders.tar.xz file). This archive makes it
> possible to run eBPF and other tracing programs tracing programs that
> need to extend the kernel for tracing purposes without any dependency on
> the file system having headers.
> 
> On Android and embedded systems, it is common to switch kernels but not
> have kernel headers available on the file system. Further once a
> different kernel is booted, any headers stored on the file system will
> no longer be useful. By storing the headers as a compressed archive
> within the kernel, we can avoid these issues that have been a hindrance
> for a long time.
> 
> The best way to use this feature is by building it in. Several users
> have a need for this, when they switch debug kernels, they donot want to
> update the filesystem or worry about it where to store the headers on
> it. However, the feature is also buildable as a module in case the user
> desires it not being part of the kernel image. This makes it possible to
> load and unload the headers from memory on demand. A tracing program, or
> a kernel module builder can load the module, do its operations, and then
> unload the module to save kernel memory. The total memory needed is 3.8MB.
> 
> By having the archive available at a fixed location independent of
> filesystem dependencies and conventions, all debugging tools can
> directly refer to the fixed location for the archive, without concerning
> with where the headers on a typical filesystem which significantly
> simplifies tooling that needs kernel headers.
> 
> The code to read the headers is based on /proc/config.gz code and uses
> the same technique to embed the headers.
> 
> IKHD_ST and IKHD_ED markers as is to facilitate future patches that
> would extract the headers from a kernel or module image.
> 
> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>

I applied both patches on 5.1-rc2 and managed to compile and run several
eBPF programs using the untarred headers from /proc/kheaders.tar.xz on my juno.

Tested-by: Qais Yousef <qais.yousef@arm.com>

> ---
> 
>     v5 -> v6: (Masahiro Yamada suggestions mostly)
>     - Dropped support for module building.
>     - Rebuild archive if script changes.
>     - Move archive file list to script.
>     - Move build script to kernel directory.
> 
>     v4 -> v5:
>     (v4 was Tested-by the following folks)
>         Tested-by: qais.yousef@arm.com
>         Tested-by: dietmar.eggemann@arm.com
>         Tested-by: linux@manojrajarao.com

Thanks!

--
Qais Yousef

  parent reply	other threads:[~2019-04-09 15:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 21:28 [PATCH v6 1/2] Provide in-kernel headers to make extending kernel easier Joel Fernandes (Google)
2019-04-08 21:28 ` [PATCH v6 2/2] init/config: Do not select BUILD_BIN2C for IKCONFIG Joel Fernandes (Google)
2019-04-11 14:17   ` Masahiro Yamada
2019-04-09 15:00 ` Qais Yousef [this message]
2019-04-09 15:11   ` [PATCH v6 1/2] Provide in-kernel headers to make extending kernel easier Joel Fernandes
2019-04-11  1:47 ` Masahiro Yamada
2019-04-12 18:00   ` Joel Fernandes
2019-04-13  1:48     ` Masahiro Yamada
2019-04-13  1:52       ` Daniel Colascione
2019-04-13  2:58         ` Masahiro Yamada
2019-04-13  3:09           ` Masahiro Yamada
2019-04-13  3:18             ` Daniel Colascione

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=20190409150034.qkeceveap4tblk25@e107158-lin.cambridge.arm.com \
    --to=qais.yousef@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=ast@kernel.org \
    --cc=atishp04@gmail.com \
    --cc=corbet@lwn.net \
    --cc=dan.j.williams@intel.com \
    --cc=dancol@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@chromium.org \
    --cc=joel@joelfernandes.org \
    --cc=karim.yaghmour@opersys.com \
    --cc=keescook@chromium.org \
    --cc=kernel-team@android.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=linux@manojrajarao.com \
    --cc=mhiramat@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=shuah@kernel.org \
    --cc=yamada.masahiro@socionext.com \
    --cc=yhs@fb.com \
    /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).