[DTrace-devel] [PATCH 10/12] cg: make bpf_ldst_size() available outside dt_cg.c

Kris Van Hees kris.van.hees at oracle.com
Sat Jan 6 06:54:36 UTC 2024


On Sat, Jan 06, 2024 at 01:11:35AM -0500, Eugene Loh via DTrace-devel wrote:
> Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
> 
> Does the dt_cg.h Copyright year need to be touched?

[09/12] already took care of that.

> Also (I have no strong feelings on this one) isn't it weird to have one
> function in dt_cg.h that isn't prefixed dt_cg_?

It is a bit weird, but oh well.  Naming is hard.  It really is a bpf-specific
function more than a cg-specific function.

> On 1/5/24 00:31, Kris Van Hees via DTrace-devel wrote:
> > Some provider trampoline generation code needs this.
> 
> I'd be fine dropping that sentence.  It doesn't seem to add much.

Sure.

> > Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> > ---
> >   libdtrace/dt_cg.c | 2 +-
> >   libdtrace/dt_cg.h | 1 +
> >   2 files changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libdtrace/dt_cg.c b/libdtrace/dt_cg.c
> > index 06565616..8ade1eb1 100644
> > --- a/libdtrace/dt_cg.c
> > +++ b/libdtrace/dt_cg.c
> > @@ -52,7 +52,7 @@ static void dt_cg_check_notnull(dt_irlist_t *dlp, dt_regset_t *drp, int reg);
> >    * does not map to a valid BPF instruction size specifier, an internal error is
> >    * reported.
> >    */
> > -static uint_t
> > +uint_t
> >   bpf_ldst_size(ssize_t size, int store)
> >   {
> >   	switch (size) {
> > diff --git a/libdtrace/dt_cg.h b/libdtrace/dt_cg.h
> > index eb02bc93..3d0f3618 100644
> > --- a/libdtrace/dt_cg.h
> > +++ b/libdtrace/dt_cg.h
> > @@ -42,6 +42,7 @@ extern int dt_cg_ctf_offsetof(const char *structname, const char *membername,
> >   			      size_t *sizep, int relaxed);
> >   extern uint_t dt_cg_ldsize(dt_node_t *dnp, ctf_file_t *ctfp, ctf_id_t type,
> >   			 ssize_t *ret_size);
> > +extern uint_t bpf_ldst_size(ssize_t size, int store);
> >   #ifdef	__cplusplus
> >   }
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list