First shot of tapset for Smalltalk/X.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 21 Nov 2013 00:55:50 +0000
changeset 1 406b61c83976
parent 0 2c329a84bd89
child 2 ef575a931434
First shot of tapset for Smalltalk/X. Comes with simple example script to collect some STX-JVM statistics.
tapscripts/stx-jvm-stats.stp
tapset/stx_libjava.stp
tapset/stx_librun.stp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tapscripts/stx-jvm-stats.stp	Thu Nov 21 00:55:50 2013 +0000
@@ -0,0 +1,69 @@
+global stats;
+
+
+
+probe stx.jvm.monitorenter {
+    if ( pid() != target() ) next;
+    stats["MONITOR ENTER"] <<< 1;
+}
+
+probe stx.jvm.monitorenter.fat {
+    if ( pid() != target() ) next;
+    stats["MONITOR ENTER (fat)"] <<< 1;
+}
+
+probe stx.jvm.monitorexit {
+    if ( pid() != target() ) next;
+    stats["MONITOR EXIT"] <<< 1;
+}
+
+probe stx.jvm.monitorexit.fat {
+    if ( pid() != target() ) next;
+    stats["MONITOR EXIT (fat)"] <<< 1;
+}
+
+probe stx.jvm.throw {
+    if ( pid() != target() ) next;
+    stats["Exceptions thrown"] <<< 1;
+}
+
+probe stx.jvm.method.interpret {
+    if ( pid() != target() ) next;
+    stats["Methods interpreted"] <<< 1;
+}
+
+probe stx.jvm.class.loaded {
+    if ( pid() != target() ) next;
+    stats["Classes loaded"] <<< 1;
+}
+
+function print_counter(name) {    
+    printf("  %-35s : %10d\n", name, @count(stats[name]));
+}
+
+
+probe end {
+    
+    printf("=== STX-JVM Performance Statistics ===\n");
+    printf("\n");
+
+    printf(" -- Execution --\n");
+    print_counter("Methods interpreted");
+    printf("\n");
+
+    printf(" -- Classes --\n");
+    print_counter("Classes loaded");
+    printf("\n");
+
+    printf(" -- Exceptions --\n");
+    print_counter("Exceptions thrown");
+    printf("\n");
+
+    printf(" -- Monitors --\n");
+    print_counter("MONITOR ENTER");
+    print_counter("MONITOR ENTER (fat)");
+    print_counter("MONITOR EXIT");
+    print_counter("MONITOR EXIT (fat)");
+
+
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tapset/stx_libjava.stp	Thu Nov 21 00:55:50 2013 +0000
@@ -0,0 +1,14 @@
+#
+# Probes defined in Smalltalk/X Java support (for code not in the VM)
+#
+
+
+probe stx.libjava = process("libstx_libjava.so") {}
+
+
+probe stx.jvm.monitorenter.fat = stx.libjava.function("*_JavaVM___137MONITORENTER_") { }
+probe stx.jvm.monitorexit.fat  = stx.libjava.function("*_JavaVM___137MONITOREXIT_") { }
+
+probe stx.jvm.throw = stx.libjava.function("*JavaVM__throwException_") { }
+
+probe stx.jvm.class.loaded = stx.libjava.function("*_JavaClassRegistry__registerClass_") { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tapset/stx_librun.stp	Thu Nov 21 00:55:50 2013 +0000
@@ -0,0 +1,13 @@
+#
+# Probes defined in Smalltalk/X Virtual Machine
+#
+
+
+probe stx.librun = process("librun.so") {}
+
+
+probe stx.jvm.monitorenter = stx.librun.function("__monitorEnter") { }
+probe stx.jvm.monitorexit  = stx.librun.function("__monitorExit") { }
+
+
+probe stx.jvm.method.interpret = stx.librun.function("__jInterpret") { }