From: Jarkko Sakkinen <jarkko@kernel.org>
To: Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org
Subject: Question about redundant copies of json-writer.c
Date: Wed, 18 Feb 2026 20:11:00 +0200 [thread overview]
Message-ID: <aZYAtL4Nd3LG8wHb@kernel.org> (raw)
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
reply other threads:[~2026-02-18 18:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aZYAtL4Nd3LG8wHb@kernel.org \
--to=jarkko@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.