GPU Memory: add bpf c program for gpu_mem/gpu_mem_total tracepoint
This change implements the bpf map and program to be attached to
gpu_mem/gpu_mem_total tracepoint. Access groups of both the map and the
program are setup properly for gpuservice.
Bug: 154524735
Test: After requiring gpu_mem.o, the below should exist
1. /system/etc/bpf/gpu_mem.o
2. /sys/fs/bpf/map_gpu_mem_gpu_mem_total_map
3. /sys/fs/bpf/prog_gpu_mem_tracepoint_gpu_mem_gpu_mem_total
Change-Id: Ic09cdfbbbd5de82920cba7b96045891b81a2ecf1
diff --git a/services/gpuservice/bpfprogs/Android.bp b/services/gpuservice/bpfprogs/Android.bp
new file mode 100644
index 0000000..b875814
--- /dev/null
+++ b/services/gpuservice/bpfprogs/Android.bp
@@ -0,0 +1,22 @@
+// Copyright 2020 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+bpf {
+ name: "gpu_mem.o",
+ srcs: ["gpu_mem.c"],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
+}