|
Server : Apache System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : matalashes ( 1004) PHP Version : 8.1.29 Disable Function : NONE Directory : /usr/share/systemtap/tapset/linux/ |
Upload File : |
/* utrace-only subset of register accessors */
%{
#include "syscall.h"
%}
function _utrace_syscall_nr:long () %{ /* pure */ /* stable */ /* myproc-unprivileged */
if (! CONTEXT->uregs || ! CONTEXT->user_mode_p) {
CONTEXT->last_error = "invalid call without context registers";
} else {
STAP_RETVALUE = _stp_syscall_get_nr(current, CONTEXT->uregs);
}
%}
function _utrace_syscall_arg:long (n:long) %{ /* pure */ /* myproc-unprivileged */
unsigned long arg = 0;
if (! CONTEXT->uregs || ! CONTEXT->user_mode_p) {
CONTEXT->last_error = "invalid call without context registers";
} else {
syscall_get_arguments(current, CONTEXT->uregs, (int)STAP_ARG_n, 1, &arg);
}
STAP_RETVALUE = arg;
%}
function _utrace_syscall_return:long () %{ /* pure */ /* stable */ /* myproc-unprivileged */
/*
* Here's the reason for the "unsigned long" cast. Since all
* values inside systemtap are 64-bit numbers, return values were
* getting sign extended. This caused return values to not match
* up with the same values passes as arguments.
*/
if (! CONTEXT->uregs || ! CONTEXT->user_mode_p) {
CONTEXT->last_error = "invalid call without context registers";
} else {
STAP_RETVALUE = (unsigned long)syscall_get_return_value(current,
CONTEXT->uregs);
}
%}