s390_runtime_instr(2)

πŸ’– s390_runtime_instr(2) β€” the vibe check πŸ’–

okay bestie, welcome to the System Calls Manual, section 2, and today's main character is s390_runtime_instr β€” the little syscall that turns CPU run-time instrumentation on and off. it lives on s390, it's lowkey mysterious, and glibc won't even hold its hand. let's get into it πŸ¦‹


✨ NAME ✨

s390_runtime_instr β€” enable/disable s390 CPU run-time instrumentation


πŸŽ€ LIBRARY πŸŽ€

Standard C library (libc, -lc). yes bestie, the usual suspect πŸ’…


🌸 SYNOPSIS 🌸

#include <asm/runtime_instr.h> /* Definition of S390_* constants */
#include <sys/syscall.h>       /* Definition of SYS_* constants */
#include <unistd.h>

int syscall(SYS_s390_runtime_instr, int command, int signum);
not me having to say this: glibc provides no wrapper for s390_runtime_instr(), so you literally have to go through syscall(2). there is no cute convenience function. it's giving "do it yourself, icon" 😭

πŸ‘‘ DESCRIPTION πŸ‘‘

so what does this thing actually do? s390_runtime_instr() starts or stops CPU run-time instrumentation for the calling thread. just the calling thread. your thread's business is its own, periodt ✨

the command argument controls the whole start/stop situation for the calling thread:

  • S390_RUNTIME_INSTR_START, value 1 β€” start it up πŸš€
  • S390_RUNTIME_INSTR_STOP, value 2 β€” shut it down πŸ›‘

and then there's signum, the number of a real-time signal. this argument was used to specify a signal number that should be delivered to the thread if the run-time instrumentation buffer was full, or if the run-time-instrumentation-halted interrupt had occurred. this feature was never used, and in Linux 4.4 support for it was removed β€” so in current kernels, this argument is ignored. it's giving ghosted πŸ™ˆ


πŸ’€ RETURN VALUE πŸ’€

on success, s390_runtime_instr() returns 0 and enables the thread for run-time instrumentation by assigning the thread a default run-time instrumentation control block. obsessed. the caller can then read and modify that control block and start the run-time instrumentation β€” you got the keys, bestie πŸ”‘

on error, -1 is returned and errno is set to indicate the error. classic.


🚨 ERRORS 🚨

  • EINVAL β€” the value specified in command is not a valid command. πŸ’€
  • EINVAL β€” the value specified in signum is not a real-time signal number. from Linux 4.4 onwards, the signum argument has no effect, so that an invalid signal number will not result in an error. (yes, same errno, different reason. we contain multitudes.)
  • ENOMEM β€” allocating memory for the run-time instrumentation control block failed. the memory said no 😭
  • EOPNOTSUPP β€” the run-time instrumentation facility is not available. it's not you, it's the hardware πŸ₯²

🌈 STANDARDS 🌈

Linux on s390.


πŸ•°οΈ HISTORY πŸ•°οΈ

Linux 3.7. System z EC12. vintage, honestly ✨


πŸ“ NOTES πŸ“

the asm/runtime_instr.h header file is available since Linux 4.16.

starting with Linux 4.4, support for signalling was removed, as was the check whether signum is a valid real-time signal.

for backwards compatibility with older kernels, it is recommended to pass a valid real-time signal number in signum and install a handler for that signal. no cap. do it even though modern kernels are gonna ignore it β€” old kernels are watching 🫢

πŸ”— SEE ALSO πŸ”—


and that's the whole page, bestie πŸŽ€ this one's from Linux man-pages 6.20, dated 2026-02-08 β€” go forth and instrument responsibly, you absolute icon πŸ’–βœ¨

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: GPL-2.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms