From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Joe Stringer <joe@ovn.org>
Cc: wangnan0@huawei.com, ast@fb.com, daniel@iogearbox.net,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCHv3 perf/core 1/6] tools lib bpf: Add BPF program pinning APIs.
Date: Mon, 30 Jan 2017 17:28:13 -0300 [thread overview]
Message-ID: <20170130202813.GG4546@kernel.org> (raw)
In-Reply-To: <20170130202506.GF4546@kernel.org>
Em Mon, Jan 30, 2017 at 05:25:06PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Jan 26, 2017 at 01:19:56PM -0800, Joe Stringer escreveu:
> > Add new APIs to pin a BPF program (or specific instances) to the filesystem.
> > The user can specify the path full path within a BPF filesystem to pin the
> > program.
> >
> > bpf_program__pin_instance(prog, path, n) will pin the nth instance of
> > 'prog' to the specified path.
> > bpf_program__pin(prog, path) will create the directory 'path' (if it
> > does not exist) and pin each instance within that directory. For
> > instance, path/0, path/1, path/2.
> >
> > Signed-off-by: Joe Stringer <joe@ovn.org>
>
> make: Entering directory '/home/acme/git/linux/tools/perf'
> BUILD: Doing 'make -j4' parallel build
> CC /tmp/build/perf/builtin-record.o
> CC /tmp/build/perf/libbpf.o
> CC /tmp/build/perf/util/parse-events.o
> INSTALL trace_plugins
> libbpf.c: In function ‘make_dir’:
> libbpf.c:1303:6: error: implicit declaration of function ‘mkdir’ [-Werror=implicit-function-declaration]
> if (mkdir(path, 0700) && errno != EEXIST)
> ^~~~~
> libbpf.c:1303:2: error: nested extern declaration of ‘mkdir’ [-Werror=nested-externs]
> if (mkdir(path, 0700) && errno != EEXIST)
> ^~
> cc1: all warnings being treated as errors
> mv: cannot stat '/tmp/build/perf/.libbpf.o.tmp': No such file or directory
> /home/acme/git/linux/tools/build/Makefile.build:101: recipe for target '/tmp/build/perf/libbpf.o' failed
>
>
> And strdup() is not checked for failure, I'm fixing those,
>
> +++ b/tools/lib/bpf/libbpf.c
> @@ -36,6 +36,8 @@
> #include <linux/magic.h>
> #include <linux/list.h>
> #include <linux/limits.h>
> +#include <sys/stat.h>
> +#include <sys/types.h>
> #include <sys/vfs.h>
This as well:
@@ -1338,7 +1343,7 @@ int bpf_program__pin(struct bpf_program *prog,
const char *path)
len = snprintf(buf, PATH_MAX, "%s/%d", path, i);
if (len < 0)
return -EINVAL;
- else if (len > PATH_MAX)
+ else if (len >= PATH_MAX)
return -ENAMETOOLONG;
See 'man snprintf', return value:
---
Thus, a return value of size or more means that the output was
truncated.
---
next prev parent reply other threads:[~2017-01-30 20:28 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-26 21:19 [PATCHv3 perf/core 0/6] Libbpf object pinning Joe Stringer
2017-01-26 21:19 ` [PATCHv3 perf/core 1/6] tools lib bpf: Add BPF program pinning APIs Joe Stringer
2017-01-30 20:25 ` Arnaldo Carvalho de Melo
2017-01-30 20:28 ` Arnaldo Carvalho de Melo [this message]
2017-01-30 21:16 ` Joe Stringer
2017-01-31 0:58 ` Arnaldo Carvalho de Melo
2017-01-31 16:08 ` Arnaldo Carvalho de Melo
2017-01-31 16:13 ` Arnaldo Carvalho de Melo
2017-01-31 16:42 ` Arnaldo Carvalho de Melo
2017-02-01 14:40 ` [tip:perf/core] " tip-bot for Joe Stringer
2017-01-26 21:19 ` [PATCHv3 perf/core 2/6] tools lib bpf: Add bpf_map__pin() Joe Stringer
2017-02-01 14:40 ` [tip:perf/core] " tip-bot for Joe Stringer
2017-01-26 21:19 ` [PATCHv3 perf/core 3/6] tools lib bpf: Add bpf_object__pin() Joe Stringer
2017-02-01 14:41 ` [tip:perf/core] " tip-bot for Joe Stringer
2017-01-26 21:19 ` [PATCHv3 perf/core 4/6] tools perf util: Make rm_rf(path) argument const Joe Stringer
2017-02-01 14:41 ` [tip:perf/core] " tip-bot for Joe Stringer
2017-01-26 21:20 ` [PATCHv3 perf/core 5/6] tools lib api fs: Add bpf_fs filesystem detector Joe Stringer
2017-02-01 14:42 ` [tip:perf/core] " tip-bot for Joe Stringer
2017-01-26 21:20 ` [PATCHv3 perf/core 6/6] perf test: Add libbpf pinning test Joe Stringer
2017-02-01 14:42 ` [tip:perf/core] " tip-bot for Joe Stringer
2017-01-30 20:37 ` [PATCHv3 perf/core 0/6] Libbpf object pinning Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170130202813.GG4546@kernel.org \
--to=acme@kernel.org \
--cc=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=joe@ovn.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.