From 4c18e91f22652f9a1e27bbbad8d0cfd81994ce52 Mon Sep 17 00:00:00 2001 From: Ken Chen Date: Fri, 8 Jul 2022 19:09:50 +0800 Subject: [PATCH] Rename gpu_mem.o to gpuMem.o Underscore character may cause bpf prog/map naming collision. For example, x.o with map y_z and x_y.o with map z both result in x_y_z prog/map name, which should be prevented during compile-time. aosp/2147825 will prohibit underscore character in bpf source name (source name derives the obj name). Existing bpf modules with underscore characters in source name need to be updated accordingly. Bug: 236706995 Test: adb root; adb shell ls -l /sys/fs/bpf/ | grep gpuMem Change-Id: I213624e59ce1bca6ee7c22028504f2d51e9c50df --- lmkd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmkd.cpp b/lmkd.cpp index d885a2d..c26f68f 100644 --- a/lmkd.cpp +++ b/lmkd.cpp @@ -1828,7 +1828,7 @@ static bool meminfo_parse_line(char *line, union meminfo *mi) { static int64_t read_gpu_total_kb() { static int fd = android::bpf::bpfFdGet( - "/sys/fs/bpf/map_gpu_mem_gpu_mem_total_map", BPF_F_RDONLY); + "/sys/fs/bpf/map_gpuMem_gpu_mem_total_map", BPF_F_RDONLY); static constexpr uint64_t kBpfKeyGpuTotalUsage = 0; uint64_t value;