/usr/share/systemtap/tapset/ia64/registers.stp is in systemtap-common 2.9-2ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | /*
* Dwarfless register access for ia64.
*/
function _stp_sign_extend32:long (value:long) {
if (value & 0x80000000)
value |= (0xffffffff << 32)
return value
}
function probing_32bit_app:long() %{ /* pure */
STAP_RETVALUE = (CONTEXT->user_mode_p && _stp_is_compat_task());
%}
function arch_bytes:long() %{ /* pure */
STAP_RETVALUE = sizeof(long);
%}
function uarch_bytes:long() {
assert(user_mode(), "requires user mode")
return probing_32bit_app() ? 4 : 8
}
/*
* Return the value of function arg #argnum (1=first arg). If
* truncate=1, mask off the top 32 bits. If sign_extend=1 and
* truncate=1, sign-extend the 32-bit value.
*/
function _stp_arg:long (argnum:long, sign_extend:long, truncate:long)
%{ /* pure */
struct pt_regs *regs = (CONTEXT->user_mode_p ? NULL : CONTEXT->kregs);
int n;
unsigned long arg;
STAP_RETVALUE = 0;
if (!regs) {
snprintf(CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
"cannot access function args in this context");
CONTEXT->last_error = CONTEXT->error_buffer;
return;
}
if (STAP_ARG_argnum < 1 || STAP_ARG_argnum > 7) {
snprintf(CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
"cannot access arg(%ld)", (long int)STAP_ARG_argnum);
CONTEXT->last_error = CONTEXT->error_buffer;
return;
}
n = (int) STAP_ARG_argnum - 1;
arg = (unsigned long)ia64_fetch_register(32 + n, regs,
&CONTEXT->unwaddr);
if (STAP_ARG_truncate) {
if (STAP_ARG_sign_extend)
STAP_RETVALUE = (int64_t) __stp_sign_extend32(arg);
else
/* High bits may be garbage. */
STAP_RETVALUE = (int64_t) (arg & 0xffffffff);
}
else
STAP_RETVALUE = (int64_t) arg;
return;
%}
/* Return the value of function arg #argnum (1=first arg) as a signed int. */
function int_arg:long (argnum:long) {
return _stp_arg(argnum, 1, 1)
}
function uint_arg:long (argnum:long) {
return _stp_arg(argnum, 0, 1)
}
function long_arg:long (argnum:long) {
return _stp_arg(argnum, 1, 0)
}
function ulong_arg:long (argnum:long) {
return _stp_arg(argnum, 0, 0)
}
function longlong_arg:long (argnum:long) {
return _stp_arg(argnum, 0, 0)
}
function ulonglong_arg:long (argnum:long) {
return longlong_arg(argnum)
}
function pointer_arg:long (argnum:long) {
return _stp_arg(argnum, 0, 0)
}
function s32_arg:long (argnum:long) {
return int_arg(argnum)
}
function u32_arg:long (argnum:long) {
return uint_arg(argnum)
}
function asmlinkage() %{ /* pure */ %}
function fastcall() %{ /* pure */ %}
|