/* This is to calculate a delta between sys-enter and sys-exit for each thread */ struct syscall_trace { int nr; /* syscall number is only available at sys-enter */ int unused;
u64 timestamp;
};
tid = bpf_get_current_pid_tgid();
bpf_map_update_elem(&syscall_trace_map, &tid, &st, BPF_ANY);
return 0;
}
SEC("tp_btf/sys_exit") int sys_exit(u64 *ctx)
{ int tid; int key = 0;
u64 cgroup = 0; long ret = ctx[1]; /* return value of the syscall */ struct syscall_trace *st;
s64 delta;
if (!enabled) return 0;
tid = bpf_get_current_pid_tgid();
st = bpf_map_lookup_elem(&syscall_trace_map, &tid); if (st == NULL) return 0;
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.