[PATCH bpf-next v2 11/16] perf: Use bpf_{btf,link,map,prog}_get_info_by_fd()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use the new type-safe wrappers around bpf_obj_get_info_by_fd().

Signed-off-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>
---
 tools/perf/util/bpf-utils.c   | 4 ++--
 tools/perf/util/bpf_counter.c | 2 +-
 tools/perf/util/bpf_counter.h | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/bpf-utils.c b/tools/perf/util/bpf-utils.c
index 80b1d2b3729b..a4154199f56c 100644
--- a/tools/perf/util/bpf-utils.c
+++ b/tools/perf/util/bpf-utils.c
@@ -121,7 +121,7 @@ get_bpf_prog_info_linear(int fd, __u64 arrays)
 		return ERR_PTR(-EINVAL);
 
 	/* step 1: get array dimensions */
-	err = bpf_obj_get_info_by_fd(fd, &info, &info_len);
+	err = bpf_prog_get_info_by_fd(fd, &info, &info_len);
 	if (err) {
 		pr_debug("can't get prog info: %s", strerror(errno));
 		return ERR_PTR(-EFAULT);
@@ -183,7 +183,7 @@ get_bpf_prog_info_linear(int fd, __u64 arrays)
 	}
 
 	/* step 5: call syscall again to get required arrays */
-	err = bpf_obj_get_info_by_fd(fd, &info_linear->info, &info_len);
+	err = bpf_prog_get_info_by_fd(fd, &info_linear->info, &info_len);
 	if (err) {
 		pr_debug("can't get prog info: %s", strerror(errno));
 		free(info_linear);
diff --git a/tools/perf/util/bpf_counter.c b/tools/perf/util/bpf_counter.c
index eeee899fcf34..5826a1073cf6 100644
--- a/tools/perf/util/bpf_counter.c
+++ b/tools/perf/util/bpf_counter.c
@@ -304,7 +304,7 @@ static bool bperf_attr_map_compatible(int attr_map_fd)
 	__u32 map_info_len = sizeof(map_info);
 	int err;
 
-	err = bpf_obj_get_info_by_fd(attr_map_fd, &map_info, &map_info_len);
+	err = bpf_map_get_info_by_fd(attr_map_fd, &map_info, &map_info_len);
 
 	if (err)
 		return false;
diff --git a/tools/perf/util/bpf_counter.h b/tools/perf/util/bpf_counter.h
index c6d21c07b14c..c071e9444395 100644
--- a/tools/perf/util/bpf_counter.h
+++ b/tools/perf/util/bpf_counter.h
@@ -97,7 +97,7 @@ static inline __u32 bpf_link_get_id(int fd)
 	struct bpf_link_info link_info = { .id = 0, };
 	__u32 link_info_len = sizeof(link_info);
 
-	bpf_obj_get_info_by_fd(fd, &link_info, &link_info_len);
+	bpf_link_get_info_by_fd(fd, &link_info, &link_info_len);
 	return link_info.id;
 }
 
@@ -106,7 +106,7 @@ static inline __u32 bpf_link_get_prog_id(int fd)
 	struct bpf_link_info link_info = { .id = 0, };
 	__u32 link_info_len = sizeof(link_info);
 
-	bpf_obj_get_info_by_fd(fd, &link_info, &link_info_len);
+	bpf_link_get_info_by_fd(fd, &link_info, &link_info_len);
 	return link_info.prog_id;
 }
 
@@ -115,7 +115,7 @@ static inline __u32 bpf_map_get_id(int fd)
 	struct bpf_map_info map_info = { .id = 0, };
 	__u32 map_info_len = sizeof(map_info);
 
-	bpf_obj_get_info_by_fd(fd, &map_info, &map_info_len);
+	bpf_map_get_info_by_fd(fd, &map_info, &map_info_len);
 	return map_info.id;
 }
 
-- 
2.39.1




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux