diff options
Diffstat (limited to 'tapset')
-rw-r--r-- | tapset/aux_syscalls.stp | 3 | ||||
-rw-r--r-- | tapset/i686/registers.stp | 50 | ||||
-rw-r--r-- | tapset/socket.stp | 6 |
3 files changed, 40 insertions, 19 deletions
diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index 87ea4e04..009b0532 100644 --- a/tapset/aux_syscalls.stp +++ b/tapset/aux_syscalls.stp @@ -325,7 +325,8 @@ function _struct_sockaddr_u:string(uaddr:long, len:long) struct sockaddr_ll *sll = (struct sockaddr_ll *)buf; snprintf(str, strlen, "{AF_PACKET, proto=%d, ind=%d, hatype=%d, pkttype=%d, halen=%d, addr=0x%llx}", (int)sll->sll_protocol, sll->sll_ifindex, (int)sll->sll_hatype, (int)sll->sll_pkttype, - (int)sll->sll_halen, *(uint64_t *)sll->sll_addr); + (int)sll->sll_halen, + (long long)(*(uint64_t *)sll->sll_addr)); } else { diff --git a/tapset/i686/registers.stp b/tapset/i686/registers.stp index a6e5694e..997376dc 100644 --- a/tapset/i686/registers.stp +++ b/tapset/i686/registers.stp @@ -1,25 +1,39 @@ global _reg_offsets, _stp_regs_registered, _sp_offset, _ss_offset +function test_x86_gs:long() %{ /* pure */ +#ifdef STAPCONF_X86_GS + THIS->__retvalue = 1; +#else + THIS->__retvalue = 0; +#endif +%} + function _stp_register_regs() { + /* Same order as pt_regs */ - _reg_offsets["ebx"] = 0 _reg_offsets["bx"] = 0 - _reg_offsets["ecx"] = 4 _reg_offsets["cx"] = 4 - _reg_offsets["edx"] = 8 _reg_offsets["dx"] = 8 - _reg_offsets["esi"] = 12 _reg_offsets["si"] = 12 - _reg_offsets["edi"] = 16 _reg_offsets["di"] = 16 - _reg_offsets["ebp"] = 20 _reg_offsets["bp"] = 20 - _reg_offsets["eax"] = 24 _reg_offsets["ax"] = 24 - _reg_offsets["xds"] = 28 _reg_offsets["ds"] = 28 - _reg_offsets["xes"] = 32 _reg_offsets["es"] = 32 - _reg_offsets["xfs"] = 36 _reg_offsets["fs"] = 36 - _reg_offsets["orig_eax"] = 40 _reg_offsets["orig_ax"] = 40 - _reg_offsets["eip"] = 44 _reg_offsets["ip"] = 44 - _reg_offsets["xcs"] = 48 _reg_offsets["cs"] = 48 - _reg_offsets["eflags"] = 52 _reg_offsets["flags"] = 52 - _reg_offsets["esp"] = 56 _reg_offsets["sp"] = 56 - _reg_offsets["xss"] = 60 _reg_offsets["ss"] = 60 - _sp_offset = 56 - _ss_offset = 60 + _reg_offsets["ebx"] = 0 _reg_offsets["bx"] = 0 + _reg_offsets["ecx"] = 4 _reg_offsets["cx"] = 4 + _reg_offsets["edx"] = 8 _reg_offsets["dx"] = 8 + _reg_offsets["esi"] = 12 _reg_offsets["si"] = 12 + _reg_offsets["edi"] = 16 _reg_offsets["di"] = 16 + _reg_offsets["ebp"] = 20 _reg_offsets["bp"] = 20 + _reg_offsets["eax"] = 24 _reg_offsets["ax"] = 24 + _reg_offsets["xds"] = 28 _reg_offsets["ds"] = 28 + _reg_offsets["xes"] = 32 _reg_offsets["es"] = 32 + _reg_offsets["xfs"] = 36 _reg_offsets["fs"] = 36 + gs_incr = 0 +if (test_x86_gs()) { + gs_incr = 4 + _reg_offsets["xgs"] = 40 _reg_offsets["gs"] = 40 +} + _reg_offsets["orig_eax"] = 40 + gs_incr _reg_offsets["orig_ax"] = 40 + gs_incr + _reg_offsets["eip"] = 44 + gs_incr _reg_offsets["ip"] = 44 + gs_incr + _reg_offsets["xcs"] = 48 + gs_incr _reg_offsets["cs"] = 48 + gs_incr + _reg_offsets["eflags"] = 52 + gs_incr _reg_offsets["flags"] = 52 + gs_incr + _reg_offsets["esp"] = 56 + gs_incr _reg_offsets["sp"] = 56 + gs_incr + _reg_offsets["xss"] = 60 + gs_incr _reg_offsets["ss"] = 60 + gs_incr + _sp_offset = 56 + gs_incr + _ss_offset = 60 + gs_incr _stp_regs_registered = 1 } diff --git a/tapset/socket.stp b/tapset/socket.stp index 0f01b8d4..de778d7c 100644 --- a/tapset/socket.stp +++ b/tapset/socket.stp @@ -545,6 +545,7 @@ probe socket.close.return = kernel.function ("sock_release").return /** * sfunction sock_prot_num2str - Given a protocol number, return a string representation. + * @proto: The protocol number. */ function sock_prot_num2str:string (proto:long) { @@ -553,6 +554,7 @@ function sock_prot_num2str:string (proto:long) /** * sfunction sock_prot_str2num - Given a protocol name (string), return the corresponding protocol number. + * @proto: The protocol name. */ function sock_prot_str2num:long (proto:string) { @@ -563,6 +565,7 @@ function sock_prot_str2num:long (proto:string) /** * sfunction sock_fam_num2str - Given a protocol family number, return a string representation. + * @family: The family number. */ function sock_fam_num2str:string (family:long) { @@ -572,6 +575,7 @@ function sock_fam_num2str:string (family:long) /** * sfunction sock_fam_str2num - Given a protocol family name (string), return the corresponding * protocol family number. + * @family: The family name. */ function sock_fam_str2num:long (family:string) { @@ -582,6 +586,7 @@ function sock_fam_str2num:long (family:string) /** * sfunction sock_state_num2str - Given a socket state number, return a string representation. + * @state: The state number. */ function sock_state_num2str:string (state:long) { @@ -590,6 +595,7 @@ function sock_state_num2str:string (state:long) /** * sfunction sock_state_str2num - Given a socket state string, return the corresponding state number. + * @state: The state name. */ function sock_state_str2num:long (state:string) { |