From: Kris Van Hees <kris.van.hees@oracle.com>
To: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: [PATCH] bpf: use initializer for dtrace_difo_t *dp
Date: Fri, 9 Jan 2026 16:10:50 -0500 [thread overview]
Message-ID: <b69b05db272a70bc46cc5e64ea1951c2@oracle.com> (raw)
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
libdtrace/dt_bpf.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/libdtrace/dt_bpf.c b/libdtrace/dt_bpf.c
index 82a73414..20365855 100644
--- a/libdtrace/dt_bpf.c
+++ b/libdtrace/dt_bpf.c
@@ -422,12 +422,9 @@ have_helper(uint32_t func_id)
BPF_CALL_HELPER(func_id),
BPF_RETURN()
};
- dtrace_difo_t dp;
+ dtrace_difo_t dp = { insns, NULL, NULL, ARRAY_SIZE(insns) };
int fd;
- dp.dtdo_buf = insns;
- dp.dtdo_len = ARRAY_SIZE(insns);
-
/* If the program loads, we can use the helper. */
fd = dt_bpf_prog_attach(BPF_PROG_TYPE_KPROBE, 0, 0, 0, &dp,
1, log, DT_BPF_LOG_SIZE_SMALL);
@@ -486,12 +483,9 @@ have_attach_type(enum bpf_prog_type ptype, enum bpf_attach_type atype,
BPF_MOV_IMM(BPF_REG_0, 0),
BPF_RETURN()
};
- dtrace_difo_t dp;
+ dtrace_difo_t dp = { insns, NULL, NULL, ARRAY_SIZE(insns) };
int pfd, tfd = -1;
- dp.dtdo_buf = insns;
- dp.dtdo_len = ARRAY_SIZE(insns);
-
pfd = dt_bpf_prog_attach(ptype, atype, 0, btf_id, &dp, 0, NULL, 0);
/* If the program load fails, we cannot iuse the attach type. */
if (pfd < 0)
--
2.51.0
next reply other threads:[~2026-01-16 15:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 21:10 Kris Van Hees [this message]
2026-01-16 20:28 ` [DTrace-devel] [PATCH] bpf: use initializer for dtrace_difo_t *dp Eugene Loh
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=b69b05db272a70bc46cc5e64ea1951c2@oracle.com \
--to=kris.van.hees@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.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