| Server IP : 103.4.122.14 / Your IP : 216.73.216.103 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux cwp2.slnet.com.au 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : statewid ( 1251) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/systemtap/tapset/linux/ |
Upload File : |
%{
#include <linux/version.h>
%}
/**
* sfunction rlimit_from_str - Symbolic string associated with resource limit code
*
* @lim_str: The string representation of limit
*
* Description: This function returns the number associated
* with the given string, such as 0 for the string RLIMIT_CPU, or
* -1 for an out-of-range value.
*/
function rlimit_from_str:long (lim_str:string)
%{ /* pure */ /* unmodified-fnargs */
#define aux_rlimit(limit_arg) \
if (strncmp(STAP_ARG_lim_str, #limit_arg, MAXSTRINGLEN) == 0) { \
STAP_RETVALUE = limit_arg; \
return; \
}
/* Little kernel history digging */
/* This set is stable from 2.6.1 kernel version */
aux_rlimit(RLIMIT_CPU);
aux_rlimit(RLIMIT_FSIZE);
aux_rlimit(RLIMIT_DATA);
aux_rlimit(RLIMIT_STACK);
aux_rlimit(RLIMIT_CORE);
aux_rlimit(RLIMIT_RSS);
aux_rlimit(RLIMIT_NPROC);
aux_rlimit(RLIMIT_NOFILE);
aux_rlimit(RLIMIT_MEMLOCK);
aux_rlimit(RLIMIT_AS);
aux_rlimit(RLIMIT_LOCKS);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,8)
aux_rlimit(RLIMIT_SIGPENDING);
aux_rlimit(RLIMIT_MSGQUEUE);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
aux_rlimit(RLIMIT_NICE);
aux_rlimit(RLIMIT_RTPRIO);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
aux_rlimit(RLIMIT_RTTIME);
#endif
STAP_RETVALUE = -1;
#undef aux_rlimit
%}