Generate vmlinux.h from the kernel prebuilt vmlinux Bug: 421990777 Test: Manual; build bpf prog with "vmlinux_h_6_1" header Change-Id: Ib1b7a24c470610ea6d1ee6c84f1c656e7139340b Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
157 lines
4.7 KiB
Text
157 lines
4.7 KiB
Text
// Copyright (C) 2025 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.
|
|
|
|
genrule {
|
|
name: "vmlinux_h_6_12_arm64",
|
|
cmd: "mkdir -p $(genDir)/6.12/arm64 && $(location bpftool) btf dump file $(location :vmlinux_6_12_arm64) format c > $(genDir)/6.12/arm64/vmlinux.h",
|
|
srcs: [
|
|
":vmlinux_6_12_arm64",
|
|
],
|
|
tools: ["bpftool"],
|
|
out: [
|
|
"6.12/arm64/vmlinux.h",
|
|
],
|
|
export_include_dirs: ["6.12/arm64"],
|
|
}
|
|
|
|
genrule {
|
|
name: "vmlinux_h_6_12_x86_64",
|
|
cmd: "mkdir -p $(genDir)/6.12/x86_64 && $(location bpftool) btf dump file $(location :vmlinux_6_12_x86_64) format c > $(genDir)/6.12/x86_64/vmlinux.h",
|
|
srcs: [
|
|
":vmlinux_6_12_x86_64",
|
|
],
|
|
tools: ["bpftool"],
|
|
out: [
|
|
"6.12/x86_64/vmlinux.h",
|
|
],
|
|
export_include_dirs: ["6.12/x86_64"],
|
|
}
|
|
|
|
cc_library_headers {
|
|
name: "vmlinux_h_6_12",
|
|
arch: {
|
|
arm: {
|
|
generated_headers: ["vmlinux_h_6_12_arm64"],
|
|
export_generated_headers: ["vmlinux_h_6_12_arm64"],
|
|
},
|
|
arm64: {
|
|
generated_headers: ["vmlinux_h_6_12_arm64"],
|
|
export_generated_headers: ["vmlinux_h_6_12_arm64"],
|
|
},
|
|
x86: {
|
|
generated_headers: ["vmlinux_h_6_12_x86_64"],
|
|
export_generated_headers: ["vmlinux_h_6_12_x86_64"],
|
|
},
|
|
x86_64: {
|
|
generated_headers: ["vmlinux_h_6_12_x86_64"],
|
|
export_generated_headers: ["vmlinux_h_6_12_x86_64"],
|
|
},
|
|
},
|
|
}
|
|
|
|
genrule {
|
|
name: "vmlinux_h_6_6_arm64",
|
|
cmd: "mkdir -p $(genDir)/6.6/arm64 && $(location bpftool) btf dump file $(location :vmlinux_6_6_arm64) format c > $(genDir)/6.6/arm64/vmlinux.h",
|
|
srcs: [
|
|
":vmlinux_6_6_arm64",
|
|
],
|
|
tools: ["bpftool"],
|
|
out: [
|
|
"6.6/arm64/vmlinux.h",
|
|
],
|
|
export_include_dirs: ["6.6/arm64"],
|
|
}
|
|
|
|
genrule {
|
|
name: "vmlinux_h_6_6_x86_64",
|
|
cmd: "mkdir -p $(genDir)/6.6/x86_64 && $(location bpftool) btf dump file $(location :vmlinux_6_6_x86_64) format c > $(genDir)/6.6/x86_64/vmlinux.h",
|
|
srcs: [
|
|
":vmlinux_6_6_x86_64",
|
|
],
|
|
tools: ["bpftool"],
|
|
out: [
|
|
"6.6/x86_64/vmlinux.h",
|
|
],
|
|
export_include_dirs: ["6.6/x86_64"],
|
|
}
|
|
|
|
cc_library_headers {
|
|
name: "vmlinux_h_6_6",
|
|
arch: {
|
|
arm: {
|
|
generated_headers: ["vmlinux_h_6_6_arm64"],
|
|
export_generated_headers: ["vmlinux_h_6_6_arm64"],
|
|
},
|
|
arm64: {
|
|
generated_headers: ["vmlinux_h_6_6_arm64"],
|
|
export_generated_headers: ["vmlinux_h_6_6_arm64"],
|
|
},
|
|
x86: {
|
|
generated_headers: ["vmlinux_h_6_6_x86_64"],
|
|
export_generated_headers: ["vmlinux_h_6_6_x86_64"],
|
|
},
|
|
x86_64: {
|
|
generated_headers: ["vmlinux_h_6_6_x86_64"],
|
|
export_generated_headers: ["vmlinux_h_6_6_x86_64"],
|
|
},
|
|
},
|
|
}
|
|
|
|
genrule {
|
|
name: "vmlinux_h_6_1_arm64",
|
|
cmd: "mkdir -p $(genDir)/6.1/arm64 && $(location bpftool) btf dump file $(location :vmlinux_6_1_arm64) format c > $(genDir)/6.1/arm64/vmlinux.h",
|
|
srcs: [
|
|
":vmlinux_6_1_arm64",
|
|
],
|
|
tools: ["bpftool"],
|
|
out: [
|
|
"6.1/arm64/vmlinux.h",
|
|
],
|
|
export_include_dirs: ["6.1/arm64"],
|
|
}
|
|
|
|
genrule {
|
|
name: "vmlinux_h_6_1_x86_64",
|
|
cmd: "mkdir -p $(genDir)/6.1/x86_64 && $(location bpftool) btf dump file $(location :vmlinux_6_1_x86_64) format c > $(genDir)/6.1/x86_64/vmlinux.h",
|
|
srcs: [
|
|
":vmlinux_6_1_x86_64",
|
|
],
|
|
tools: ["bpftool"],
|
|
out: [
|
|
"6.1/x86_64/vmlinux.h",
|
|
],
|
|
export_include_dirs: ["6.1/x86_64"],
|
|
}
|
|
|
|
cc_library_headers {
|
|
name: "vmlinux_h_6_1",
|
|
arch: {
|
|
arm: {
|
|
generated_headers: ["vmlinux_h_6_1_arm64"],
|
|
export_generated_headers: ["vmlinux_h_6_1_arm64"],
|
|
},
|
|
arm64: {
|
|
generated_headers: ["vmlinux_h_6_1_arm64"],
|
|
export_generated_headers: ["vmlinux_h_6_1_arm64"],
|
|
},
|
|
x86: {
|
|
generated_headers: ["vmlinux_h_6_1_x86_64"],
|
|
export_generated_headers: ["vmlinux_h_6_1_x86_64"],
|
|
},
|
|
x86_64: {
|
|
generated_headers: ["vmlinux_h_6_1_x86_64"],
|
|
export_generated_headers: ["vmlinux_h_6_1_x86_64"],
|
|
},
|
|
},
|
|
}
|