[DTrace-devel] [PATCH 1.5/3] Remove unused map-of-maps functions

eugene.loh at oracle.com eugene.loh at oracle.com
Thu May 1 18:37:59 UTC 2025


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

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
 libdtrace/dt_bpf.c | 57 ----------------------------------------------
 libdtrace/dt_bpf.h |  5 ----
 2 files changed, 62 deletions(-)

diff --git a/libdtrace/dt_bpf.c b/libdtrace/dt_bpf.c
index 635780738..4e4b6eb87 100644
--- a/libdtrace/dt_bpf.c
+++ b/libdtrace/dt_bpf.c
@@ -341,63 +341,6 @@ dt_bpf_map_update(int fd, const void *key, const void *val)
 	return dt_bpf(BPF_MAP_UPDATE_ELEM, &attr);
 }
 
-/*
- * Retrieve the fd for a map-in-map, i.e. map[okey] which is the fd of a map.
- *
- * Note: the caller is responsible for closing the fd.
- */
-int
-dt_bpf_map_lookup_fd(int fd, const void *okey)
-{
-	uint32_t	id;
-
-	if (dt_bpf_map_lookup(fd, okey, &id) < 0)
-		return -1;
-
-	return dt_bpf_map_get_fd_by_id(id);
-}
-
-/*
- * Retrieve the value in a map-of-maps, i.e. map[okey][ikey].
- */
-int
-dt_bpf_map_lookup_inner(int fd, const void *okey, const void *ikey, void *val)
-{
-	int		rc;
-
-	fd = dt_bpf_map_lookup_fd(fd, okey);
-	if (fd < 0)
-		return -1;
-
-	rc = dt_bpf_map_lookup(fd, ikey, val);
-	close(fd);
-
-	return rc;
-}
-
-/*
- * Store the value in a map-of-maps, i.e. map[okey][ikey] = value.
- */
-int
-dt_bpf_map_update_inner(int fd, const void *okey, const void *ikey,
-			const void *val)
-{
-	uint32_t	id;
-	int		rc;
-
-	if (dt_bpf_map_lookup(fd, okey, &id) < 0)
-		return -1;
-
-	fd = dt_bpf_map_get_fd_by_id(id);
-	if (fd < 0)
-		return -1;
-
-	rc = dt_bpf_map_update(fd, ikey, val);
-	close(fd);
-
-	return rc;
-}
-
 /*
  * Associate a BPF program (by fd) with a raw tracepoint.
  */
diff --git a/libdtrace/dt_bpf.h b/libdtrace/dt_bpf.h
index e03c5c6d9..43fb2233e 100644
--- a/libdtrace/dt_bpf.h
+++ b/libdtrace/dt_bpf.h
@@ -80,11 +80,6 @@ extern int dt_bpf_map_next_key(int fd, const void *key, void *nxt);
 extern int dt_bpf_map_update(int fd, const void *key, const void *val);
 extern int dt_bpf_map_delete(int fd, const void *key);
 extern int dt_bpf_map_get_fd_by_id(uint32_t id);
-extern int dt_bpf_map_lookup_fd(int fd, const void *okey);
-extern int dt_bpf_map_lookup_inner(int fd, const void *okey, const void *ikey,
-				   void *val);
-extern int dt_bpf_map_update_inner(int fd, const void *okey, const void *ikey,
-				   const void *val);
 extern int dt_bpf_prog_attach(enum bpf_prog_type ptype,
 			      enum bpf_attach_type atype, int btf_fd,
 			      uint32_t btf_id, const dtrace_difo_t *dp,
-- 
2.43.5




More information about the DTrace-devel mailing list