From: Vishal Chourasia <vishalc@linux.ibm.com>
To: linux-trace-kernel@vger.kernel.org
Cc: rostedt@goodmis.org, mhiramat@kernel.org
Subject: trace-cmd No such device Errors
Date: Thu, 15 May 2025 02:21:13 +0530 [thread overview]
Message-ID: <aCUCQW98EpmQg3zr@linux.ibm.com> (raw)
When running trace-cmd record, I encounter multiple "No such device"
errors due to the splice syscall failing with ENODEV for
/sys/kernel/tracing/per_cpu/cpuX/trace_pipe_raw files corresponding to
CPUs that are possible but not present.
Environment:
- Operating System: Red Hat Enterprise Linux 9.5 (Plow)
- Kernel: Linux 6.12.0-55.9.1.el10_0.ppc64le
- Architecture: ppc64le
- Command Executed: trace-cmd record -o /dev/null -v -e sched_switch -- sleep 1
- System CPU Configuration:
- /sys/devices/system/cpu/possible: 0-223
- /sys/devices/system/cpu/present: 0-63
- /sys/kernel/tracing/per_cpu/: Contains directories cpu0 to cpu223
Steps to Reproduce:
1. On a system with a mismatch between possible and present CPUs (e.g.,
possible: 0-223, present: 0-63).
2. Ensure /sys/kernel/tracing/per_cpu/ contains directories for all possible
CPUs (e.g., cpu0 to cpu223).
3. Run the command:
strace --decode-fds -kk -o strace/trace-cmd -ff -- trace-cmd record -o /dev/null -v -e sched_switch -- sleep 1
4. Observe the output and strace logs.
Expected Behavior: trace-cmd should only attempt to access
trace_pipe_raw files for CPUs that are present (e.g., cpu0 to cpu63),
completing the recording without errors.
Actual Behavior:
trace-cmd fails with multiple errors:
trace-cmd: No such device
recorder error in splice input
The strace output shows splice syscalls failing with ENODEV for
trace_pipe_raw files of non-present CPUs
(e.g., /sys/kernel/tracing/per_cpu/cpu223/trace_pipe_raw).
Example:
trace-cmd.47140:splice(5</sys/kernel/tracing/per_cpu/cpu223/trace_pipe_raw>, NULL, 7<pipe:[96498]>, NULL, 65536, SPLICE_F_MOVE) = -1 ENODEV (No such device)
Analysis:
- trace-cmd iterates over all directories in
/sys/kernel/tracing/per_cpu/ (which includes cpu0 to cpu223 for all
possible CPUs).
- It attempts to invoke splice on trace_pipe_raw for each CPU, including
those not present (e.g., cpu64 to cpu223).
- The splice syscall fails with ENODEV for non-present CPUs.
- Stack trace (from strace -kk):
splice(5</sys/kernel/tracing/per_cpu/cpu223/trace_pipe_raw>, ...)
> /usr/lib64/glibc-hwcaps/power10/libc.so.6(splice+0x74)
> /usr/bin/trace-cmd(splice_data+0x3b)
> /usr/bin/trace-cmd(tracecmd_start_recording+0x93)
> /usr/bin/trace-cmd(create_recorder+0x14f)
> /usr/bin/trace-cmd(start_threads+0x81b)
> /usr/bin/trace-cmd(record_trace.isra.0+0xf5f)
> /usr/bin/trace-cmd(trace_record+0x47)
> /usr/bin/trace-cmd(main+0xff)
# strace --decode-fds -kk -o strace/trace-cmd -ff -- trace-cmd record -o /dev/null -v -e sched_switch -- sleep 1
trace-cmd: No such device
trace-cmd: No such device
recorder error in splice input recorder error in splice input
recorder error in splice inputtrace-cmd: No such device
recorder error in splice input
trace-cmd: No such device
<snipped>
recorder error in splice input
trace-cmd: No such device
recorder error in splice input
recorder error in splice inputtrace-cmd: No such device
recorder error in splice inputtrace-cmd: No such device
recorder error in splice input
trace-cmd: No such device
trace-cmd: No such device
recorder error in splice input
recorder error in splice inputtrace-cmd: No such device
recorder error in splice input
trace-cmd: No such device
recorder error in splice inputtrace-cmd: No such device
recorder error in splice inputtrace-cmd: No such device
<snipped>
recorder error in splice input
recorder error in splice inputtrace-cmd: No such device
recorder error in splice inputtrace-cmd: No such device
recorder error in splice inputtrace-cmd: No such device
recorder error in splice input
CPU0 data recorded at offset=0x10000
0 bytes in size
CPU1 data recorded at offset=0x10000
0 bytes in size
<snipped>
CPU10 data recorded at offset=0x10000
0 bytes in size
CPU11 data recorded at offset=0x10000
<snipped>
0 bytes in size
CPU63 data recorded at offset=0x10000
0 bytes in size
CPU64 data recorded at offset=0x10000
0 bytes in size
<snipped?
CPU213 data recorded at offset=0x10000
0 bytes in size
<snipped>
CPU222 data recorded at offset=0x10000
0 bytes in size
CPU223 data recorded at offset=0x10000
0 bytes in size
# grep -i "such device" * | grep splice
trace-cmd.46981:splice(5</sys/kernel/tracing/per_cpu/cpu64/trace_pipe_raw>, NULL, 7<pipe:[86367]>, NULL, 65536, SPLICE_F_MOVE) = -1 ENODEV (No such device)
trace-cmd.46982:splice(5</sys/kernel/tracing/per_cpu/cpu65/trace_pipe_raw>, NULL, 7<pipe:[82351]>, NULL, 65536, SPLICE_F_MOVE) = -1 ENODEV (No such device)
trace-cmd.46983:splice(5</sys/kernel/tracing/per_cpu/cpu66/trace_pipe_raw>, NULL, 7<pipe:[81717]>, NULL, 65536, SPLICE_F_MOVE) = -1 ENODEV (No such device)
trace-cmd.46984:splice(5</sys/kernel/tracing/per_cpu/cpu67/trace_pipe_raw>, NULL, 7<pipe:[1932]>, NULL, 65536, SPLICE_F_MOVE) = -1 ENODEV (No such device)
trace-cmd.46985:splice(5</sys/kernel/tracing/per_cpu/cpu68/trace_pipe_raw>, NULL, 7<pipe:[92520]>, NULL, 65536, SPLICE_F_MOVE) = -1 ENODEV (No such device)
trace-cmd.46986:splice(5</sys/kernel/tracing/per_cpu/cpu69/trace_pipe_raw>, NULL, 7<pipe:[93494]>, NULL, 65536, SPLICE_F_MOVE) = -1 ENODEV (No such device)
<snipped>
trace-cmd.47136:splice(5</sys/kernel/tracing/per_cpu/cpu219/trace_pipe_raw>, NULL, 7<pipe:[19742]>, NULL, 65536, SPLICE_F_MOVE) = -1 ENODEV (No such device)
trace-cmd.47137:splice(5</sys/kernel/tracing/per_cpu/cpu220/trace_pipe_raw>, NULL, 7<pipe:[29868]>, NULL, 65536, SPLICE_F_MOVE) = -1 ENODEV (No such device)
trace-cmd.47138:splice(5</sys/kernel/tracing/per_cpu/cpu221/trace_pipe_raw>, NULL, 7<pipe:[42069]>, NULL, 65536, SPLICE_F_MOVE) = -1 ENODEV (No such device)
trace-cmd.47139:splice(5</sys/kernel/tracing/per_cpu/cpu222/trace_pipe_raw>, NULL, 7<pipe:[81737]>, NULL, 65536, SPLICE_F_MOVE) = -1 ENODEV (No such device)
trace-cmd.47140:splice(5</sys/kernel/tracing/per_cpu/cpu223/trace_pipe_raw>, NULL, 7<pipe:[96498]>, NULL, 65536, SPLICE_F_MOVE) = -1 ENODEV (No such device)
next reply other threads:[~2025-05-14 20:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 20:51 Vishal Chourasia [this message]
2025-05-19 14:39 ` trace-cmd No such device Errors Steven Rostedt
2025-05-19 16:18 ` Vishal Chourasia
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=aCUCQW98EpmQg3zr@linux.ibm.com \
--to=vishalc@linux.ibm.com \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.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.