<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/tools/lib/bpf/libbpf.h, branch v4.11</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.11</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.11'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2017-01-31T19:20:06Z</updated>
<entry>
<title>tools lib bpf: Add bpf_object__pin()</title>
<updated>2017-01-31T19:20:06Z</updated>
<author>
<name>Joe Stringer</name>
<email>joe@ovn.org</email>
</author>
<published>2017-01-26T21:19:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d5148d8554d08f03b3e34ecc286ab1729c35c24c'/>
<id>urn:sha1:d5148d8554d08f03b3e34ecc286ab1729c35c24c</id>
<content type='text'>
Add a new API to pin a BPF object to the filesystem. The user can
specify the path within a BPF filesystem to pin the object.
Programs will be pinned under a subdirectory named the same as the
program, with each instance appearing as a numbered file under that
directory, and maps will be pinned under the path using the name of
the map as the file basename.

For example, with the directory '/sys/fs/bpf/foo' and a BPF object which
contains two instances of a program named 'bar', and a map named 'baz':

/sys/fs/bpf/foo/bar/0
/sys/fs/bpf/foo/bar/1
/sys/fs/bpf/foo/baz

Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
Cc: Alexei Starovoitov &lt;ast@fb.com&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: Wang Nan &lt;wangnan0@huawei.com&gt;
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20170126212001.14103-4-joe@ovn.org
[ Check snprintf &gt;= for truncation, as snprintf(bf, size, ...) == size also means truncation ]
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib bpf: Add bpf_map__pin()</title>
<updated>2017-01-31T19:20:06Z</updated>
<author>
<name>Joe Stringer</name>
<email>joe@ovn.org</email>
</author>
<published>2017-01-26T21:19:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b6989f35e80bf830f8dc97b74128d619faef0273'/>
<id>urn:sha1:b6989f35e80bf830f8dc97b74128d619faef0273</id>
<content type='text'>
Add a new API to pin a BPF map to the filesystem. The user can specify
the path full path within a BPF filesystem to pin the map.

Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
Cc: Alexei Starovoitov &lt;ast@fb.com&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: Wang Nan &lt;wangnan0@huawei.com&gt;
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20170126212001.14103-3-joe@ovn.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib bpf: Add BPF program pinning APIs</title>
<updated>2017-01-31T19:20:05Z</updated>
<author>
<name>Joe Stringer</name>
<email>joe@ovn.org</email>
</author>
<published>2017-01-26T21:19:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f367540c8c13d65603c431e29a0b87a7db893d6c'/>
<id>urn:sha1:f367540c8c13d65603c431e29a0b87a7db893d6c</id>
<content type='text'>
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.

Committer notes:

- Add missing headers for mkdir()

- Check strdup() for failure

- Check snprintf &gt;= size, not &gt;, as == also means truncated, see 'man
  snprintf', return value.

- Conditionally define BPF_FS_MAGIC, as it isn't in magic.h in older
  systems and we're not yet having a tools/include/uapi/linux/magic.h
  copy.

- Do not include linux/magic.h, not present in older distros.

Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
Cc: Alexei Starovoitov &lt;ast@fb.com&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: Wang Nan &lt;wangnan0@huawei.com&gt;
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20170126212001.14103-2-joe@ovn.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib bpf: Add libbpf_get_error()</title>
<updated>2017-01-26T14:42:58Z</updated>
<author>
<name>Joe Stringer</name>
<email>joe@ovn.org</email>
</author>
<published>2017-01-23T01:11:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e28ff1a8382ee02b10cf11cf3b48541dc3d14a58'/>
<id>urn:sha1:e28ff1a8382ee02b10cf11cf3b48541dc3d14a58</id>
<content type='text'>
This function will turn a libbpf pointer into a standard error code (or
0 if the pointer is valid).

This also allows removal of the dependency on linux/err.h in the public
header file, which causes problems in userspace programs built against
libbpf.

Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
Acked-by: Wang Nan &lt;wangnan0@huawei.com&gt;
Cc: Alexei Starovoitov &lt;ast@fb.com&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20170123011128.26534-5-joe@ovn.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib bpf: Add set/is helpers for all prog types</title>
<updated>2017-01-26T14:42:58Z</updated>
<author>
<name>Joe Stringer</name>
<email>joe@ovn.org</email>
</author>
<published>2017-01-23T01:11:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7803ba73099867d1f6ca866857277d92e0da4080'/>
<id>urn:sha1:7803ba73099867d1f6ca866857277d92e0da4080</id>
<content type='text'>
These bpf_prog_types were exposed in the uapi but there were no
corresponding functions to set these types for programs in libbpf.

Signed-off-by: Joe Stringer &lt;joe@ovn.org&gt;
Acked-by: Wang Nan &lt;wangnan0@huawei.com&gt;
Cc: Alexei Starovoitov &lt;ast@fb.com&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20170123011128.26534-4-joe@ovn.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib bpf: Retrive bpf_map through offset of bpf_map_def</title>
<updated>2016-11-29T15:10:19Z</updated>
<author>
<name>Wang Nan</name>
<email>wangnan0@huawei.com</email>
</author>
<published>2016-11-26T07:03:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5a6acad17d2e81765dd4c2fce7346a6f045eab25'/>
<id>urn:sha1:5a6acad17d2e81765dd4c2fce7346a6f045eab25</id>
<content type='text'>
Add a new API to libbpf, caller is able to get bpf_map through the
offset of bpf_map_def to 'maps' section.

The API will be used to help jitted perf hook code find fd of a map.

Signed-off-by: Wang Nan &lt;wangnan0@huawei.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: He Kuang &lt;hekuang@huawei.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Joe Stringer &lt;joe@ovn.org&gt;
Cc: Zefan Li &lt;lizefan@huawei.com&gt;
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-4-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib bpf: Add private field for bpf_object</title>
<updated>2016-11-29T15:09:41Z</updated>
<author>
<name>Wang Nan</name>
<email>wangnan0@huawei.com</email>
</author>
<published>2016-11-26T07:03:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=10931d2413478239bdceac5546cce85d7a497a4e'/>
<id>urn:sha1:10931d2413478239bdceac5546cce85d7a497a4e</id>
<content type='text'>
Similar to other classes defined in libbpf.h (map and program), allow
'object' class has its own private data.

Signed-off-by: Wang Nan &lt;wangnan0@huawei.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: He Kuang &lt;hekuang@huawei.com&gt;
Cc: Joe Stringer &lt;joe@ovn.org&gt;
Cc: Zefan Li &lt;lizefan@huawei.com&gt;
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-3-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib bpf: Report error when kernel doesn't support program type</title>
<updated>2016-07-14T02:09:02Z</updated>
<author>
<name>Wang Nan</name>
<email>wangnan0@huawei.com</email>
</author>
<published>2016-07-13T10:44:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=705fa2190dfb3d02f83adcd1abdb4e7dc3434597'/>
<id>urn:sha1:705fa2190dfb3d02f83adcd1abdb4e7dc3434597</id>
<content type='text'>
Now libbpf support tracepoint program type. Report meaningful error when kernel
version is less than 4.7.

Signed-off-by: Wang Nan &lt;wangnan0@huawei.com&gt;
Cc: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Zefan Li &lt;lizefan@huawei.com&gt;
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1468406646-21642-3-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib bpf: New API to adjust type of a BPF program</title>
<updated>2016-07-14T02:09:02Z</updated>
<author>
<name>Wang Nan</name>
<email>wangnan0@huawei.com</email>
</author>
<published>2016-07-13T10:44:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5f44e4c810bf3ace5a97a84554d4eeccbb563ca5'/>
<id>urn:sha1:5f44e4c810bf3ace5a97a84554d4eeccbb563ca5</id>
<content type='text'>
Add 4 new APIs to adjust and query the type of a BPF program.
Load program according to type set by caller. Default is set to
BPF_PROG_TYPE_KPROBE.

Signed-off-by: Wang Nan &lt;wangnan0@huawei.com&gt;
Cc: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Zefan Li &lt;lizefan@huawei.com&gt;
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1468406646-21642-2-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib bpf: Add license header</title>
<updated>2016-07-04T23:27:25Z</updated>
<author>
<name>Wang Nan</name>
<email>wangnan0@huawei.com</email>
</author>
<published>2016-07-04T11:02:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=203d1cacaddfc1e320f1e2625502fd1e0de465bd'/>
<id>urn:sha1:203d1cacaddfc1e320f1e2625502fd1e0de465bd</id>
<content type='text'>
Adding a missing license descriptopn header to files in libbpf, make it
LGPL-2.1.

Signed-off-by: Wang Nan &lt;wangnan0@huawei.com&gt;
Cc: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: Eric Leblond &lt;eleblond@stamus-networks.com&gt;
Cc: Zefan Li &lt;lizefan@huawei.com&gt;
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1467630162-193121-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
