/usr/share/systemtap/tapset/random.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 | /**
* sfunction randint - Return a random number between [0,n)
* @n: Number past upper limit of range, not larger than 2**20.
*/
function randint:long(n:long)
%{ /* unprivileged */
#define RANDMAX (1024*1024)
if (STAP_ARG_n > RANDMAX)
CONTEXT->last_error = "range too wide";
else {
STAP_RETVALUE = (uint64_t) _stp_random_u((unsigned long) STAP_ARG_n);
}
#undef RANDMAX
%}
|