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 fors390_runtime_instr(), so you literally have to go throughsyscall(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, value1β start it up πS390_RUNTIME_INSTR_STOP, value2β 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 incommandis not a valid command. πEINVALβ the value specified insignumis not a real-time signal number. from Linux 4.4 onwards, thesignumargument 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
- Copyright 2012, International Business Machines Corp
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms