[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+G9fYssgDcBkiNGSV7BmjE4Tj1j1_fa4VTJFv3N=2FHzewQLg@mail.gmail.com>
Date: Wed, 18 Dec 2019 16:17:46 +0530
From: Naresh Kamboju <naresh.kamboju@...aro.org>
To: Toke Høiland-Jørgensen <toke@...hat.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Netdev <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Yonghong Song <yhs@...com>, lkft-triage@...ts.linaro.org,
Leo Yan <leo.yan@...aro.org>,
Daniel Diaz <daniel.diaz@...aro.org>
Subject: Re: [PATCH bpf-next v2] libbpf: Print hint about ulimit when getting
permission denied error
On Tue, 17 Dec 2019 at 00:00, Toke Høiland-Jørgensen <toke@...hat.com> wrote:
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index a2cc7313763a..3fe42d6b0c2f 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -41,6 +41,7 @@
> #include <sys/types.h>
> #include <sys/vfs.h>
> #include <sys/utsname.h>
> +#include <sys/resource.h>
> #include <tools/libc_compat.h>
> #include <libelf.h>
> #include <gelf.h>
> @@ -100,6 +101,32 @@ void libbpf_print(enum libbpf_print_level level, const char *format, ...)
> va_end(args);
> }
>
> +static void pr_perm_msg(int err)
> +{
> + struct rlimit limit;
> + char buf[100];
> +
> + if (err != -EPERM || geteuid() != 0)
> + return;
> +
> + err = getrlimit(RLIMIT_MEMLOCK, &limit);
> + if (err)
> + return;
> +
> + if (limit.rlim_cur == RLIM_INFINITY)
> + return;
> +
> + if (limit.rlim_cur < 1024)
> + snprintf(buf, sizeof(buf), "%lu bytes", limit.rlim_cur);
libbpf.c: In function 'pr_perm_msg':
libbpf.c:120:33: error: format '%lu' expects argument of type 'long
unsigned int', but argument 4 has type 'rlim_t {aka long long unsigned
int}' [-Werror=format=]
snprintf(buf, sizeof(buf), "%lu bytes", limit.rlim_cur);
~~^ ~~~~~~~~~~~~~~
%llu
Linux next i386 and arm builds failed due to this error.
Full build log link,
https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-next/DISTRO=lkft,MACHINE=intel-core2-32,label=docker-lkft/672/consoleText
https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-next/DISTRO=lkft,MACHINE=am57xx-evm,label=docker-lkft/672/consoleText
--
Linaro LKFT
https://lkft.linaro.org
Powered by blists - more mailing lists