[DTrace-devel] [PATCH 12/19] Increase size of BPF probes map

eugene.loh at oracle.com eugene.loh at oracle.com
Thu Aug 29 05:25:51 UTC 2024


From: Eugene Loh <eugene.loh at oracle.com>

We are going to support discovery of new probes after dtrace is
launched.  For example, there could be a pid or USDT probe with a
wildcard pid specification that could be matched by a process that
has not yet started.  Or, a process could load a shared library.

This means the probe map will have to grow.  For now, just wire in
some headroom, as ugly a hack as this is.

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
 libdtrace/dt_bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libdtrace/dt_bpf.c b/libdtrace/dt_bpf.c
index 70803e3c..75e48962 100644
--- a/libdtrace/dt_bpf.c
+++ b/libdtrace/dt_bpf.c
@@ -920,7 +920,7 @@ gmap_create_probes(dtrace_hdl_t *dtp)
 
 	fd = create_gmap(dtp, "probes", BPF_MAP_TYPE_HASH, sizeof(uint32_t),
 			 sizeof(dt_bpf_probe_t),
-			 dt_list_length(&dtp->dt_enablings));
+			 dt_list_length(&dtp->dt_enablings) + 1000);
 	if (fd == -1)
 		return -1;
 
-- 
2.43.5




More information about the DTrace-devel mailing list