linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/4] Introduce uts_release
@ 2024-01-31 10:48 John Garry
  2024-01-31 10:48 ` [PATCH RFC 1/4] init: Add uts_release John Garry
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: John Garry @ 2024-01-31 10:48 UTC (permalink / raw)
  To: mcgrof, russ.weight, gregkh, rafael, rostedt, mhiramat,
	mathieu.desnoyers, davem, edumazet, kuba, pabeni, keescook,
	masahiroy, nathan, nicolas
  Cc: linux-kernel, linux-trace-kernel, netdev, linux-kbuild,
	John Garry

When hacking it is a waste of time and compute energy that we need to
rebuild much kernel code just for changing the head git commit, like this:

> touch include/generated/utsrelease.h 
> time make  -j3
mkdir -p /home/john/mnt_sda4/john/kernel-dev2/tools/objtool && make O=/home/john/mnt_sda4/john/kernel-dev2 subdir=tools/objtool --no-print-directory -C objtool 
  INSTALL libsubcmd_headers
  CALL    scripts/checksyscalls.sh
  CC      init/version.o
  AR      init/built-in.a
  CC      kernel/sys.o
  CC      kernel/module/main.o
  AR      kernel/module/built-in.a
  CC      drivers/base/firmware_loader/main.o
  CC      kernel/trace/trace.o
  AR      drivers/base/firmware_loader/built-in.a
  AR      drivers/base/built-in.a
  CC      net/ethtool/ioctl.o
  AR      kernel/trace/built-in.a
  AR      kernel/built-in.a
  AR      net/ethtool/built-in.a
  AR      net/built-in.a
  AR      drivers/built-in.a
  AR      built-in.a
  ...

Files like drivers/base/firmware_loader/main.c needs to be recompiled as
it includes generated/utsrelease.h for UTS_RELEASE macro, and utsrelease.h
is regenerated when the head commit changes.

Introduce global char uts_release[] in init/version.c, which this
mentioned code can use instead of UTS_RELEASE, meaning that we don't need
to rebuild for changing the head commit - only init/version.c needs to be
rebuilt. Whether all the references to UTS_RELEASE in the codebase are
proper is a different matter.

For an x86_64 defconfig build for this series on my old laptop, here is
before and after rebuild time:

before:
real    0m53.591s
user    1m1.842s
sys     0m9.161s

after:
real    0m37.481s
user    0m46.461s
sys     0m7.199s

Sending as an RFC as I need to test more of the conversions and I would
like to also convert more UTS_RELEASE users to prove this is proper
approach.

John Garry (4):
  init: Add uts_release
  tracing: Use uts_release
  net: ethtool: Use uts_release
  firmware_loader: Use uts_release

 drivers/base/firmware_loader/main.c | 39 +++++++++++++++++++++++------
 include/linux/utsname.h             |  1 +
 init/version.c                      |  3 +++
 kernel/trace/trace.c                |  4 +--
 net/ethtool/ioctl.c                 |  4 +--
 5 files changed, 39 insertions(+), 12 deletions(-)

-- 
2.35.3


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-02-21 11:51 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-31 10:48 [PATCH RFC 0/4] Introduce uts_release John Garry
2024-01-31 10:48 ` [PATCH RFC 1/4] init: Add uts_release John Garry
2024-01-31 10:48 ` [PATCH RFC 2/4] tracing: Use uts_release John Garry
2024-01-31 19:27   ` Steven Rostedt
2024-01-31 10:48 ` [PATCH RFC 3/4] net: ethtool: " John Garry
2024-01-31 19:24   ` Jakub Kicinski
2024-02-01 12:57     ` John Garry
2024-02-01 13:20       ` Jiri Pirko
2024-02-01 16:09         ` Jakub Kicinski
2024-02-01 16:20           ` John Garry
2024-01-31 10:48 ` [PATCH RFC 4/4] firmware_loader: " John Garry
2024-01-31 16:22 ` [PATCH RFC 0/4] Introduce uts_release Greg KH
2024-01-31 17:16   ` John Garry
2024-01-31 21:26     ` Greg KH
2024-02-02 15:01 ` Masahiro Yamada
2024-02-02 18:29   ` Jakub Kicinski
2024-02-05  8:25   ` John Garry
2024-02-05 23:10     ` Masahiro Yamada
2024-02-08 10:08       ` John Garry
2024-02-21  9:00         ` John Garry
2024-02-21 11:50           ` Masahiro Yamada

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).