From: Charlie Jenkins <charlie@rivosinc.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH v2 2/8] libbpf: Move opts code into dedicated header
Date: Mon, 29 Jul 2024 12:46:31 -0700 [thread overview]
Message-ID: <Zqfxl82VCxUUi3R+@ghost> (raw)
In-Reply-To: <CAEf4BzZ9B=CPuti9smOqDKD1dRvs3Ug7h9pHupr6jFeKEppJ4g@mail.gmail.com>
On Mon, Jul 29, 2024 at 11:59:47AM -0700, Andrii Nakryiko wrote:
> On Mon, Jul 29, 2024 at 10:55 AM Charlie Jenkins <charlie@rivosinc.com> wrote:
> >
> > On Mon, Jul 29, 2024 at 10:01:05AM -0700, Andrii Nakryiko wrote:
> > > On Mon, Jul 29, 2024 at 9:46 AM Charlie Jenkins <charlie@rivosinc.com> wrote:
> > > >
> > > > Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> > > > ---
> > > > tools/include/tools/opts.h | 68 +++++++++++++++++++++++++++++++++++++++++
> > > > tools/lib/bpf/bpf.c | 1 +
> > > > tools/lib/bpf/btf.c | 1 +
> > > > tools/lib/bpf/btf_dump.c | 1 +
> > > > tools/lib/bpf/libbpf.c | 3 +-
> > > > tools/lib/bpf/libbpf_internal.h | 48 -----------------------------
> > > > tools/lib/bpf/linker.c | 1 +
> > > > tools/lib/bpf/netlink.c | 1 +
> > > > tools/lib/bpf/ringbuf.c | 1 +
> > > > 9 files changed, 76 insertions(+), 49 deletions(-)
> > > >
> > >
> > > Nope, sorry, I don't think I want to do this for libbpf. This will
> > > just make Github synchronization trickier, and I don't really see a
> > > point.
> > >
> > > I'm totally fine with libperf making a copy of these helpers, though
> > > (this is not complicated or tricky code). I also don't think it will
> > > change much, so there is little risk of any sort of divergence.
> >
> > I did this because there were two comments on the previous version of
> > this patch that asked to change the functions that were copied over. I
> > had a couple of choices, have the implementations diverge, not change
> > the implementation in perf to keep it the same as bpf, update both perf
> > and bpf, or share the implementations. I figured the last option was the
> > best to avoid immediate divergence. However, both of the comments can be
> > safely ignored, and also perhaps divergence doesn't matter.
> >
>
> I mean, feel free to diverge. First and foremost the code has to make
> sense to specific library and specific use case. If libperf has some
> extra things that it needs to enforce or check, by all means. I just
> want to avoid unnecessary code sharing, given the code isn't tricky or
> complicated, but will complicate libbpf's sync story to Github (libbpf
> kind of lives in two places, kernel repo and Github repo).
Alright, I like to avoid copy-pasting code but if that's what is
required I will do that.
>
> > - Charlie
> >
> > >
> > > [...]
next prev parent reply other threads:[~2024-07-29 19:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-27 5:29 [PATCH v2 0/8] libperf: Add interface for overflow check of sampling events Charlie Jenkins
2024-07-27 5:29 ` [PATCH v2 1/8] libperf: Move 'open_flags' from tools/perf to evsel::open_flags Charlie Jenkins
2024-07-27 5:29 ` [PATCH v2 2/8] libbpf: Move opts code into dedicated header Charlie Jenkins
2024-07-29 17:01 ` Andrii Nakryiko
2024-07-29 17:55 ` Charlie Jenkins
2024-07-29 18:59 ` Andrii Nakryiko
2024-07-29 19:46 ` Charlie Jenkins [this message]
2024-07-27 5:29 ` [PATCH v2 3/8] libperf: Introduce perf_{evsel, evlist}__open_opt with extensible struct opts Charlie Jenkins
2024-07-27 5:29 ` [PATCH v2 4/8] libperf: Add support for overflow handling of sampling events Charlie Jenkins
2024-07-27 5:29 ` [PATCH v2 5/8] libperf: Add perf_evsel__has_fd() functions Charlie Jenkins
2024-07-27 5:29 ` [PATCH v2 6/8] libperf: Add perf_evsel__{refresh, period}() functions Charlie Jenkins
2024-07-27 5:29 ` [PATCH v2 7/8] libperf test: Add test_stat_overflow() Charlie Jenkins
2024-07-27 5:29 ` [PATCH v2 8/8] libperf test: Add test_stat_overflow_event() Charlie Jenkins
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=Zqfxl82VCxUUi3R+@ghost \
--to=charlie@rivosinc.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=irogers@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=martin.lau@linux.dev \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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 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).