lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fX-Qa8y0yq5a2T=_=W59_4F-VPPHZpP4Vk3ZjnDRO8uOg@mail.gmail.com>
Date:   Tue, 15 Nov 2022 11:12:55 -0800
From:   Ian Rogers <irogers@...gle.com>
To:     Leo Yan <leo.yan@...aro.org>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH v1 0/7] Fix perf trace libbpf 1.0+ compatibility

On Fri, Nov 11, 2022 at 4:09 AM Leo Yan <leo.yan@...aro.org> wrote:
>
> Hi Ian, Arnaldo,
>
> On Wed, Nov 02, 2022 at 09:54:30PM -0700, Ian Rogers wrote:
> > Perf trace can augment system calls with a BPF program passed as an
> > event. The BPF code for this lives in examples. This patch fixes the
> > example code to not used deprecated/removed APIs in libbpf. As libbpf
> > has similar header files to tools/perf/include/bpf the code is
> > transitioned to use the more standard libbpf code and the perf BPF
> > header files removed.
>
> I think you missed to update the code examples/bpf/sys_enter_openat.c,
> either you could remove it (since it's duplicate with
> augmented_raw_syscalls.c), or we should apply below fixing:

Arnaldo, what do you think?

Thanks,
Ian

> From f30af3b43060e482c54e113cbe90223173c69abd Mon Sep 17 00:00:00 2001
> From: Leo Yan <leo.yan@...aro.org>
> Date: Fri, 11 Nov 2022 12:02:24 +0000
> Subject: [PATCH] perf trace: sys_enter_openat.c fix libbpf 1.0+ compatibility
>
> Avoid use of tools/perf/include/bpf/bpf.h and use the more regular BPF
> headers.
>
> With fixing:
>
>   # ./perf trace -e examples/bpf/sys_enter_openat.c
>   0.000 irqbalance/1025 syscalls:sys_enter_openat(AT_FDCWD, "", O_RDONLY)
>   1.596 irqbalance/1025 syscalls:sys_enter_openat(AT_FDCWD, "", O_RDONLY)
>   1.832 irqbalance/1025 syscalls:sys_enter_openat(AT_FDCWD, "", O_RDONLY)
>   1.864 irqbalance/1025 syscalls:sys_enter_openat(AT_FDCWD, "", O_RDONLY)
>
> Signed-off-by: Leo Yan <leo.yan@...aro.org>
> ---
>  tools/perf/examples/bpf/sys_enter_openat.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/examples/bpf/sys_enter_openat.c b/tools/perf/examples/bpf/sys_enter_openat.c
> index c4481c390d23..8edfa7c147d1 100644
> --- a/tools/perf/examples/bpf/sys_enter_openat.c
> +++ b/tools/perf/examples/bpf/sys_enter_openat.c
> @@ -14,7 +14,9 @@
>   * the return value.
>   */
>
> -#include <bpf/bpf.h>
> +#include <linux/bpf.h>
> +#include <linux/limits.h>
> +#include <bpf/bpf_helpers.h>
>
>  struct syscall_enter_openat_args {
>         unsigned long long unused;
> @@ -25,9 +27,10 @@ struct syscall_enter_openat_args {
>         long               mode;
>  };
>
> -int syscall_enter(openat)(struct syscall_enter_openat_args *args)
> +SEC("syscalls:sys_enter_openat")
> +int syscall_enter_openat(struct syscall_enter_openat_args *args)
>  {
>         return 1;
>  }
>
> -license(GPL);
> +char _license[] SEC("license") = "GPL";

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ