Some perf counters, including all the syscall ones, are only available to the root user. sudo perf list will show all the counters, including syscall ones assuming the kernel is built with CONFIG_HAVE_SYSCALL_TRACEPOINTS (see Grisha Levit's answer regarding that).

So, to make perf top -e 'syscalls:sys_enter_*' work, run it under sudo--even if you do not need sudo for other counters like cycles.

Answer from John Zwinck on Stack Overflow
🌐
Linux Man Pages
man7.org › linux › man-pages › man1 › perf-trace.1.html
perf-trace(1) - Linux manual page
Look for cgroups to set at the /sys/fs/cgroup/perf_event directory, then remove the /sys/fs/cgroup/perf_event/ part and try: perf trace -G A -e sched:*switch Will set all raw_syscalls:sys_{enter,exit}, pgfault, vfs_getname, etc _and_ sched:sched_switch to the 'A' cgroup, while: perf trace -e sched:*switch -G A will only set the sched:sched_switch event to the 'A' cgroup, all the other events (raw_syscalls:sys_{enter,exit}, etc are left "without" a cgroup (on the root cgroup, sys wide, etc).
🌐
Brendan Gregg
brendangregg.com › blog › 2014-07-03 › perf-counting.html
perf Counting
# perf stat -e syscalls:sys_enter_read --filter 'count > 4096' -a sleep 5 Performance counter stats for 'system wide': 1 syscalls:sys_enter_read 5.001407932 seconds time elapsed
🌐
GitHub
github.com › brendangregg › perf-tools › blob › master › syscount
perf-tools/syscount at master · brendangregg/perf-tools
# REQUIREMENTS: Linux perf_events: add linux-tools-common, run "perf", then · # add any additional packages it requests. Also needs awk. # # OVERHEADS: Modes that report syscall names only (-c, -cp PID, -cd secs) have · # lower overhead, since they use in-kernel counts.
Author   brendangregg
🌐
Brendan Gregg
brendangregg.com › perf.html
Linux perf Examples
The report shows that there were 3,201 write() syscalls, and half that number of read() syscalls. Many of the other syscalls will be due to process and library initialization. A similar report can be seen using strace -c, the system call tracer, however it may induce much higher overhead than perf, as perf buffers data in-kernel.
🌐
Linux Man Pages
man7.org › linux › man-pages › man2 › perf_event_open.2.html
perf_event_open(2) - Linux manual page
#include <linux/perf_event.h> /* Definition of PERF_* constants */ #include <linux/hw_breakpoint.h> /* Definition of HW_* constants */ #include <sys/syscall.h> /* Definition of SYS_* constants */ #include <unistd.h> int syscall(SYS_perf_event_open, struct perf_event_attr *attr, pid_t pid, int cpu, int group_fd, unsigned long flags); Note: glibc provides no wrapper for perf_event_open(), necessitating the use of syscall(2).
🌐
PingCAP
pingcap.com › home › trace linux system calls with least impact on performance in production
Trace Linux System Calls with Least Impact on Performance
August 21, 2024 - Each cgroup ID corresponds to a bpf tail call that can call and execute another eBPF program and replace the execution context. Syscall events are written through a bpf tail call to a perf ring buffer with the same cgroup ID.
Top answer
1 of 1
5

Output from strace -Tttt -e trace=file is trace (tracing tool), and perf is usually used as profiling tool (aggregating time spent in function by name - in perf record by default on time or on hardware events + perf report, perf top modes) or as statistics tool (in perf stat mode - with counting of some events over all running time of the program).

You should try some tracing tool (trace-cmd, sysdig, lttng, ...) or you can try to use perf in tracing modes (perf record with tracepoints and perf script to output non-aggregated log over time)

There are tracepoints for syscalls (syscalls 614): http://www.brendangregg.com/perf.html#Tracepoints http://www.brendangregg.com/perf.html#StaticKernelTracing

perf record -e 'syscalls:sys_*' ./program
perf script

Example of output with format: process_name, pid, [cpu_core], time_since_boot_seconds.microseconds:, tracepoint_name, tracepoint_arguments

          ls 19178 [001]  16529.466566:                   syscalls:sys_enter_open: filename: 0x7f6ae4c38f82, flags: 0x00080000, mode: 0x
          ls 19178 [001]  16529.466570:                    syscalls:sys_exit_open: 0x4
          ls 19178 [001]  16529.466570:               syscalls:sys_enter_newfstat: fd: 0x00000004, statbuf: 0x7ffe22df92f0
          ls 19178 [001]  16529.466572:                syscalls:sys_exit_newfstat: 0x0
          ls 19178 [001]  16529.466573:                   syscalls:sys_enter_mmap: addr: 0x00000000, len: 0x00042e6f, prot: 0x00000001,
          ls 19178 [001]  16529.466767:                    syscalls:sys_exit_mmap: 0x7f6ae4df8000
          ls 19178 [001]  16529.466768:                  syscalls:sys_enter_close: fd: 0x00000004
          ls 19178 [001]  16529.466769:                   syscalls:sys_exit_close: 0x0

You may also try perf record -g -e 'syscalls:sys_*' to record function backtrace (to get information which function of the application did the syscall, and who did call this function; works better with debug information).

perf as tracing tool may not decode syscall (tracepoint) arguments; and tracing tools like trace-cmd or lttng may decode them better (at least decoding file name in open syscall).

Find elsewhere
🌐
SysTutorials
systutorials.com › docs › linux › man › 1-perf-trace
perf-trace: strace inspired tool - Linux Manuals (1)
-i --input Process events from a given perf data file. -T --time Print full timestamp rather time relative to first sample. ... Show process COMM right beside its ID, on by default, disable with --no-comm. ... Show only a summary of syscalls by thread with min, max, and average times (in msec) and relative stddev.
🌐
Arch Linux Man Pages
man.archlinux.org › man › perf-trace.1.en
perf-trace(1) — Arch manual pages
Show only syscalls that failed, i.e. that returned < 0. ... Process events from a given perf data file.
🌐
Linux Man Pages
man7.org › linux › man-pages › man1 › perf-script-python.1.html
perf-script-python(1) - Linux manual page
For this script, we only need to know that a syscall was entered; we don’t care how it exited, so we’ll use perf record to record only the sys_enter events: .ft C # perf record -a -e raw_syscalls:sys_enter ^C[ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 56.545 MB perf.data (~2470503 samples) ] .ft The options basically say to collect data for every syscall event system-wide and multiplex the per-cpu output into a single stream.
🌐
Opensource.com
opensource.com › article › 18 › 7 › fun-perf-and-python
How to analyze your system with perf and Python | Opensource.com
For the raw_syscalls events, we can generate a trace containing just those events: $ perf list | grep raw_syscalls raw_syscalls:sys_enter [Tracepoint event] raw_syscalls:sys_exit [Tracepoint event] $ perf record -e 'raw_syscalls:*' /bin/ls >/dev/null [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.025 MB perf.data (176 samples) ]
🌐
Terenceli
terenceli.github.io › 技术 › 2020 › 08 › 29 › perf-arch
Linux kernel perf architecture
‘perf’ is the user program that can be used to do performance profiling. There only exposed to userspace syscall perf_event_open returns an perf event fd. This syscall has no glibc wrapper. More info can be read in man page.
🌐
Ubuntu
manpages.ubuntu.com › manpages › bionic › man1 › perf-trace.1.html
Ubuntu Manpage: perf-trace - strace inspired tool
-a, --all-cpus System-wide collection from all CPUs. -e, --expr, --event List of syscalls and other perf events (tracepoints, HW cache events, etc) to show. Globbing is supported, e.g.: "epoll_*", "msg", etc.
🌐
Red Hat
developers.redhat.com › blog › 2019 › 04 › 23 › how-to-use-the-linux-perf-tool-to-count-software-events
How to count software events using the Linux perf tool | Red Hat Developer
November 5, 2025 - The following code will give system-wide count (-a option) of system calls (-e raw_syscalls:sys_enter) every second (-I 1000): # perf stat -a -e raw_syscalls:sys_enter -I 1000 # time counts unit events 1.000640941 1,250 raw_syscalls:sys_enter 2.001183785 1,901 raw_syscalls:sys_enter 3.001601593 1,922 raw_syscalls:sys_enter
🌐
Fishilico
fishilico.github.io › generic-config › sysadmin › perf-linux.html
Using perf on Linux — Generic Config
perf is a tool to analyze the performance of applications and of the kernel, on Linux-based systems. It relies on syscall perf_event_open (http://man7.org/linux/man-pages/man2/perf_event_open.2.html) to access performance monitoring facilities provided by the kernel.
🌐
LWN.net
lwn.net › Articles › 674283
perf tooling: Add 'perf bench syscall' benchmark [LWN.net]
February 1, 2016 - I've attached a quick patch that is basically a copy of 'perf bench numa' and which measures getppid() performance (simple syscall where the result is not cached by glibc). I kept the process, threading and memory allocation bits of numa.c, just in case we need them to measure more complex syscalls.