This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]