[PATCHv3,bpf-next,4/9] bpf: Switch BUILD_ID_SIZE_MAX to enum

Message ID 20230316170149.4106586-5-jolsa@kernel.org
State New
Headers
Series mm/bpf/perf: Store build id in file object |

Commit Message

Jiri Olsa March 16, 2023, 5:01 p.m. UTC
  Switching BUILD_ID_SIZE_MAX to enum, so we expose it to BPF
programs through vmlinux.h.

Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 include/linux/buildid.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Andrii Nakryiko March 16, 2023, 10:07 p.m. UTC | #1
On Thu, Mar 16, 2023 at 10:02 AM Jiri Olsa <jolsa@kernel.org> wrote:
>
> Switching BUILD_ID_SIZE_MAX to enum, so we expose it to BPF
> programs through vmlinux.h.
>
> Suggested-by: Andrii Nakryiko <andrii@kernel.org>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---

Thanks!

Acked-by: Andrii Nakryiko <andrii@kernel.org>

>  include/linux/buildid.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/buildid.h b/include/linux/buildid.h
> index b8b2e00420d6..316971c634fe 100644
> --- a/include/linux/buildid.h
> +++ b/include/linux/buildid.h
> @@ -5,7 +5,9 @@
>  #include <linux/mm_types.h>
>  #include <linux/slab.h>
>
> -#define BUILD_ID_SIZE_MAX 20
> +enum {
> +       BUILD_ID_SIZE_MAX = 20
> +};
>
>  struct build_id {
>         u32 sz;
> --
> 2.39.2
>
  

Patch

diff --git a/include/linux/buildid.h b/include/linux/buildid.h
index b8b2e00420d6..316971c634fe 100644
--- a/include/linux/buildid.h
+++ b/include/linux/buildid.h
@@ -5,7 +5,9 @@ 
 #include <linux/mm_types.h>
 #include <linux/slab.h>
 
-#define BUILD_ID_SIZE_MAX 20
+enum {
+	BUILD_ID_SIZE_MAX = 20
+};
 
 struct build_id {
 	u32 sz;