diff options
| author | Puranjay Mohan <puranjay@kernel.org> | 2025-07-24 12:02:53 +0000 |
|---|---|---|
| committer | Daniel Borkmann <daniel@iogearbox.net> | 2025-07-26 21:26:51 +0200 |
| commit | 3ba58312e65665e5b9097c7969a51fa49914d85d (patch) | |
| tree | 13285e99884ccb3ea42f05295f9881f34e50d60e /kernel/bpf/core.c | |
| parent | b114fcee766d5101eada1aca7bb5fd0a86c89b35 (diff) | |
bpf: Move bpf_jit_get_prog_name() to core.c
bpf_jit_get_prog_name() will be used by all JITs when enabling support
for private stack. This function is currently implemented in the x86
JIT.
Move the function to core.c so that other JITs can easily use it in
their implementation of private stack.
Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/bpf/20250724120257.7299-2-puranjay@kernel.org
Diffstat (limited to 'kernel/bpf/core.c')
| -rw-r--r-- | kernel/bpf/core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 61613785bdd0..29c0225c14aa 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -1297,6 +1297,13 @@ int bpf_jit_get_func_addr(const struct bpf_prog *prog, return 0; } +const char *bpf_jit_get_prog_name(struct bpf_prog *prog) +{ + if (prog->aux->ksym.prog) + return prog->aux->ksym.name; + return prog->aux->name; +} + static int bpf_jit_blind_insn(const struct bpf_insn *from, const struct bpf_insn *aux, struct bpf_insn *to_buff, |