Re: [PATCH bpf-next 1/9] selftests: bpf: move tracing helpers to trace_helper

"Daniel T. Lee" <[email protected]>
Newsgroups org.kernel.vger.xdp-newbies,org.kernel.vger.bpf,org.kernel.vger.netdev
Message-ID <CAEKGpzhCeRZct-zW_DG0Aj_PD1FvtUOzbF5c134wwoGgqgf6rA@mail.gmail.com>
On Wed, Nov 18, 2020 at 10:58 AM Andrii Nakryiko
<[email protected]> wrote:
>
> On Tue, Nov 17, 2020 at 6:57 AM Daniel T. Lee <[email protected]> wrote:
> >
> > Under the samples/bpf directory, similar tracing helpers are
> > fragmented around. To keep consistent of tracing programs, this commit
> > moves the helper and define locations to increase the reuse of each
> > helper function.
> >
> > Signed-off-by: Daniel T. Lee <[email protected]>
> >
> > ---
> > [...]
> > -static void read_trace_pipe2(void)
>
> This is used only in hbm.c, why move it into trace_helpers.c?
>

I think this function can be made into a helper that can be used in
other programs. Which is basically same as 'read_trace_pipe' and
also writes the content of that pipe to file either. Well, it's not used
anywhere else, but I moved this function for the potential of reuse.

Since these 'read_trace_pipe's are helpers that are only used
under samples directory, what do you think about moving these
helpers to something like samples/bpf/trace_pipe.h?

Thanks for your time and effort for the review.

-- 
Best,
Daniel T. Lee
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.