* Question about redundant copies of json-writer.c
@ 2026-02-18 18:11 Jarkko Sakkinen
0 siblings, 0 replies; only message in thread
From: Jarkko Sakkinen @ 2026-02-18 18:11 UTC (permalink / raw)
To: Shuah Khan; +Cc: linux-kselftest, linux-kernel, bpf
Hi Shuah,
I'm working on a kernel patch set where I need to write JSON.
After looking around a bit, I found this C-module with multiple
redundant copies scattered around tools/:
❯ find -name json_writer.[ch]
./tools/testing/selftests/bpf/json_writer.h
./tools/testing/selftests/bpf/json_writer.c
./tools/bpf/bpftool/json_writer.h
./tools/bpf/bpftool/json_writer.c
./tools/net/ynl/ynltool/json_writer.h
./tools/net/ynl/ynltool/json_writer.c
My (arbitrary) guess is that one in bpftool is the main copy.
Ssince the module is self-contained, I'm dilating towards doing this:
$(OUTPUT)/kcontainerd: kcontainerd.c ../../../bpf/bpftool/json_writer.c \
../../../bpf/bpftool/json_writer.h
$(CC) $(CFLAGS) $< ../../../bpf/bpftool/json_writer.c -o $@
(and in kcontainerd.c #include "../../../bpf/bpftool/json_writer.h")
I'm just sanity checking this given that json_writer is utilized with
a different pattern :-)
BR, Jarkko
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-02-18 18:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-18 18:11 Question about redundant copies of json-writer.c Jarkko Sakkinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox