[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200729112518.GH1319041@krava>
Date: Wed, 29 Jul 2020 13:25:18 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andriin@...com>,
Wenbo Zhang <ethercflow@...il.com>,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Martin KaFai Lau <kafai@...com>,
David Miller <davem@...hat.com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...omium.org>,
Brendan Gregg <bgregg@...flix.com>,
Florent Revest <revest@...omium.org>,
Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH v8 bpf-next 12/13] selftests/bpf: Add test for d_path
helper
On Tue, Jul 28, 2020 at 12:53:00PM -0700, Andrii Nakryiko wrote:
SNIP
> > + if (CHECK_FAIL(ret < 0))
> > + goto out_close;
> > + ret = set_pathname(procfd, pid);
> > + if (CHECK_FAIL(ret < 0))
> > + goto out_close;
> > + ret = set_pathname(devfd, pid);
> > + if (CHECK_FAIL(ret < 0))
> > + goto out_close;
> > + ret = set_pathname(localfd, pid);
> > + if (CHECK_FAIL(ret < 0))
> > + goto out_close;
> > + ret = set_pathname(indicatorfd, pid);
> > + if (CHECK_FAIL(ret < 0))
> > + goto out_close;
>
> Please use CHECK instead of CHECK_FAIL. Thanks.
ok
> > diff --git a/tools/testing/selftests/bpf/progs/test_d_path.c b/tools/testing/selftests/bpf/progs/test_d_path.c
> > new file mode 100644
> > index 000000000000..e02dce614256
> > --- /dev/null
> > +++ b/tools/testing/selftests/bpf/progs/test_d_path.c
> > @@ -0,0 +1,64 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +
> > +#include "vmlinux.h"
> > +#include <bpf/bpf_helpers.h>
> > +#include <bpf/bpf_tracing.h>
> > +
> > +#define MAX_PATH_LEN 128
> > +#define MAX_EVENT_NUM 16
> > +
> > +pid_t my_pid;
> > +__u32 cnt_stat;
> > +__u32 cnt_close;
> > +char paths_stat[MAX_EVENT_NUM][MAX_PATH_LEN];
> > +char paths_close[MAX_EVENT_NUM][MAX_PATH_LEN];
> > +int rets_stat[MAX_EVENT_NUM];
> > +int rets_close[MAX_EVENT_NUM];
> > +
>
> please zero-initialize all of these, it causes issues on some Clang versions
ook
jirka
Powered by blists - more mailing lists