<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/bpf, branch v6.3</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=v6.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-02-16T23:32:45Z</updated>
<entry>
<title>bpftool: Use bpf_{btf,link,map,prog}_get_info_by_fd()</title>
<updated>2023-02-16T23:32:45Z</updated>
<author>
<name>Ilya Leoshkevich</name>
<email>iii@linux.ibm.com</email>
</author>
<published>2023-02-14T23:12:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=38f0408ef756e738387f7d8f62b8d58ca5938da4'/>
<id>urn:sha1:38f0408ef756e738387f7d8f62b8d58ca5938da4</id>
<content type='text'>
Use the new type-safe wrappers around bpf_obj_get_info_by_fd().

Split the bpf_obj_get_info_by_fd() call in build_btf_type_table() in
two, since knowing the type helps with the Memory Sanitizer.

Improve map_parse_fd_and_info() type safety by using
struct bpf_map_info * instead of void * for info.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Reviewed-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Link: https://lore.kernel.org/bpf/20230214231221.249277-4-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>tools: runqslower: Add EXTRA_CFLAGS and EXTRA_LDFLAGS support</title>
<updated>2023-02-10T23:21:26Z</updated>
<author>
<name>Ilya Leoshkevich</name>
<email>iii@linux.ibm.com</email>
</author>
<published>2023-02-10T00:11:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=585bf4640ebe9ea4730b5b603347b4ba39731546'/>
<id>urn:sha1:585bf4640ebe9ea4730b5b603347b4ba39731546</id>
<content type='text'>
This makes it possible to add sanitizer flags.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20230210001210.395194-3-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>tools/resolve_btfids: Pass HOSTCFLAGS as EXTRA_CFLAGS to prepare targets</title>
<updated>2023-02-09T19:44:56Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2023-02-09T14:37:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2531ba0e4ae67d6d0219400af27805fe52cd28e8'/>
<id>urn:sha1:2531ba0e4ae67d6d0219400af27805fe52cd28e8</id>
<content type='text'>
Thorsten reported build issue with command line that defined extra
HOSTCFLAGS that were not passed into 'prepare' targets, but were
used to build resolve_btfids objects.

This results in build fail when these objects are linked together:

  /usr/bin/ld: /build.../tools/bpf/resolve_btfids//libbpf/libbpf.a(libbpf-in.o):
  relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE \
  object; recompile with -fPIE

Fixing this by passing HOSTCFLAGS in EXTRA_CFLAGS as part of
HOST_OVERRIDES variable for prepare targets.

[1] https://lore.kernel.org/bpf/f7922132-6645-6316-5675-0ece4197bfff@leemhuis.info/

Fixes: 56a2df7615fa ("tools/resolve_btfids: Compile resolve_btfids as host program")
Reported-by: Thorsten Leemhuis &lt;linux@leemhuis.info&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Tested-by: Thorsten Leemhuis &lt;linux@leemhuis.info&gt;
Acked-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/bpf/20230209143735.4112845-1-jolsa@kernel.org
</content>
</entry>
<entry>
<title>tools/resolve_btfids: Tidy HOST_OVERRIDES</title>
<updated>2023-02-07T21:48:56Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2023-02-02T22:42:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e0975ab92f2406fd3e12834f62dc57cb10404f85'/>
<id>urn:sha1:e0975ab92f2406fd3e12834f62dc57cb10404f85</id>
<content type='text'>
Don't set EXTRA_CFLAGS to HOSTCFLAGS, ensure CROSS_COMPILE isn't
passed through.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20230202224253.40283-1-irogers@google.com
</content>
</entry>
<entry>
<title>tools/resolve_btfids: Compile resolve_btfids as host program</title>
<updated>2023-02-07T21:47:16Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2023-02-02T11:28:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=56a2df7615fa050cc67b89245b2a482849077939'/>
<id>urn:sha1:56a2df7615fa050cc67b89245b2a482849077939</id>
<content type='text'>
Making resolve_btfids to be compiled as host program so
we can avoid cross compile issues as reported by Nathan.

Also we no longer need HOST_OVERRIDES for BINARY target,
just for 'prepare' targets.

Fixes: 13e07691a16f ("tools/resolve_btfids: Alter how HOSTCC is forced")
Reported-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Tested-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Acked-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/bpf/20230202112839.1131892-1-jolsa@kernel.org
</content>
</entry>
<entry>
<title>bpftool: profile online CPUs instead of possible</title>
<updated>2023-02-03T06:20:14Z</updated>
<author>
<name>Tonghao Zhang</name>
<email>tong@infragraf.org</email>
</author>
<published>2023-02-02T13:17:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=377c16fa3f3c60d21e4b05314c8be034ce37f2eb'/>
<id>urn:sha1:377c16fa3f3c60d21e4b05314c8be034ce37f2eb</id>
<content type='text'>
The number of online cpu may be not equal to possible cpu.
"bpftool prog profile" can not create pmu event on possible
but on online cpu.

$ dmidecode -s system-product-name
PowerEdge R620
$ cat /sys/devices/system/cpu/possible
0-47
$ cat /sys/devices/system/cpu/online
0-31

Disable cpu dynamically:
$ echo 0 &gt; /sys/devices/system/cpu/cpuX/online

If one cpu is offline, perf_event_open will return ENODEV.
To fix this issue:
* check value returned and skip offline cpu.
* close pmu_fd immediately on error path, avoid fd leaking.

Fixes: 47c09d6a9f67 ("bpftool: Introduce "prog profile" command")
Signed-off-by: Tonghao Zhang &lt;tong@infragraf.org&gt;
Cc: Quentin Monnet &lt;quentin@isovalent.com&gt;
Cc: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Cc: Martin KaFai Lau &lt;martin.lau@linux.dev&gt;
Cc: Song Liu &lt;song@kernel.org&gt;
Cc: Yonghong Song &lt;yhs@fb.com&gt;
Cc: John Fastabend &lt;john.fastabend@gmail.com&gt;
Cc: KP Singh &lt;kpsingh@kernel.org&gt;
Cc: Stanislav Fomichev &lt;sdf@google.com&gt;
Cc: Hao Luo &lt;haoluo@google.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Link: https://lore.kernel.org/r/20230202131701.29519-1-tong@infragraf.org
Signed-off-by: Martin KaFai Lau &lt;martin.lau@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/resolve_btfids: Alter how HOSTCC is forced</title>
<updated>2023-01-25T17:28:14Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2023-01-24T06:43:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=13e07691a16ff31b209fbfce25c01ff296b05e45'/>
<id>urn:sha1:13e07691a16ff31b209fbfce25c01ff296b05e45</id>
<content type='text'>
HOSTCC is always wanted when building. Setting CC to HOSTCC happens
after tools/scripts/Makefile.include is included, meaning flags are
set assuming say CC is gcc, but then it can be later set to HOSTCC
which may be clang. tools/scripts/Makefile.include is needed for host
set up and common macros in objtool's Makefile. Rather than override
CC to HOSTCC, just pass CC as HOSTCC to Makefile.build, the libsubcmd
builds and the linkage step. This means the Makefiles don't see things
like CC changing and tool flag determination, and similar, work
properly.

Also, clear the passed subdir as otherwise an outer build may break by
inadvertently passing an inappropriate value.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20230124064324.672022-2-irogers@google.com
</content>
</entry>
<entry>
<title>tools/resolve_btfids: Install subcmd headers</title>
<updated>2023-01-25T17:28:08Z</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2023-01-24T06:43:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=af03299d8536d62b49c7f3cb929349eb2d66bcd5'/>
<id>urn:sha1:af03299d8536d62b49c7f3cb929349eb2d66bcd5</id>
<content type='text'>
Previously tools/lib/subcmd was added to the include path, switch to
installing the headers and then including from that directory. This
avoids dependencies on headers internal to tools/lib/subcmd. Add the
missing subcmd directory to the affected #include.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20230124064324.672022-1-irogers@google.com
</content>
</entry>
<entry>
<title>bpftool: Always disable stack protection for BPF objects</title>
<updated>2023-01-13T15:44:21Z</updated>
<author>
<name>Holger Hoffstätte</name>
<email>holger@applied-asynchrony.com</email>
</author>
<published>2023-01-13T15:40:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=878625e1c7a10dfbb1fdaaaae2c4d2a58fbce627'/>
<id>urn:sha1:878625e1c7a10dfbb1fdaaaae2c4d2a58fbce627</id>
<content type='text'>
When the clang toolchain has stack protection enabled in order to be
consistent with gcc - which just happens to be the case on Gentoo -
the bpftool build fails:

  [...]
  clang \
	-I. \
	-I/tmp/portage/dev-util/bpftool-6.0.12/work/linux-6.0/tools/include/uapi/ \
	-I/tmp/portage/dev-util/bpftool-6.0.12/work/linux-6.0/tools/bpf/bpftool/bootstrap/libbpf/include \
	-g -O2 -Wall -target bpf -c skeleton/pid_iter.bpf.c -o pid_iter.bpf.o
  clang \
	-I. \
	-I/tmp/portage/dev-util/bpftool-6.0.12/work/linux-6.0/tools/include/uapi/ \
	-I/tmp/portage/dev-util/bpftool-6.0.12/work/linux-6.0/tools/bpf/bpftool/bootstrap/libbpf/include \
	-g -O2 -Wall -target bpf -c skeleton/profiler.bpf.c -o profiler.bpf.o
  skeleton/profiler.bpf.c:40:14: error: A call to built-in function '__stack_chk_fail' is not supported.
  int BPF_PROG(fentry_XXX)
                ^
  skeleton/profiler.bpf.c:94:14: error: A call to built-in function '__stack_chk_fail' is not supported.
  int BPF_PROG(fexit_XXX)
                ^
  2 errors generated.
  [...]

Since stack-protector makes no sense for the BPF bits just unconditionally
disable it.

Bug: https://bugs.gentoo.org/890638
Signed-off-by: Holger Hoffstätte &lt;holger@applied-asynchrony.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Link: https://lore.kernel.org/bpf/74cd9d2e-6052-312a-241e-2b514a75c92c@applied-asynchrony.com
</content>
</entry>
<entry>
<title>bpftool: fix output for skipping kernel config check</title>
<updated>2023-01-11T01:42:31Z</updated>
<author>
<name>Chethan Suresh</name>
<email>chethan.suresh@sony.com</email>
</author>
<published>2023-01-09T02:37:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=75514e4c661962cbbad869a1b5855dbce0f1aba2'/>
<id>urn:sha1:75514e4c661962cbbad869a1b5855dbce0f1aba2</id>
<content type='text'>
When bpftool feature does not find kernel config
files under default path or wrong format,
do not output CONFIG_XYZ is not set.
Skip kernel config check and continue.

Signed-off-by: Chethan Suresh &lt;chethan.suresh@sony.com&gt;
Signed-off-by: Kenta Tada &lt;Kenta.Tada@sony.com&gt;
Acked-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Link: https://lore.kernel.org/r/20230109023742.29657-1-chethan.suresh@sony.com
Signed-off-by: Martin KaFai Lau &lt;martin.lau@kernel.org&gt;
</content>
</entry>
</feed>
