<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/bpf, branch v5.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-06-17T15:52:30Z</updated>
<entry>
<title>tools, bpftool: Add ringbuf map type to map command docs</title>
<updated>2020-06-17T15:52:30Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2020-06-16T11:33:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1c7fb20d6b0acd452cb93d447051eac7724edfa7'/>
<id>urn:sha1:1c7fb20d6b0acd452cb93d447051eac7724edfa7</id>
<content type='text'>
Commit c34a06c56df7 ("tools/bpftool: Add ringbuf map to a list of known
map types") added the symbolic "ringbuf" name. Document it in the bpftool
map command docs and usage as well.

Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Link: https://lore.kernel.org/bpf/20200616113303.8123-1-tklauser@distanz.ch
</content>
</entry>
<entry>
<title>tools/bpftool: Add ringbuf map to a list of known map types</title>
<updated>2020-06-16T00:18:30Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-06-15T22:53:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c34a06c56df7c513cd19f591b26fe7d814c778cc'/>
<id>urn:sha1:c34a06c56df7c513cd19f591b26fe7d814c778cc</id>
<content type='text'>
Add symbolic name "ringbuf" to map to BPF_MAP_TYPE_RINGBUF. Without this,
users will see "type 27" instead of "ringbuf" in `map show` output.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20200615225355.366256-1-andriin@fb.com
</content>
</entry>
<entry>
<title>tools/bpftool: Fix skeleton codegen</title>
<updated>2020-06-12T22:25:04Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-06-12T20:16:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=22eb78792e07a4dfb63c85f34950d4e58eb90326'/>
<id>urn:sha1:22eb78792e07a4dfb63c85f34950d4e58eb90326</id>
<content type='text'>
Remove unnecessary check at the end of codegen() routine which makes codegen()
to always fail and exit bpftool with error code. Positive value of variable
n is not an indicator of a failure.

Fixes: 2c4779eff837 ("tools, bpftool: Exit on error in function codegen")
Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Reviewed-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Link: https://lore.kernel.org/bpf/20200612201603.680852-1-andriin@fb.com
</content>
</entry>
<entry>
<title>tools, bpftool: Exit on error in function codegen</title>
<updated>2020-06-11T21:52:19Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2020-06-11T10:33:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2c4779eff837f1035f6f9650d246905daadd9528'/>
<id>urn:sha1:2c4779eff837f1035f6f9650d246905daadd9528</id>
<content type='text'>
Currently, the codegen function might fail and return an error. But its
callers continue without checking its return value. Since codegen can
fail only in the unlikely case of the system running out of memory or
the static template being malformed, just exit(-1) directly from codegen
and make it void-returning.

Suggested-by: Andrii Nakryiko &lt;andrii.nakryiko@gmail.com&gt;
Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200611103341.21532-1-tklauser@distanz.ch
</content>
</entry>
<entry>
<title>tools, bpftool: Fix memory leak in codegen error cases</title>
<updated>2020-06-11T14:08:48Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2020-06-10T13:08:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4060ac969563113101c79433f2ae005feca1c29'/>
<id>urn:sha1:d4060ac969563113101c79433f2ae005feca1c29</id>
<content type='text'>
Free the memory allocated for the template on error paths in function
codegen.

Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200610130804.21423-1-tklauser@distanz.ch
</content>
</entry>
<entry>
<title>tools, bpf: Do not force gcc as CC</title>
<updated>2020-06-10T11:40:04Z</updated>
<author>
<name>Brett Mastbergen</name>
<email>brett.mastbergen@gmail.com</email>
</author>
<published>2020-06-09T21:35:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=47f6bc4ce1ff70d7ba0924c2f1c218c96cd585fb'/>
<id>urn:sha1:47f6bc4ce1ff70d7ba0924c2f1c218c96cd585fb</id>
<content type='text'>
This allows transparent cross-compilation with CROSS_COMPILE by
relying on 7ed1c1901fe5 ("tools: fix cross-compile var clobbering").

Same change was applied to tools/bpf/bpftool/Makefile in
9e88b9312acb ("tools: bpftool: do not force gcc as CC").

Signed-off-by: Brett Mastbergen &lt;brett.mastbergen@gmail.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20200609213506.3299-1-brett.mastbergen@gmail.com
</content>
</entry>
<entry>
<title>tools/bpf: Don't use $(COMPILE.c)</title>
<updated>2020-06-02T20:02:38Z</updated>
<author>
<name>Ilya Leoshkevich</name>
<email>iii@linux.ibm.com</email>
</author>
<published>2020-06-02T17:56:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d70a6be1e2ab98f13688e4a529b326e8e11230d0'/>
<id>urn:sha1:d70a6be1e2ab98f13688e4a529b326e8e11230d0</id>
<content type='text'>
When using make kselftest TARGETS=bpf, tools/bpf is built with
MAKEFLAGS=rR, which causes $(COMPILE.c) to be undefined, which in turn
causes the build to fail with

  CC       kselftest/bpf/tools/build/bpftool/map_perf_ring.o
/bin/sh: 1: -MMD: not found

Fix by using $(CC) $(CFLAGS) -c instead of $(COMPILE.c).

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20200602175649.2501580-2-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>bpftool: Support link show for netns-attached links</title>
<updated>2020-06-01T22:21:03Z</updated>
<author>
<name>Jakub Sitnicki</name>
<email>jakub@cloudflare.com</email>
</author>
<published>2020-05-31T08:28:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e948947a6e111b3d4bbe538105ee2f3611e032ad'/>
<id>urn:sha1:e948947a6e111b3d4bbe538105ee2f3611e032ad</id>
<content type='text'>
Make `bpf link show` aware of new link type, that is links attached to
netns. When listing netns-attached links, display netns inode number as its
identifier and link attach type.

Sample session:

  # readlink /proc/self/ns/net
  net:[4026532251]
  # bpftool prog show
  357: flow_dissector  tag a04f5eef06a7f555  gpl
          loaded_at 2020-05-30T16:53:51+0200  uid 0
          xlated 16B  jited 37B  memlock 4096B
  358: flow_dissector  tag a04f5eef06a7f555  gpl
          loaded_at 2020-05-30T16:53:51+0200  uid 0
          xlated 16B  jited 37B  memlock 4096B
  # bpftool link show
  108: netns  prog 357
          netns_ino 4026532251  attach_type flow_dissector
  # bpftool link -jp show
  [{
          "id": 108,
          "type": "netns",
          "prog_id": 357,
          "netns_ino": 4026532251,
          "attach_type": "flow_dissector"
      }
  ]

  (... after netns is gone ...)

  # bpftool link show
  108: netns  prog 357
          netns_ino 0  attach_type flow_dissector
  # bpftool link -jp show
  [{
          "id": 108,
          "type": "netns",
          "prog_id": 357,
          "netns_ino": 0,
          "attach_type": "flow_dissector"
      }
  ]

Signed-off-by: Jakub Sitnicki &lt;jakub@cloudflare.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200531082846.2117903-9-jakub@cloudflare.com
</content>
</entry>
<entry>
<title>bpftool: Extract helpers for showing link attach type</title>
<updated>2020-06-01T22:21:03Z</updated>
<author>
<name>Jakub Sitnicki</name>
<email>jakub@cloudflare.com</email>
</author>
<published>2020-05-31T08:28:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=be6e19818ba626eb1b354490aee40a2cfc1a219f'/>
<id>urn:sha1:be6e19818ba626eb1b354490aee40a2cfc1a219f</id>
<content type='text'>
Code for printing link attach_type is duplicated in a couple of places, and
likely will be duplicated for future link types as well. Create helpers to
prevent duplication.

Suggested-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Jakub Sitnicki &lt;jakub@cloudflare.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200531082846.2117903-8-jakub@cloudflare.com
</content>
</entry>
<entry>
<title>tools, bpftool: Print correct error message when failing to load BTF</title>
<updated>2020-06-01T21:38:19Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2020-05-25T13:54:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dc3ca5cf3e0be9fb73f4691247367d76a22bf30b'/>
<id>urn:sha1:dc3ca5cf3e0be9fb73f4691247367d76a22bf30b</id>
<content type='text'>
btf__parse_raw and btf__parse_elf return negative error numbers wrapped
in an ERR_PTR, so the extracted value needs to be negated before passing
them to strerror which expects a positive error number.

Before:
  Error: failed to load BTF from .../vmlinux: Unknown error -2

After:
  Error: failed to load BTF from .../vmlinux: No such file or directory

Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20200525135421.4154-1-tklauser@distanz.ch
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
</feed>
