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 runtime/21020] reorganize argument passing from java probes


https://sourceware.org/bugzilla/show_bug.cgi?id=21020

--- Comment #2 from Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> ---
Thank you for the patch. Let me confirm again.

As of systemtap-3.0-7.el7 , it is possible to access java.lang.String argument
because $arg1 in method2 points to a valid address.

--------------------------------------------------------------------------------
# stap --compatible=3.0 -e 'probe
java("Test1").class("Test1").method("method1(int)") { printf("Hooked method1()
with arg = %d\n", $arg1); }
probe java("Test1").class("Test1").method("method2(String)") { printf("Hooked
method2() with arg = %s\n", user_string($arg1)); }
probe java("Test1").class("Test1").method("method3") { printf("Hooked
method3()\n"); }' -c 'java Test1'
100
Hello
Test1@73549af8
Setting org.jboss.byteman.transform.all=true
100
Hello
Test1@73549af8
Hooked method1() with arg = 100
Hooked method2() with arg = Hello
Hooked method3()
--------------------------------------------------------------------------------

If I built correctly from git source, as of commit f8bc2a5eb3e91ce7
"PR21020: reorganize data passing abi for java method parameters",
it is no longer possible to access java.lang.String argument using
--compatible=3.0 option because $arg1 in method2 points to NULL.
Is this what you meant?

--------------------------------------------------------------------------------
# stap --compatible=3.1 -e 'probe
java("Test1").class("Test1").method("method1(int)") { printf("Hooked method1()
with arg = %s\n", arg1); }
probe java("Test1").class("Test1").method("method2(String)") { printf("Hooked
method2() with arg = %s\n", arg1); }
probe java("Test1").class("Test1").method("method3(Test1)") { printf("Hooked
method3() with arg = %s\n", arg1); }' -c 'java Test1'
100
Hello
Test1@73549af8
Setting org.jboss.byteman.transform.all=true
100
Hello
Test1@73549af8
Hooked method1() with arg = 100
Hooked method2() with arg = Hello
Hooked method3() with arg = Test1@73549af8
--------------------------------------------------------------------------------
# stap --compatible=3.0 -e 'probe
java("Test1").class("Test1").method("method1(int)") { printf("Hooked method1()
with arg = %d\n", $arg1); }
probe java("Test1").class("Test1").method("method2(String)") { printf("Hooked
method2() with arg = %d\n", $arg1); }
probe java("Test1").class("Test1").method("method3(Test1)") { printf("Hooked
method3() with arg = %d\n", $arg1); }' -c 'java Test1'
100
Hello
Test1@73549af8
Setting org.jboss.byteman.transform.all=true
100
Hello
Test1@73549af8
Hooked method1() with arg = 100
Hooked method2() with arg = 0
Hooked method3() with arg = 0
--------------------------------------------------------------------------------

-- 
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]