Re: [PATCH v4 1/2] Provide in-kernel headers for making it easy to extend the kernel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH v4 1/2] Provide in-kernel headers for making it easy to extend the kernel
- From: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
- Date: Fri, 15 Mar 2019 22:14:07 +0900
- Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>, Daniel Colascione <dancol@xxxxxxxxxx>, Karim Yaghmour <karim.yaghmour@xxxxxxxxxxx>, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Alexei Starovoitov <ast@xxxxxxxxxx>, atish patra <atishp04@xxxxxxxxx>, Dan Williams <dan.j.williams@xxxxxxxxx>, Dietmar Eggemann <dietmar.eggemann@xxxxxxx>, Guenter Roeck <groeck@xxxxxxxxxxxx>, Jonathan Corbet <corbet@xxxxxxx>, Kees Cook <keescook@xxxxxxxxxxxx>, Android Kernel Team <kernel-team@xxxxxxxxxxx>, "open list:DOCUMENTATION" <linux-doc@xxxxxxxxxxxxxxx>, "open list:KERNEL SELFTEST FRAMEWORK" <linux-kselftest@xxxxxxxxxxxxxxx>, linux-trace-devel@xxxxxxxxxxxxxxx, Manoj Rao <linux@xxxxxxxxxxxxxxxx>, Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>, Qais Yousef <qais.yousef@xxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxxx>, Shuah Khan <shuah@xxxxxxxxxx>, Yonghong Song <yhs@xxxxxx>
- In-reply-to: <20190314122748.GA101545@google.com>
- References: <20190309121141.GA30173@kroah.com> <b7296377-9e0c-aed7-61f0-93d24d1ceddd@opersys.com> <CAMuHMdV8+XTyGf1ZJ+gMf=zQpzqh3-+b7wgi+gAmXQ6HpUAw3A@mail.gmail.com> <3e84e1ef-e266-e983-5874-6c26ac7f38b8@opersys.com> <20190311193612.4f09bf11@oasis.local.home> <CAKOZuetHG0O-CiO6h5tD7aht_MT70ebwWMMSPkRUHdiM3wVq0Q@mail.gmail.com> <20190312003912.GA170478@google.com> <20190311212823.60684182@oasis.local.home> <CAJWu+oqsD_wHGWfzj6POFowiY2qcu04auVzkA6Lu9R+LR4gkrQ@mail.gmail.com> <20190313101843.800dd8d6a9babb635580ebdc@kernel.org> <20190314122748.GA101545@google.com>
On Thu, 14 Mar 2019 08:27:48 -0400
Joel Fernandes <joel@xxxxxxxxxxxxxxxxx> wrote:
> > But the eBPF is based on kprobe-events. What kind of usage would you
> > expected? (with macros??)
>
> eBPF C programs are compiled with kernel headers. They can execute inline
> functions or refer to macros in the kernel headers. They are similar to
> kernel modules where you build a C program that then later is executed in
> kernel context. It goes through the whole compiler pipeline. This is slightly
> different usage from pure kprobe-events. Also eBPF kprobe programs need
> LINUX_VERSION_CODE (or similarly named) macro which it provides to the bpf(2)
> syscall when loading kprobe programs. This is because eBPF implementation in
> the kernel checks if the eBPF programs that use kprobes are being loaded
> against the right kernel.
Ah, I got it. It's similar to SystemTap. :)
Thank you,
--
Masami Hiramatsu <mhiramat@xxxxxxxxxx>
[Index of Archives]
[Linux USB Development]
[Linux USB Development]
[Linux Audio Users]
[Yosemite Hiking]
[Linux Kernel]
[Linux SCSI]