From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Howard Chu <howardchu95@gmail.com>,
Ian Rogers <irogers@google.com>,
Kan Liang <kan.liang@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-perf-users@vger.kernel.org, Song Liu <song@kernel.org>,
bpf@vger.kernel.org
Subject: Re: [PATCH v4 1/2] perf trace: Implement syscall summary in BPF
Date: Fri, 25 Apr 2025 14:51:30 -0700 [thread overview]
Message-ID: <aAwD4idaGnTiQ-ld@google.com> (raw)
In-Reply-To: <aAq16LWBIVr08iSe@x1>
Hi Arnaldo,
On Thu, Apr 24, 2025 at 07:06:32PM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Apr 23, 2025 at 05:50:51PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Wed, Apr 23, 2025 at 10:41:55AM -0700, Namhyung Kim wrote:
> > > On Wed, Apr 23, 2025 at 01:26:48PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > On Fri, Mar 28, 2025 at 06:46:36PM -0700, Howard Chu wrote:
> > > > > On Tue, Mar 25, 2025 at 9:40 PM Namhyung Kim <namhyung@kernel.org> wrote:
> > > > > > syscall calls errors total min avg max stddev
>
> > > > > > --------------- -------- ------ -------- --------- --------- --------- ------
> > > > > > epoll_wait 561 0 4530.843 0.000 8.076 520.941 18.75%
> > > > > > futex 693 45 4317.231 0.000 6.230 500.077 21.98%
> > > > > > poll 300 0 1040.109 0.000 3.467 120.928 17.02%
> > > > > > clock_nanosleep 1 0 1000.172 1000.172 1000.172 1000.172 0.00%
> > > > > > ppoll 360 0 872.386 0.001 2.423 253.275 41.91%
> > > > > > epoll_pwait 14 0 384.349 0.001 27.453 380.002 98.79%
> > > > > > pselect6 14 0 108.130 7.198 7.724 8.206 0.85%
> > > > > > nanosleep 39 0 43.378 0.069 1.112 10.084 44.23%
> > > > > > ...
>
> > > > I added the following to align sched_[gs]etaffinity,
>
> > > Thanks for processing the patch and updating this. But I'm afraid there
> > > are more syscalls with longer names and this is not the only place to
> > > print the syscall names. Also I think we need to update length of the
> > > time fields. So I prefer handling them in a separate patch later.
>
> > Fair enough, I'm leaving the patch as-is.
>
> But, still have to look at this:
>
> toolsbuilder@five:~$ time dm
> 1 114.52 almalinux:8 : Ok gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-26) , clang version 18.1.8 (Red Hat 18.1.8-1.module_el8.10.0+3903+ca21d481) flex 2.6.1
> 2 111.09 almalinux:9 : Ok gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5) , clang version 18.1.8 (AlmaLinux OS Foundation 18.1.8-3.el9) flex 2.6.4
> 3: almalinux:9-i386WARNING: image platform (linux/386) does not match the expected platform (linux/amd64)
> WARNING: image platform (linux/386) does not match the expected platform (linux/amd64)
> 132.71 almalinux:9-i386 : Ok gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3) , clang version 17.0.6 (AlmaLinux OS Foundation 17.0.6-5.el9) flex 2.6.4
> 4 21.54 alpine:3.16 : FAIL gcc version 11.2.1 20220219 (Alpine 11.2.1_git20220219)
> bpf-trace-summary.c:(.text+0xf0760): undefined reference to `syscalltbl__name'
> collect2: error: ld returned 1 exit status
> 5 16.50 alpine:3.17 : FAIL gcc version 12.2.1 20220924 (Alpine 12.2.1_git20220924-r4)
> bpf-trace-summary.c:(.text+0xf2020): undefined reference to `syscalltbl__name'
> collect2: error: ld returned 1 exit status
>
> More info:
>
> perf-6.15.0-rc2/HEAD
> perf-6.15.0-rc2/PERF-VERSION-FILE
> BUILD_TARBALL_HEAD=24c0c35d4640052c61ed539a777bd3bd60d62bbf
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/12.2.1/lto-wrapper
> Target: x86_64-alpine-linux-musl
> Configured with: /home/buildozer/aports/main/gcc/src/gcc-12-20220924/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-default-ssp --enable-languages=c,c++,d,objc,go,fortran,ada --disable-libssp --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-bugurl=https://gitlab.alpinelinux.org/alpine/aports/-/issues --with-system-zlib --with-linker-hash-style=gnu --with-pkgversion='Alpine 12.2.1_git20220924-r4'
> Thread model: posix
> Supported LTO compression algorithms: zlib
> gcc version 12.2.1 20220924 (Alpine 12.2.1_git20220924-r4)
> + make 'NO_LIBTRACEEVENT=1' 'ARCH=' 'CROSS_COMPILE=' 'EXTRA_CFLAGS=' -C tools/perf 'O=/tmp/build/perf'
> make: Entering directory '/git/perf-6.15.0-rc2/tools/perf'
> BUILD: Doing 'make -j28' parallel build
> Warning: Skipped check-headers due to missing ../../include
> Makefile.config:563: No elfutils/debuginfod.h found, no debuginfo server support, please install libdebuginfod-dev/elfutils-debuginfod-client-devel or equivalent
> Makefile.config:605: No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev
> Makefile.config:1085: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
> Makefile.config:1128: No alternatives command found, you need to set JDIR= to point to the root of your Java directory
> Makefile.config:1159: libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev
>
> Auto-detecting system features:
> ... libdw: [ on ]
> ... glibc: [ OFF ]
> ... libelf: [ on ]
> ... libnuma: [ on ]
> ... numa_num_possible_cpus: [ on ]
> ... libperl: [ on ]
> ... libpython: [ on ]
> ... libcrypto: [ on ]
> ... libcapstone: [ on ]
> ... llvm-perf: [ on ]
> ... zlib: [ on ]
> ... lzma: [ on ]
> ... get_cpuid: [ on ]
> ... bpf: [ on ]
> ... libaio: [ on ]
> ... libzstd: [ on ]
>
> PERF_VERSION = 6.15.rc2.g24c0c35d4640
> GEN /tmp/build/perf/common-cmds.h
> GEN /tmp/build/perf/arch/arm64/include/generated/asm/sysreg-defs.h
> GEN perf-archive
> GEN perf-iostat
> <SNIP>
> CC /tmp/build/perf/util/bpf-filter-flex.o
> LD /tmp/build/perf/util/perf-util-in.o
> LD /tmp/build/perf/perf-util-in.o
> AR /tmp/build/perf/libperf-util.a
> CC /tmp/build/perf/pmu-events/pmu-events.o
> LD /tmp/build/perf/pmu-events/pmu-events-in.o
> AR /tmp/build/perf/libpmu-events.a
> LINK /tmp/build/perf/perf
> GEN /tmp/build/perf/python/perf.cpython-310-x86_64-linux-gnu.so
> /usr/lib/gcc/x86_64-alpine-linux-musl/12.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /tmp/build/perf/libperf-util.a(perf-util-in.o): in function `print_common_stats':
> bpf-trace-summary.c:(.text+0xf2020): undefined reference to `syscalltbl__name'
> collect2: error: ld returned 1 exit status
> make[2]: *** [Makefile.perf:804: /tmp/build/perf/perf] Error 1
> make[2]: *** Waiting for unfinished jobs....
> make[1]: *** [Makefile.perf:290: sub-make] Error 2
> make: *** [Makefile:76: all] Error 2
> make: Leaving directory '/git/perf-6.15.0-rc2/tools/perf'
> + exit 1
> toolsbuilder@five:~$
>
> I'll take a look tomorrow.
Thanks for the report. I think it's because syscalltbl.c depends on
CONFIG_TRACE but bpf-trace-summary depends on CONFIG_PERF_BPF_SKEL.
In the future, I'd like to get rid of dependency to libtraceevent in
perf trace and make it possible to use BPF/BTF only.
How about this?
Thanks,
Namhyung
---8<---
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 4f00cde8c3ea63eb..7ae5b4b9330af0ce 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -173,9 +173,12 @@ perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_off_cpu.o
perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter.o
perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter-flex.o
perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter-bison.o
-perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-trace-summary.o
perf-util-$(CONFIG_PERF_BPF_SKEL) += btf.o
+ifeq ($(CONFIG_TRACE),y)
+ perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-trace-summary.o
+endif
+
ifeq ($(CONFIG_LIBTRACEEVENT),y)
perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_lock_contention.o
endif
prev parent reply other threads:[~2025-04-25 21:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 4:40 [PATCH v4 1/2] perf trace: Implement syscall summary in BPF Namhyung Kim
2025-03-26 4:40 ` [PATCH v4 2/2] perf test: Add perf trace summary test Namhyung Kim
2025-03-29 1:48 ` Howard Chu
2025-03-29 1:46 ` [PATCH v4 1/2] perf trace: Implement syscall summary in BPF Howard Chu
2025-04-23 16:19 ` Arnaldo Carvalho de Melo
2025-04-23 16:26 ` Arnaldo Carvalho de Melo
2025-04-23 17:41 ` Namhyung Kim
2025-04-23 20:50 ` Arnaldo Carvalho de Melo
2025-04-24 22:06 ` Arnaldo Carvalho de Melo
2025-04-25 21:51 ` Namhyung Kim [this message]
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=aAwD4idaGnTiQ-ld@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=bpf@vger.kernel.org \
--cc=howardchu95@gmail.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=song@kernel.org \
/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.