SEC("tracepoint/syscalls/sys_enter_nanosleep") int probe(void *ctx)
{ /* This BPF program performs variable-offset reads and writes on a *stack-allocatedbuffer.
*/ char stack_buf[16]; unsignedlong len; unsignedlong last;
if ((bpf_get_current_pid_tgid() >> 32) != test_pid) return0;
/* Copy the input to the stack. */
__builtin_memcpy(stack_buf, input, 4);
/* The first byte in the buffer indicates the length. */
len = stack_buf[0] & 0xf;
last = (len - 1) & 0xf;
/* Append something to the buffer. The offset where we write is not *staticallyknown;thisisavariable-offsetstackwrite.
*/
stack_buf[len] = 42;
/* Index into the buffer at an unknown offset. This is a *variable-offsetstackread. * *Notethatifitwasn'tfortheprecedingvariable-offsetwrite,this *readwouldberejectedbecausethestackslotcannotbeverifiedas *beinginitialized.Withtheprecedingvariable-offsetwrite,the *stackslotstillcannotbeverified,butthewriteinhibitsthe *respectivecheckonthereasoningthat,iftherewasa *variable-offsettoahigher-or-equalspot,we'reprobablyreading *whatwejustwrote.
*/
probe_res = stack_buf[last]; return0;
}
char _license[] SEC("license") = "GPL";
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-10-12)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.