Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1deaa69 authored by Ken Chen's avatar Ken Chen
Browse files

Rename gpu_work.o to gpuWork.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 gpuWork
Change-Id: Ib2c13e11f273af849b04999227804491a7aff8ca
parent 0fffa4df
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -55,6 +55,6 @@ cc_library_shared {
    ],
    required: [
        "bpfloader",
        "gpu_work.o",
        "gpuWork.o",
    ],
}
+4 −4
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@
#include <unordered_set>
#include <vector>

#include "gpuwork/gpu_work.h"
#include "gpuwork/gpuWork.h"

#define ONE_MS_IN_NS (10000000)

@@ -128,11 +128,11 @@ void GpuWork::initialize() {
    {
        std::lock_guard<std::mutex> lock(mMutex);

        if (!getBpfMap("/sys/fs/bpf/map_gpu_work_gpu_work_map", &mGpuWorkMap)) {
        if (!getBpfMap("/sys/fs/bpf/map_gpuWork_gpu_work_map", &mGpuWorkMap)) {
            return;
        }

        if (!getBpfMap("/sys/fs/bpf/map_gpu_work_gpu_work_global_data", &mGpuWorkGlobalDataMap)) {
        if (!getBpfMap("/sys/fs/bpf/map_gpuWork_gpu_work_global_data", &mGpuWorkGlobalDataMap)) {
            return;
        }

@@ -140,7 +140,7 @@ void GpuWork::initialize() {
    }

    // Attach the tracepoint.
    if (!attachTracepoint("/sys/fs/bpf/prog_gpu_work_tracepoint_power_gpu_work_period", "power",
    if (!attachTracepoint("/sys/fs/bpf/prog_gpuWork_tracepoint_power_gpu_work_period", "power",
                          "gpu_work_period")) {
        return;
    }
+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@ package {
}

bpf {
    name: "gpu_work.o",
    srcs: ["gpu_work.c"],
    name: "gpuWork.o",
    srcs: ["gpuWork.c"],
    cflags: [
        "-Wall",
        "-Werror",
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

#include "include/gpuwork/gpu_work.h"
#include "include/gpuwork/gpuWork.h"

#include <linux/bpf.h>
#include <stddef.h>
Loading