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

Commit 2a6ea2ce authored by Motomu Utsumi's avatar Motomu Utsumi
Browse files

Add libbpf_prog gpuMem.bpf target

This is a preparation for migrating to the Rust platform bpfloader.

Flag: gpuMem.bpf is not used
Bug: 410982483
Test: m gpuMem.bpf
Flag: EXEMPT gpuMem.bpf is not used
Change-Id: Ie460d666b7a6e531a513bbb0656eee34848ecef6
parent 9384f33a
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -24,4 +24,15 @@ package {
bpf {
    name: "gpuMem.o",
    srcs: ["gpuMem.c"],
    include_dirs: [
        "system/bpf/include/defs",
    ],
}

libbpf_prog {
    name: "gpuMem.bpf",
    srcs: ["gpuMem.c"],
    header_libs: [
        "android_bpf_defs",
    ],
}
+7 −2
Original line number Diff line number Diff line
@@ -14,7 +14,11 @@
 * limitations under the License.
 */

#include <bpf_helpers.h>
#include <android_bpf_defs.h>

#ifdef ENABLE_LIBBPF
#include <stdint.h>
#endif  // ENABLE_LIBBPF

/*
 * On Android the number of active processes using gpu is limited.
@@ -48,7 +52,8 @@ struct gpu_mem_total_args {
 * Pass AID_GRAPHICS as gid since gpuservice is in the graphics group.
 * Upon seeing size 0, the corresponding KEY needs to be cleaned up.
 */
DEFINE_BPF_PROG("tracepoint/gpu_mem/gpu_mem_total", AID_ROOT, AID_GRAPHICS, tp_gpu_mem_total)
DEFINE_BPF_PROG("tracepoint/gpu_mem/gpu_mem_total", AID_ROOT, AID_GRAPHICS,
                tracepoint_gpu_mem_gpu_mem_total)
(struct gpu_mem_total_args* args) {
    uint64_t key = 0;
    uint64_t cur_val = 0;