This file is indexed.

/usr/share/systemtap/tapset/registers.stp is in systemtap-common 2.3-1ubuntu1.

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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
/* This is a stub tapset documenting a number of
 * architecture-dependent functions. For actual implementation of the
 * functions, see tapset/ARCH/registers.stp. */

/* <tapsetdescription>
 * The functions in this tapset can be used to access information
 * from the context at the time a probe point was hit. This includes
 * functions to access named CPU registers, and functions that provide
 * the values of a probed function's arguments. (The latter can be
 * called when you have hit a probe point at the entry to a function,
 * and are useful when the code you are probing was built without debugging
 * information.)
 *
 * Function arguments are referred to by number, starting at 1.
 * On 32-bit architectures
 * (and when probing 32-bit applications on 64-bit architectures)
 * a 64-bit argument occupies two "arg slots."
 * For example, if you are probing the following function
 * 
 *    void f(int a, long long b, char *c)
 * 
 * you would refer to a, b, and c as int_arg(1), longlong_arg(2), and
 * pointer_arg(3), respectively, on a 64-bit architecture;
 * but on a 32-bit architecture, you would refer to c as pointer_arg(4)
 * (since b occupies slots 2 and 3).
 * 
 * If the function you are probing doesn't follow the default rules
 * for argument passing, you need to call one of the following functions
 * in your handler before calling any *_arg function:
 * asmlinkage(), fastcall(), or regparm().
 * (This isn't necessary when referring to arguments only by name.)
 * 
 * For some architectures, the *_arg functions may reject unusually
 * high values of n.
 * </tapsetdescription> */

%( kernel_vr == "invalidkernel" %?

/**
 * sfunction register - Return the signed value of the named CPU register
 *
 * @name: Name of the register to return
 *
 * Description: Return the value of the named CPU register,
 * as it was saved when the current probe point was hit.
 * If the register is 32 bits, it is sign-extended to 64 bits.
 * 
 * For the i386 architecture, the following names are recognized.
 * (name1/name2 indicates that name1 and name2 are alternative names
 * for the same register.)
 * eax/ax, ebp/bp, ebx/bx, ecx/cx, edi/di, edx/dx, eflags/flags,
 * eip/ip, esi/si, esp/sp, orig_eax/orig_ax,
 * xcs/cs, xds/ds, xes/es, xfs/fs, xss/ss.
 * 
 * For the x86_64 architecture, the following names are recognized:
 * 64-bit registers:
 * r8, r9, r10, r11, r12, r13, r14, r15,
 * rax/ax, rbp/bp, rbx/bx, rcx/cx, rdi/di, rdx/dx,
 * rip/ip, rsi/si, rsp/sp;
 * 32-bit registers:
 * eax, ebp, ebx, ecx, edx, edi, edx, eip, esi, esp, flags/eflags,
 * orig_eax; segment registers: xcs/cs, xss/ss.
 * 
 * For powerpc, the following names are recognized:
 * r0, r1, ... r31, nip, msr, orig_gpr3, ctr, link, xer, ccr, softe, trap,
 * dar, dsisr, result.
 * 
 * For s390x, the following names are recognized:
 * r0, r1, ... r15, args, psw.mask, psw.addr, orig_gpr2, ilc, trap.
 */
function register:long (name:string) { }

/**
 * sfunction u_register - Return the unsigned value of the named CPU register
 * 
 * @name: Name of the register to return
 *
 * Description: Same as register(name), except that if the register
 * is 32 bits wide, it is zero-extended to 64 bits.
 */
function u_register:long (name:string) { }

/**
 * sfunction int_arg - Return function argument as signed int
 *
 * @n: index of argument to return
 *
 * Description: Return the value of argument n as a signed int
 * (i.e., a 32-bit integer sign-extended to 64 bits).
 */
function int_arg:long (n:long) { }

/**
 * sfunction uint_arg - Return function argument as unsigned int
 *
 * @n: index of argument to return
 *
 * Description: Return the value of argument n as an unsigned int
 * (i.e., a 32-bit integer zero-extended to 64 bits).
 */
function uint_arg:long (n:long) { }

/**
 * sfunction long_arg - Return function argument as signed long
 *
 * @n: index of argument to return
 *
 * Description: Return the value of argument n as a signed long.
 * On architectures where a long is 32 bits, the value is sign-extended
 * to 64 bits.
 */
function long_arg:long (n:long) { }

/**
 * sfunction ulong_arg - Return function argument as unsigned long
 *
 * @n: index of argument to return
 *
 * Description: Return the value of argument n as an unsigned long.
 * On architectures where a long is 32 bits, the value is zero-extended
 * to 64 bits.
 */
function ulong_arg:long (n:long) { }

/**
 * sfunction longlong_arg - Return function argument as 64-bit value
 *
 * @n: index of argument to return
 *
 * Description: Return the value of argument n as a 64-bit value.
 */
function longlong_arg:long (n:long) { }

/**
 * sfunction ulonglong_arg - Return function argument as 64-bit value
 *
 * @n: index of argument to return
 *
 * Description: Return the value of argument n as a 64-bit value.
 * (Same as longlong_arg.)
 */
function ulonglong_arg:long (n:long) { }

/**
 * sfunction pointer_arg - Return function argument as pointer value
 *
 * @n: index of argument to return
 *
 * Description: Return the unsigned value of argument n, same as ulong_arg.
 * Can be used with any type of pointer.
 */
function pointer_arg:long (n:long) { }

/**
 * sfunction s32_arg - Return function argument as signed 32-bit value
 *
 * @n: index of argument to return
 *
 * Description: Return the signed 32-bit value of argument n,
 * same as int_arg.
 */
function s32_arg:long (n:long) { }

/**
 * sfunction u32_arg - Return function argument as unsigned 32-bit value
 *
 * @n: index of argument to return
 *
 * Description: Return the unsigned 32-bit value of argument n,
 * same as uint_arg.
 */
function u32_arg:long (n:long) { }

/**
 * sfunction s64_arg - Return function argument as signed 64-bit value
 *
 * @n: index of argument to return
 *
 * Description: Return the signed 64-bit value of argument n,
 * same as longlong_arg.
 */
function s64_arg:long (n:long) { }

/**
 * sfunction u64_arg - Return function argument as unsigned 64-bit value
 *
 * @n: index of argument to return
 *
 * Description: Return the unsigned 64-bit value of argument n,
 * same as ulonglong_arg.
 */
function u64_arg:long (n:long) { }

/**
 * sfunction asmlinkage - Mark function as declared asmlinkage
 *
 * Description: Call this function before accessing arguments
 * using the *_arg functions
 * if the probed kernel function was declared asmlinkage in the source.
 */
function asmlinkage() { }

/**
 * sfunction fastcall - Mark function as declared fastcall
 *
 * Description: Call this function before accessing arguments
 * using the *_arg functions
 * if the probed kernel function was declared fastcall in the source.
 */
function fastcall() { }

/**
 * sfunction regparm - Specify regparm value used to compile function
 *
 * @n: original regparm value
 *
 * Description: Call this function with argument n before accessing function
 * arguments using the *_arg function is the function was build with the
 * gcc -mregparm=n option.
 *
 * (The i386 kernel is built with \-mregparm=3, so systemtap considers
 * regparm(3) the default for kernel functions on that architecture.)
 * Only valid on i386 and x86_64 (when probing 32bit applications).
 * Produces an error on other architectures.
 */
function regparm(n:long) { }

%)

/*
 * In nd_syscall.return probes, we sometimes need @entry() values. To
 * ensure we get the argument in the correct mode, we need a function
 * that calls asmlinkage() first.
 */
function __asmlinkage_int_arg:long(n:long)
{
	asmlinkage()
	return int_arg(n)
}