[PATCH v2 0/6] Generate address range data for built-in modules

2024-05-11 Thread Kris Van Hees
-40KB. Changes since v1: - Renamed CONFIG_BUILTIN_RANGES to CONFIG_BUILTIN_MODULE_RANGES - Moved the config option to the tracers section - 2nd arg to generate_builtin_ranges.awk should be vmlinux.map Kris Van Hees (5): trace: add CONFIG_BUILTIN_MODULE_RANGES option kbuild: generate a linker ma

[PATCH v2 1/6] kbuild: add modules.builtin.objs

2024-05-11 Thread Kris Van Hees
/vmlinux.lds.h). Orabug: 29891866 Signed-off-by: Luis Chamberlain Signed-off-by: Nick Alcock Reviewed-by: Nick Alcock Reviewed-by: Kris Van Hees --- Changes since v1: - None --- .gitignore | 2 +- Documentation/dontdiff | 2 +- Documentation/kbuild/kbuild.rst | 5

[PATCH v2 2/6] trace: add CONFIG_BUILTIN_MODULE_RANGES option

2024-05-11 Thread Kris Van Hees
The CONFIG_BUILTIN_MODULE_RANGES option controls whether offset range data is generated for kernel modules that are built into the kernel image. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock Reviewed-by: Alan Maguire --- Changes since v1: - Renamed CONFIG_BUILTIN_RANGES to

[PATCH v2 3/6] kbuild: generate a linker map for vmlinux.o

2024-05-11 Thread Kris Van Hees
When CONFIG_BUILTIN_MODULE_RANGES is set, a linker map for vmlinux.o needs to be generated. The generation of offset range data for builtin modules depends on that linker map to know what offsets in an ELF section belong to an object file for a particular builtin module. Signed-off-by: Kris Van

[PATCH v2 4/6] module: script to generate offset ranges for builtin modules

2024-05-11 Thread Kris Van Hees
or more builtin modules. Multiple ranges can apply to a single module, and ranges can be shared between modules. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Changes since v1: - Updated commit msg (vmlinux.o -> vmlinux.map) --- scripts/generate_builtin_ranges.awk |

[PATCH v2 5/6] kbuild: generate modules.builtin.ranges when linking the kernel

2024-05-11 Thread Kris Van Hees
Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Changes since v1: - Renamed CONFIG_BUILTIN_RANGES to CONFIG_BUILTIN_MODULE_RANGES --- scripts/Makefile.vmlinux | 17 + 1 file changed, 17 insertions(+) diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux

[PATCH v2 6/6] module: add install target for modules.builtin.ranges

2024-05-11 Thread Kris Van Hees
When CONFIG_BUILTIN_MODULE_RANGES is enabled, the modules.builtin.ranges file should be installed in the module install location. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Changes since v1: - Renamed CONFIG_BUILTIN_RANGES to CONFIG_BUILTIN_MODULE_RANGES --- scripts

Re: [PATCH v2 0/6] Generate address range data for built-in modules

2024-05-15 Thread Kris Van Hees
On Mon, May 13, 2024 at 01:43:15PM +0900, Masahiro Yamada wrote: > On Sun, May 12, 2024 at 7:42???AM Kris Van Hees > wrote: > > > > Especially for tracing applications, it is convenient to be able to > > refer to a symbol using a pair and to be able > > to tra

[PATCH v3 0/6] Generate address range data for built-in modules

2024-05-16 Thread Kris Van Hees
install target Changes since v1: - Renamed CONFIG_BUILTIN_RANGES to CONFIG_BUILTIN_MODULE_RANGES - Moved the config option to the tracers section - 2nd arg to generate_builtin_ranges.awk should be vmlinux.map Kris Van Hees (5): trace: add CONFIG_BUILTIN_MODULE_RANGES option kbuild: generate a

[PATCH v3 1/6] kbuild: add mod(name,file)_flags to assembler flags for module objects

2024-05-16 Thread Kris Van Hees
$(modname_flags) to a_flags (similar to c_flags). Signed-off-by: Kris Van Hees --- scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 3179747cbd2cc..a2524ffd046f4 100644 --- a/scripts/Makefile.lib +++ b

[PATCH v3 2/6] trace: add CONFIG_BUILTIN_MODULE_RANGES option

2024-05-16 Thread Kris Van Hees
The CONFIG_BUILTIN_MODULE_RANGES option controls whether offset range data is generated for kernel modules that are built into the kernel image. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock Reviewed-by: Alan Maguire --- Changes since v2: - Add explicit dependency on FTRACE for

[PATCH v3 3/6] kbuild: generate a linker map for vmlinux.o

2024-05-16 Thread Kris Van Hees
When CONFIG_BUILTIN_MODULE_RANGES is set, a linker map for vmlinux.o needs to be generated. The generation of offset range data for builtin modules depends on that linker map to know what offsets in an ELF section belong to an object file for a particular builtin module. Signed-off-by: Kris Van

[PATCH v3 4/6] module: script to generate offset ranges for builtin modules

2024-05-16 Thread Kris Van Hees
order) offset ranges in that section that cover the symbols of one or more builtin modules. Multiple ranges can apply to a single module, and ranges can be shared between modules. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Changes since v2: - 1st arg to

[PATCH v3 5/6] kbuild: generate modules.builtin.ranges when linking the kernel

2024-05-16 Thread Kris Van Hees
Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Changes since v2: - 1st arg to generate_builtin_ranges.awk is now modules.builtin.modinfo - Use $(real-prereqs) rather than $(filter-out ...) --- scripts/Makefile.vmlinux | 16 1 file changed, 16 insertions(+) diff

[PATCH v3 6/6] module: add install target for modules.builtin.ranges

2024-05-16 Thread Kris Van Hees
When CONFIG_BUILTIN_MODULE_RANGES is enabled, the modules.builtin.ranges file should be installed in the module install location. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Changes since v2: - Include modules.builtin.ranges in modules install target --- scripts/Makefile.modinst

Re: [PATCH v5] scripts/link-vmlinux.sh: Add alias to duplicate symbols for kallsyms

2023-10-05 Thread Kris Van Hees
On Wed, Sep 27, 2023 at 05:35:16PM +, Alessandro Carminati (Red Hat) wrote: > It is not uncommon for drivers or modules related to similar peripherals > to have symbols with the exact same name. > While this is not a problem for the kernel's binary itself, it becomes an > issue when attempting

Re: [PATCH v5] scripts/link-vmlinux.sh: Add alias to duplicate symbols for kallsyms

2023-10-05 Thread Kris Van Hees
On Thu, Oct 05, 2023 at 12:24:03PM -0400, Kris Van Hees wrote: > On Wed, Sep 27, 2023 at 05:35:16PM +, Alessandro Carminati (Red Hat) > wrote: > > It is not uncommon for drivers or modules related to similar peripherals > > to have symbols with the exact same name. >

Re: [PATCH v5] scripts/link-vmlinux.sh: Add alias to duplicate symbols for kallsyms

2023-10-10 Thread Kris Van Hees
> > On the flip side, introducing these new symbols would enable tracers to > > directly employ the new names without any modifications, and humans could > > easily identify the symbol they are dealing with just by examining the > > name. > > These are the fundamental

[PATCH 0/6] Generate address range data for built-in modules

2023-12-07 Thread Kris Van Hees
with the other modules.builtin.* files. The impact on the kernel build is minimal because everything is done using a single-pass AWK script. The generated data size is minimal as well, (depending on the exact kernel configuration) in the range of 500-600 lines, with a file size of 20-30KB. Kri

[PATCH 1/6] kbuild: add modules.builtin.objs

2023-12-07 Thread Kris Van Hees
/vmlinux.lds.h). Orabug: 29891866 Signed-off-by: Luis Chamberlain Signed-off-by: Nick Alcock Reviewed-by: Nick Alcock Reviewed-by: Kris Van Hees --- .gitignore | 2 +- Documentation/dontdiff | 2 +- Documentation/kbuild/kbuild.rst | 5 + Makefile

[PATCH 2/6] module: add CONFIG_BUILTIN_RANGES option

2023-12-07 Thread Kris Van Hees
The CONFIG_BUILTIN_RANGES option controls whether offset range data is generated for kernel modules that are built into the kernel image. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock Reviewed-by: Alan Maguire --- kernel/module/Kconfig | 17 + 1 file changed, 17

[PATCH 3/6] kbuild: generate a linker map for vmlinux.o

2023-12-07 Thread Kris Van Hees
When CONFIG_BUILTIN_RANGES is set, a linker map for vmlinux.o needs to be generated. The generation of offset range data for builtin modules depends on that linker map to know what offsets in an ELF section belong to an object file for a particular builtin module. Signed-off-by: Kris Van Hees

[PATCH 4/6] module: script to generate offset ranges for builtin modules

2023-12-07 Thread Kris Van Hees
more builtin modules. Multiple ranges can apply to a single module, and ranges can be shared between modules. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- scripts/generate_builtin_ranges.awk | 149 1 file changed, 149 insertions(+) create mode 100755

[PATCH 5/6] kbuild: generate modules.builtin.ranges when linking the kernel

2023-12-07 Thread Kris Van Hees
Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- scripts/Makefile.vmlinux | 17 + 1 file changed, 17 insertions(+) diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux index c9f3e03124d7..c23d40b023ff 100644 --- a/scripts/Makefile.vmlinux +++ b/scripts

[PATCH 6/6] module: add install target for modules.builtin.ranges

2023-12-07 Thread Kris Van Hees
When CONFIG_BUILTIN_RANGES is enable, the modules.builtin.ranges file should be installed in the module install location. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- scripts/Makefile.modinst | 5 + 1 file changed, 5 insertions(+) diff --git a/scripts/Makefile.modinst b

Re: [PATCH 2/6] module: add CONFIG_BUILTIN_RANGES option

2023-12-11 Thread Kris Van Hees
On Sat, Dec 09, 2023 at 07:59:17AM +0900, Masami Hiramatsu wrote: > On Fri, 8 Dec 2023 00:07:48 -0500 > Kris Van Hees wrote: > > > The CONFIG_BUILTIN_RANGES option controls whether offset range data is > > generated for kernel modules that are built into the kernel image. &

Re: [PATCH v3 4/6] module: script to generate offset ranges for builtin modules

2024-06-06 Thread Kris Van Hees
On Tue, May 21, 2024 at 01:53:27AM +0900, Masahiro Yamada wrote: > On Fri, May 17, 2024 at 1:31???PM Kris Van Hees > wrote: > > > > The offset range data for builtin modules is generated using: > > - modules.builtin.modinfo: associates object files with module names >

[PATCH v4 0/3] Generate address range data for built-in modules

2024-06-14 Thread Kris Van Hees
to generate_builtin_ranges.awk should be vmlinux.map Kris Van Hees (5): trace: add CONFIG_BUILTIN_MODULE_RANGES option kbuild: generate a linker map for vmlinux.o module: script to generate offset ranges for builtin modules kbuild: generate modules.builtin.ranges when linking the kernel

[PATCH v4 1/3] kbuild: add mod(name,file)_flags to assembler flags for module objects

2024-06-14 Thread Kris Van Hees
$(modname_flags) to a_flags (similar to c_flags). Signed-off-by: Kris Van Hees --- scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 3179747cbd2c..a2524ffd046f 100644 --- a/scripts/Makefile.lib +++ b/scripts

[PATCH v4 2/3] kbuild, kconfig: generate offset range data for builtin modules

2024-06-14 Thread Kris Van Hees
into the kernel image. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock Reviewed-by: Alan Maguire --- Changes since v3: - Consolidated patches 2 through 5 into a single patch - Move CONFIG_BUILTIN_MODULE_RANGES to Kconfig.debug - Make CONFIG_BUILTIN_MODULE_RANGES select CONFIG_VMLINUX_MAP

[PATCH v4 3/3] module: add install target for modules.builtin.ranges

2024-06-14 Thread Kris Van Hees
When CONFIG_BUILTIN_MODULE_RANGES is enabled, the modules.builtin.ranges file should be installed in the module install location. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Changes since v3: - Only install modules.builtin.ranges if CONFIG_BUILTIN_MODULE_RANGES=y --- scripts

Re: [PATCH v4 1/3] kbuild: add mod(name,file)_flags to assembler flags for module objects

2024-06-14 Thread Kris Van Hees
On Fri, Jun 14, 2024 at 01:46:51PM -0400, Steven Rostedt wrote: > On Fri, 14 Jun 2024 13:14:26 -0400 > Kris Van Hees wrote: > > > Module objects compiled from C source can be identified by the presence > > of -DKBUILD_MODFILE and -DKBUILD_MODNAME on their compile comma

Re: [PATCH v4 2/3] kbuild, kconfig: generate offset range data for builtin modules

2024-06-14 Thread Kris Van Hees
be in the posted version. Again, sorry for have yet again overlooked that. Kris On Fri, Jun 14, 2024 at 01:14:27PM -0400, Kris Van Hees wrote: > The offset range data for builtin modules is generated using: > - modules.builtin: associates object files with module names > - vm

[PATCH v5 0/4] Generate address range data for built-in modules

2024-07-15 Thread Kris Van Hees
config option to the tracers section - 2nd arg to generate_builtin_ranges.awk should be vmlinux.map Kris Van Hees (5): trace: add CONFIG_BUILTIN_MODULE_RANGES option kbuild: generate a linker map for vmlinux.o module: script to generate offset ranges for builtin modules kbuild: generate

[PATCH v5 1/4] kbuild: add mod(name,file)_flags to assembler flags for module objects

2024-07-15 Thread Kris Van Hees
a_flags (similar to c_flags) makes it possible to identify which objects are compiled into modules for both C and assembler soure files. Signed-off-by: Kris Van Hees --- scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.lib b/scripts

[PATCH v5 3/4] scripts: add verifier script for builtin module range data

2024-07-15 Thread Kris Van Hees
.*.cmd file used to compile the object as suggested in [0]) - For each symbol in that object, verify that the built-in module association (or lack thereof) matches the annotation given to the symbol. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock Reviewed

[PATCH v5 2/4] kbuild, kconfig: generate offset range data for builtin modules

2024-07-15 Thread Kris Van Hees
he new one - If the symbol does not belong to any built-in modules: - It we were working on a module(s) range, close that range Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock Reviewed-by: Alan Maguire --- Notes: Changes since v4: - Improved commit description to expla

[PATCH v5 4/4] module: add install target for modules.builtin.ranges

2024-07-15 Thread Kris Van Hees
When CONFIG_BUILTIN_MODULE_RANGES is enabled, the modules.builtin.ranges file should be installed in the module install location. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Notes: Changes since v3: - Only install modules.builtin.ranges if CONFIG_BUILTIN_MODULE_RANGES=y

Re: [PATCH v4 2/3] kbuild, kconfig: generate offset range data for builtin modules

2024-08-14 Thread Kris Van Hees
On Tue, Jun 18, 2024 at 11:57:38AM -0700, Luis Chamberlain wrote: > On Fri, Jun 14, 2024 at 01:14:27PM -0400, Kris Van Hees wrote: > > The offset range data for builtin modules is generated using: > > - modules.builtin: associates object files with module names > > - vmlin

Re: [PATCH v4 1/3] kbuild: add mod(name,file)_flags to assembler flags for module objects

2024-08-14 Thread Kris Van Hees
On Fri, Jun 14, 2024 at 02:26:21PM -0400, Steven Rostedt wrote: > On Fri, 14 Jun 2024 14:10:58 -0400 > Kris Van Hees wrote: > > > On Fri, Jun 14, 2024 at 01:46:51PM -0400, Steven Rostedt wrote: > > > On Fri, 14 Jun 2024 13:14:26 -0400 > > > Kris Van Hees wrote

Re: [PATCH v5 1/4] kbuild: add mod(name,file)_flags to assembler flags for module objects

2024-08-14 Thread Kris Van Hees
On Wed, Aug 14, 2024 at 01:17:46PM -0400, Steven Rostedt wrote: > On Mon, 15 Jul 2024 23:10:42 -0400 > Kris Van Hees wrote: > > > As mentioned before, should start off with the goal. > > In order to create the file at build time, modules.builtin.ranges, that >

Re: [PATCH v5 2/4] kbuild, kconfig: generate offset range data for builtin modules

2024-08-14 Thread Kris Van Hees
On Wed, Aug 14, 2024 at 03:04:05PM -0400, Steven Rostedt wrote: > On Mon, 15 Jul 2024 23:10:43 -0400 > Kris Van Hees wrote: > > > The offset range data for builtin modules is generated using: > > - modules.builtin: associates object files with module names > > -

Re: [PATCH v5 3/4] scripts: add verifier script for builtin module range data

2024-08-14 Thread Kris Van Hees
d make it a config option so it can nbe enabled for those who might want to, e.g. for release building? Does that make sense? > On Mon, 15 Jul 2024 23:10:44 -0400 > Kris Van Hees wrote: > > > The modules.builtin.ranges offset range data for builtin modules is > > generated

Re: [PATCH v5 3/4] scripts: add verifier script for builtin module range data

2024-08-14 Thread Kris Van Hees
On Wed, Aug 14, 2024 at 04:16:06PM -0400, Steven Rostedt wrote: > On Wed, 14 Aug 2024 15:59:58 -0400 > Kris Van Hees wrote: > > > > What does this mean? > > > > Hm, this is certainly why the validation script exists. I am surprised, > > though > >

[PATCH v6 0/4] Generate address range data for built-in modules

2024-08-15 Thread Kris Van Hees
modules.builtin.ranges in modules install target Changes since v1: - Renamed CONFIG_BUILTIN_RANGES to CONFIG_BUILTIN_MODULE_RANGES - Moved the config option to the tracers section - 2nd arg to generate_builtin_ranges.awk should be vmlinux.map Kris Van Hees (5): trace: add CONFIG_BUILTIN_MODULE_RANGES

[PATCH v6 1/4] kbuild: add mod(name,file)_flags to assembler flags for module objects

2024-08-15 Thread Kris Van Hees
-off-by: Kris Van Hees Reviewed-by: Steven Rostedt (Google) --- scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index fe3668dc4954..170f462537a8 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib

[PATCH v6 2/4] kbuild, kconfig: generate offset range data for builtin modules

2024-08-15 Thread Kris Van Hees
working on a module(s) range, close that range Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock Reviewed-by: Alan Maguire Reviewed-by: Steven Rostedt (Google) --- Changes since v5: - Removed unnecessary compatibility info from option description. Changes since v4:

[PATCH v6 4/4] module: add install target for modules.builtin.ranges

2024-08-15 Thread Kris Van Hees
When CONFIG_BUILTIN_MODULE_RANGES is enabled, the modules.builtin.ranges file should be installed in the module install location. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Changes since v3: - Only install modules.builtin.ranges if CONFIG_BUILTIN_MODULE_RANGES=y

[PATCH v6 3/4] scripts: add verifier script for builtin module range data

2024-08-15 Thread Kris Van Hees
.*.cmd file used to compile the object as suggested in [0]) - For each symbol in that object, verify that the built-in module association (or lack thereof) matches the annotation given to the symbol. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock

Re: [PATCH v6 2/4] kbuild, kconfig: generate offset range data for builtin modules

2024-08-20 Thread Kris Van Hees
On Sun, Aug 18, 2024 at 03:19:36PM +0900, Masahiro Yamada wrote: > On Fri, Aug 16, 2024 at 12:04???AM Kris Van Hees > wrote: > > > The subject should be: > "kbuild: generate offset range data for builtin modules" > > > (Drop ", kconfig&qu

Re: [PATCH v6 3/4] scripts: add verifier script for builtin module range data

2024-08-20 Thread Kris Van Hees
On Sun, Aug 18, 2024 at 03:40:36PM +0900, Masahiro Yamada wrote: > On Fri, Aug 16, 2024 at 12:04???AM Kris Van Hees > wrote: > > > > The modules.builtin.ranges offset range data for builtin modules is > > generated at compile time based on the list of built-in modules and

[PATCH v7 4/4] module: add install target for modules.builtin.ranges

2024-08-20 Thread Kris Van Hees
When CONFIG_BUILTIN_MODULE_RANGES is enabled, the modules.builtin.ranges file should be installed in the module install location. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Changes since v3: - Only install modules.builtin.ranges if CONFIG_BUILTIN_MODULE_RANGES=y

[PATCH v7 1/4] kbuild: add mod(name,file)_flags to assembler flags for module objects

2024-08-20 Thread Kris Van Hees
-off-by: Kris Van Hees Reviewed-by: Steven Rostedt (Google) --- scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index fe3668dc4954..170f462537a8 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib

[PATCH v7 3/4] scripts: add verifier script for builtin module range data

2024-08-20 Thread Kris Van Hees
.*.cmd file used to compile the object as suggested in [0]) - For each symbol in that object, verify that the built-in module association (or lack thereof) matches the annotation given to the symbol. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock

[PATCH v7 2/4] kbuild: generate offset range data for builtin modules

2024-08-20 Thread Kris Van Hees
If we were working on a module(s) range, close that range Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock Reviewed-by: Alan Maguire Reviewed-by: Steven Rostedt (Google) --- Changes since v6: - Applied Masahiro Yamada's suggestions (Kconfig, makefile, script). C

[PATCH v7 0/4] Generate address range data for built-in modules

2024-08-21 Thread Kris Van Hees
rg to generate_builtin_ranges.awk should be vmlinux.map Kris Van Hees (5): trace: add CONFIG_BUILTIN_MODULE_RANGES option kbuild: generate a linker map for vmlinux.o module: script to generate offset ranges for builtin modules kbuild: generate modules.builtin.ranges when linking the kernel module: add in

[PATCH v8 0/4] Generate address range data for built-in modules

2024-08-22 Thread Kris Van Hees
ES to CONFIG_BUILTIN_MODULE_RANGES - Moved the config option to the tracers section - 2nd arg to generate_builtin_ranges.awk should be vmlinux.map Kris Van Hees (5): trace: add CONFIG_BUILTIN_MODULE_RANGES option kbuild: generate a linker map for vmlinux.o module: script to generate offset r

[PATCH v8 3/4] scripts: add verifier script for builtin module range data

2024-08-22 Thread Kris Van Hees
.*.cmd file used to compile the object as suggested in [0]) - For each symbol in that object, verify that the built-in module association (or lack thereof) matches the annotation given to the symbol. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock

[PATCH v8 4/4] module: add install target for modules.builtin.ranges

2024-08-22 Thread Kris Van Hees
When CONFIG_BUILTIN_MODULE_RANGES is enabled, the modules.builtin.ranges file should be installed in the module install location. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Changes since v3: - Only install modules.builtin.ranges if CONFIG_BUILTIN_MODULE_RANGES=y

[PATCH v8 2/4] kbuild: generate offset range data for builtin modules

2024-08-22 Thread Kris Van Hees
If we were working on a module(s) range, close that range Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock Reviewed-by: Alan Maguire Reviewed-by: Steven Rostedt (Google) --- Changes since v7: - Removed extra close(fn). - Make CONFIG_BUILTIN_MODULE_RANGES depend on !lTO.

[PATCH v8 1/4] kbuild: add mod(name,file)_flags to assembler flags for module objects

2024-08-22 Thread Kris Van Hees
-off-by: Kris Van Hees Reviewed-by: Steven Rostedt (Google) --- scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index fe3668dc4954..170f462537a8 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib

Re: [PATCH v8 2/4] kbuild: generate offset range data for builtin modules

2024-08-23 Thread Kris Van Hees
On Fri, Aug 23, 2024 at 04:53:29PM +, Sami Tolvanen wrote: > Hi Kris, > > On Thu, Aug 22, 2024 at 02:19:39PM -0400, Kris Van Hees wrote: > > diff --git a/scripts/generate_builtin_ranges.awk > > b/scripts/generate_builtin_ranges.awk > > new file mode 10

[PATCH v9 0/4] Generate address range data for built-in modules

2024-08-23 Thread Kris Van Hees
x.map Kris Van Hees (5): trace: add CONFIG_BUILTIN_MODULE_RANGES option kbuild: generate a linker map for vmlinux.o module: script to generate offset ranges for builtin modules kbuild: generate modules.builtin.ranges when linking the kernel module: add install target for modules.builtin.r

[PATCH v9 1/4] kbuild: add mod(name,file)_flags to assembler flags for module objects

2024-08-23 Thread Kris Van Hees
KBUILD_MODFILE is sufficient to generate the modules ranges data, KBUILD_MODNAME is passed as well for consistency with the C source code case. Signed-off-by: Kris Van Hees Reviewed-by: Steven Rostedt (Google) --- Changes since v8: - Fixed typos. - Explained KBUILD_MODNAME being

[PATCH v9 4/4] module: add install target for modules.builtin.ranges

2024-08-23 Thread Kris Van Hees
When CONFIG_BUILTIN_MODULE_RANGES is enabled, the modules.builtin.ranges file should be installed in the module install location. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- Changes since v3: - Only install modules.builtin.ranges if CONFIG_BUILTIN_MODULE_RANGES=y

[PATCH v9 2/4] kbuild: generate offset range data for builtin modules

2024-08-23 Thread Kris Van Hees
rking on a module(s) range, close that range Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock Reviewed-by: Alan Maguire Reviewed-by: Steven Rostedt (Google) --- Changes since v8: - Added support for built-in Rust modules. - Added optional 4th argument to specify kernel build

[PATCH v9 3/4] scripts: add verifier script for builtin module range data

2024-08-23 Thread Kris Van Hees
.*.cmd file used to compile the object as suggested in [0]) - For each symbol in that object, verify that the built-in module association (or lack thereof) matches the annotation given to the symbol. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock

Re: [RFC PATCH 00/11] bpf, trace, dtrace: DTrace BPF program type implementation and sample use

2019-05-21 Thread Kris Van Hees
On Tue, May 21, 2019 at 10:56:18AM -0700, Alexei Starovoitov wrote: > On Mon, May 20, 2019 at 11:47:00PM +0000, Kris Van Hees wrote: > > > > 2. bpf: add BPF_PROG_TYPE_DTRACE > > > > This patch adds BPF_PROG_TYPE_DTRACE as a new BPF program type, without &g

[RFC PATCH 03/11] bpf: export proto for bpf_perf_event_output helper

2019-05-21 Thread Kris Van Hees
(bpf_get_perf_event_output_proto()). Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/linux/bpf.h | 1 + kernel/trace/bpf_trace.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 7a40a3cd7ff2..e4bcb79656c4 100644

[RFC PATCH 04/11] trace: initial implementation of DTrace based on kernel

2019-05-21 Thread Kris Van Hees
into DTRACE BPF program. */ bpf_tail_call(ctx, &progs, 1); /* fall through -> program not found or call failed */ return 0; } This patch also adds DTrace as a new subsystem in the MAINTAINERS file, with me as current maintainer and our development m

[RFC PATCH 06/11] dtrace: tiny userspace tool to exercise DTrace support

2019-05-21 Thread Kris Van Hees
helper (aside from using bpf_probe_read() on an address that is derived from the current task). Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- MAINTAINERS | 1 + tools/dtrace/.gitignore | 1 + tools/dtrace/Makefile | 79 tools/dtrace/dt_bpf.c

[RFC PATCH 07/11] bpf: implement writable buffers in contexts

2019-05-21 Thread Kris Van Hees
pointers to a buffer is cleared, just as it is done for packet pointers. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/linux/bpf.h | 3 + include/linux/bpf_verifier.h | 4 +- kernel/bpf/verifier.c| 198 --- 3 files changed, 1

[RFC PATCH 11/11] dtrace: make use of writable buffers in BPF

2019-05-21 Thread Kris Van Hees
size 0). Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/uapi/linux/dtrace.h | 4 + kernel/trace/dtrace/bpf.c | 150 tools/dtrace/dt_buffer.c| 54 + tools/dtrace/probe1_bpf.c | 47 ++- 4 files changed, 198

[RFC PATCH 09/11] bpf: mark helpers explicitly whether they may change

2019-05-21 Thread Kris Van Hees
. This way, whenever a new helper is added that may change the content of the context, there is no need to update a hardcoded list of functions. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/linux/bpf.h| 1 + include/linux/filter.h | 1 - kernel/bpf/core.c | 5

[RFC PATCH 08/11] perf: add perf_output_begin_forward_in_page

2019-05-21 Thread Kris Van Hees
ge is filled with 0s. A new function perf_output_begin_forward_in_page() is to be used to commence output that cannot cross page boundaries. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/linux/perf_event.h | 3 ++ kernel/events/ring_b

[RFC PATCH 10/11] bpf: add bpf_buffer_reserve and bpf_buffer_commit

2019-05-21 Thread Kris Van Hees
visible to userspace. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/uapi/linux/bpf.h | 39 ++- kernel/bpf/verifier.c | 6 +++- tools/include/uapi/linux/bpf.h| 39 ++- tools/testing/selftests

[RFC PATCH 01/11] bpf: context casting for tail call

2019-05-21 Thread Kris Van Hees
compilation when CONFIG_BPF_SYSCALL=n. Fixed casting issue on platforms with 32-bit pointers. v3: Renamed the new program type operations to be more descriptive. Added finalize_context() helper. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/linux/bpf.h

[RFC PATCH 02/11] bpf: add BPF_PROG_TYPE_DTRACE

2019-05-21 Thread Kris Van Hees
BPF_PROG_TYPE_DTRACE implementation (building not enabled) 3. add the CONFIG_DTRACE option and enable compilation of the prog type implementation The reason for this sequence is to ensure that the kernel tree remains buildable between these commits. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock

[RFC PATCH 05/11] trace: update Kconfig and Makefile to include DTrace

2019-05-21 Thread Kris Van Hees
This commit adds the dtrace implementation in kernel/trace/dtrace to the trace Kconfig and Makefile. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- kernel/trace/Kconfig | 2 ++ kernel/trace/Makefile | 1 + 2 files changed, 3 insertions(+) diff --git a/kernel/trace/Kconfig b/kernel

Re: [RFC PATCH 00/11] bpf, trace, dtrace: DTrace BPF program type implementation and sample use

2019-05-21 Thread Kris Van Hees
As suggested, I resent the patch set as replies to the cover letter post to support threaded access to the patches.

Re: [RFC PATCH 00/11] bpf, trace, dtrace: DTrace BPF program type implementation and sample use

2019-05-21 Thread Kris Van Hees
On Tue, May 21, 2019 at 01:55:34PM -0700, Alexei Starovoitov wrote: > On Tue, May 21, 2019 at 02:41:37PM -0400, Kris Van Hees wrote: > > On Tue, May 21, 2019 at 10:56:18AM -0700, Alexei Starovoitov wrote: > > > On Mon, May 20, 2019 at 11:47:00PM +0000, Kris Van Hees wrote: >

Re: [RFC PATCH 00/11] bpf, trace, dtrace: DTrace BPF program type implementation and sample use

2019-05-21 Thread Kris Van Hees
On Tue, May 21, 2019 at 04:26:19PM -0700, Alexei Starovoitov wrote: > On Tue, May 21, 2019 at 05:36:49PM -0400, Kris Van Hees wrote: > > On Tue, May 21, 2019 at 01:55:34PM -0700, Alexei Starovoitov wrote: > > > On Tue, May 21, 2019 at 02:41:37PM -0400, Kris Van Hees wrote: >

Re: [RFC PATCH 00/11] bpf, trace, dtrace: DTrace BPF program type implementation and sample use

2019-05-21 Thread Kris Van Hees
On Tue, May 21, 2019 at 05:48:11PM -0400, Steven Rostedt wrote: > On Tue, 21 May 2019 14:43:26 -0700 > Alexei Starovoitov wrote: > > > Steve, > > sounds like you've missed all prior threads. > > I probably have missed them ;-) > > > The feedback was given to Kris it was very clear: > > implemen

Re: [RFC PATCH 00/11] bpf, trace, dtrace: DTrace BPF program type implementation and sample use

2019-05-22 Thread Kris Van Hees
On Wed, May 22, 2019 at 04:25:32PM +0200, Peter Zijlstra wrote: > On Tue, May 21, 2019 at 10:56:18AM -0700, Alexei Starovoitov wrote: > > > and no changes are necessary in kernel/events/ring_buffer.c either. > > Let me just NAK them on the principle that I don't see them in my inbox. My apologie

Re: [RFC PATCH 00/11] bpf, trace, dtrace: DTrace BPF program type implementation and sample use

2019-05-22 Thread Kris Van Hees
On Wed, May 22, 2019 at 01:16:25PM -0700, Alexei Starovoitov wrote: > On Wed, May 22, 2019 at 12:12:53AM -0400, Kris Van Hees wrote: > > > > Could you elaborate on why you believe my patches are not adding generic > > features? I can certainly agree that the DTrace-speci

Re: [RFC PATCH 00/11] bpf, trace, dtrace: DTrace BPF program type implementation and sample use

2019-05-22 Thread Kris Van Hees
On Wed, May 22, 2019 at 12:55:27PM -0700, Alexei Starovoitov wrote: > On Wed, May 22, 2019 at 02:22:15PM -0400, Kris Van Hees wrote: > > On Wed, May 22, 2019 at 04:25:32PM +0200, Peter Zijlstra wrote: > > > On Tue, May 21, 2019 at 10:56:18AM -0700, Alexei Starovoitov wrote: >

Re: [RFC PATCH 00/11] bpf, trace, dtrace: DTrace BPF program type implementation and sample use

2019-05-22 Thread Kris Van Hees
On Wed, May 22, 2019 at 01:53:31PM -0700, Alexei Starovoitov wrote: > On Wed, May 22, 2019 at 01:23:27AM -0400, Kris Van Hees wrote: > > > > Userspace aside, there are various features that are not currently available > > such as retrieving the ppid of the current task, a

[RFC PATCH 00/11] bpf, trace, dtrace: DTrace BPF program type implementation and sample use

2019-05-20 Thread Kris Van Hees
This patch set is also available, applied to bpf-next, at the following URL: https://github.com/oracle/dtrace-linux-kernel/tree/dtrace-bpf The patches in this set are part of an larger effort to re-implement DTrace based on existing Linux kernel features wherever possible. This allows ex

[RFC PATCH 08/11] perf: add perf_output_begin_forward_in_page

2019-05-20 Thread Kris Van Hees
ge is filled with 0s. A new function perf_output_begin_forward_in_page() is to be used to commence output that cannot cross page boundaries. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/linux/perf_event.h | 3 ++ kernel/events/ring_b

[RFC PATCH 09/11] bpf: mark helpers explicitly whether they may change the context

2019-05-20 Thread Kris Van Hees
. This way, whenever a new helper is added that may change the content of the context, there is no need to update a hardcoded list of functions. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/linux/bpf.h| 1 + include/linux/filter.h | 1 - kernel/bpf/core.c | 5

[RFC PATCH 07/11] bpf: implement writable buffers in contexts

2019-05-20 Thread Kris Van Hees
pointers to a buffer is cleared, just as it is done for packet pointers. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/linux/bpf.h | 3 + include/linux/bpf_verifier.h | 4 +- kernel/bpf/verifier.c| 198 --- 3 files changed, 1

[RFC PATCH 06/11] dtrace: tiny userspace tool to exercise DTrace support features

2019-05-20 Thread Kris Van Hees
helper (aside from using bpf_probe_read() on an address that is derived from the current task). Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- MAINTAINERS | 1 + tools/dtrace/.gitignore | 1 + tools/dtrace/Makefile | 79 tools/dtrace/dt_bpf.c

[RFC PATCH 10/11] bpf: add bpf_buffer_reserve and bpf_buffer_commit helpers

2019-05-20 Thread Kris Van Hees
visible to userspace. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/uapi/linux/bpf.h | 39 ++- kernel/bpf/verifier.c | 6 +++- tools/include/uapi/linux/bpf.h| 39 ++- tools/testing/selftests

[RFC PATCH 11/11] dtrace: make use of writable buffers in BPF

2019-05-20 Thread Kris Van Hees
size 0). Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/uapi/linux/dtrace.h | 4 + kernel/trace/dtrace/bpf.c | 150 tools/dtrace/dt_buffer.c| 54 + tools/dtrace/probe1_bpf.c | 47 ++- 4 files changed, 198

[RFC PATCH 04/11] trace: initial implementation of DTrace based on kernel facilities

2019-05-20 Thread Kris Van Hees
into DTRACE BPF program. */ bpf_tail_call(ctx, &progs, 1); /* fall through -> program not found or call failed */ return 0; } This patch also adds DTrace as a new subsystem in the MAINTAINERS file, with me as current maintainer and our development m

[RFC PATCH 03/11] bpf: export proto for bpf_perf_event_output helper

2019-05-20 Thread Kris Van Hees
(bpf_get_perf_event_output_proto()). Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/linux/bpf.h | 1 + kernel/trace/bpf_trace.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 7a40a3cd7ff2..e4bcb79656c4 100644

[RFC PATCH 02/11] bpf: add BPF_PROG_TYPE_DTRACE

2019-05-20 Thread Kris Van Hees
BPF_PROG_TYPE_DTRACE implementation (building not enabled) 3. add the CONFIG_DTRACE option and enable compilation of the prog type implementation The reason for this sequence is to ensure that the kernel tree remains buildable between these commits. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock

[RFC PATCH 01/11] bpf: context casting for tail call

2019-05-20 Thread Kris Van Hees
compilation when CONFIG_BPF_SYSCALL=n. Fixed casting issue on platforms with 32-bit pointers. v3: Renamed the new program type operations to be more descriptive. Added finalize_context() helper. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- include/linux/bpf.h

[RFC PATCH 05/11] trace: update Kconfig and Makefile to include DTrace

2019-05-20 Thread Kris Van Hees
This commit adds the dtrace implementation in kernel/trace/dtrace to the trace Kconfig and Makefile. Signed-off-by: Kris Van Hees Reviewed-by: Nick Alcock --- kernel/trace/Kconfig | 2 ++ kernel/trace/Makefile | 1 + 2 files changed, 3 insertions(+) diff --git a/kernel/trace/Kconfig b/kernel

Re: [RFC PATCH 07/11] bpf: implement writable buffers in contexts

2019-05-20 Thread Kris Van Hees
for adding him. I will update my list. Kris > On Mon, 20 May 2019 23:52:24 + (UTC) > Kris Van Hees wrote: > > > Currently, BPF supports writes to packet data in very specific cases. > > The implementation can be of more general use and can be extended to any > > num

  1   2   >