[Bug translator/9968] Share global variable between embedded C and script

fche at redhat dot com sourceware-bugzilla@sourceware.org
Wed Jul 17 17:36:00 GMT 2013


http://sourceware.org/bugzilla/show_bug.cgi?id=9968

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fche at redhat dot com

--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
A possible way of expressing this would be embedded-c pragmas that
synthesize the right kind of locking magic, plus a temporary collection
of STAP_GLOBAL_* macros to get/set identified scalars/maps.

global var
global var2
global var3

probe begin { 
    var[2] = "hogi"
    var3 = 5
    foo()
    println(var2["hogi"])
    exit() 
}

function foo () %{ 
   /* pragma:read:var */  /* pragma:write:var2 */ /* pragma:read:var3 */
   const char* value = STAP_GLOBAL_var_get_is(2);
   STAP_GLOBAL_var2_set_si(value, STAP_GLOBAL_var3_get());
%}

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Systemtap mailing list