[PATCH] Migrate THIS->__retvalue to STAP_RETVALUE in tapset

Zexuan Luo spacewanderlzx@gmail.com
Wed Aug 22 09:08:00 GMT 2018


Some tapset functions (without /* unmangled */ mark) still use
old-style 'THIS->'
syntax. Let's migrate them to the new style.

---
diff --git a/tapset/linux/aux_syscalls.stp b/tapset/linux/aux_syscalls.stp
index edf9b1757..f29a2fe4b 100644
--- a/tapset/linux/aux_syscalls.stp
+++ b/tapset/linux/aux_syscalls.stp
@@ -3975,9 +3975,9 @@ function _swapon_flags_str:string(flags:long)
 #elif defined(__mips__)
        unsigned long cp0 = kread(&regs->cp0_status);
 #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
-       THIS->__retvalue = ((cp0 & 0x08) == 8);
+       STAP_RETVALUE = ((cp0 & 0x08) == 8);
 #else
-       THIS->__retvalue = ((cp0 & 0x18) == 0x10);
+       STAP_RETVALUE = ((cp0 & 0x18) == 0x10);
 #endif
 #elif defined(__s390__) || defined(__s390x__)
        unsigned long mask = kread(&regs->psw.mask);
diff --git a/tapset/mips/registers.stp b/tapset/mips/registers.stp
index 723890ec0..23aa10d37 100644
--- a/tapset/mips/registers.stp
+++ b/tapset/mips/registers.stp
@@ -119,7 +119,7 @@ function _stp_register_regs() {
 function probing_app_with_32bit_regs() %{ /* pure */
        struct pt_regs *regs;
        regs = (CONTEXT->user_mode_p ? CONTEXT->uregs : NULL );
-        THIS->__retvalue = _stp_probing_app_with_32bit_regs(regs);
+       STAP_RETVALUE = _stp_probing_app_with_32bit_regs(regs);
 %}

 function _stp_get_register_by_offset:long (offset:long) %{ /* pure */
@@ -138,7 +138,7 @@ function _stp_get_register_by_offset:long
(offset:long) %{ /* pure */
                return;
        }
        memcpy(&value, ((char *)regs) + STAP_ARG_offset, sizeof(value));
-       THIS->__retvalue = value;
+       STAP_RETVALUE = value;
 %}

 function _stp_sign_extend32:long (value:long) {



More information about the Systemtap mailing list