Re: [PATCH v4 1/4] tracing: sorttable: Add a tracepoint verification check at build time

From: Steven Rostedt
Date: Wed Jul 23 2025 - 18:47:54 EST


On Wed, 23 Jul 2025 15:33:16 -0700
Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> > I could probably take some of the sorttable.c elf parsing and move that
> > into a header that would share the code.
>
> Hmm. Why not just make sorttable then use vmlinux.o?
>
> No need to do it twice. Can't you just work on the original object
> file before re-linking?

I believe the sorttable code needs vmlinux to be finished linked, otherwise
it needs to handle all the relocations in vmlinux.o

$ readelf -r vmlinux

There are no relocations in this file.

Compared to:

$ readelf -r vmlinux.o| wc -l
22449337

But we are looking at moving the fix-ups of the event format files from
boot time into build time. That is, currently at boot, the enum strings
are converted to their numbers and some expanded tags from PAHOLE_TAG gets
removed from the format files to not confuse the parsers.

The sorttable.c should be just that, code to sort Linux tables. I think
adding the tracepoint check to it was a bit of a hack. Perhaps it should
have its own program that focuses on tracepoint changes.

Thus it could find unused trace points and fix up the format strings. I'm
not sure how bad the relocations not being resolved will affect that though.

-- Steve