75 #include "services/runtimeService.hpp"
76 #include "trace/tracing.hpp"
77 #include "trace/traceEventTypes.hpp"
78 #include "utilities/defaultStream.hpp"
79 #include "utilities/dtrace.hpp"
80 #include "utilities/events.hpp"
81 #include "utilities/histogram.hpp"
82 #ifdef TARGET_OS_FAMILY_linux
83 # include "os_linux.inline.hpp"
84 #endif
85 #ifdef TARGET_OS_FAMILY_solaris
86 # include "os_solaris.inline.hpp"
87 #endif
88 #ifdef TARGET_OS_FAMILY_windows
89 # include "os_windows.inline.hpp"
90 #endif
91 #ifdef TARGET_OS_FAMILY_bsd
92 # include "os_bsd.inline.hpp"
93 #endif
94
95 static jint CurrentVersion = JNI_VERSION_1_6;
96
97
98 // The DT_RETURN_MARK macros create a scoped object to fire the dtrace
99 // '-return' probe regardless of the return path is taken out of the function.
100 // Methods that have multiple return paths use this to avoid having to
101 // instrument each return path. Methods that use CHECK or THROW must use this
102 // since those macros can cause an immedate uninstrumented return.
103 //
104 // In order to get the return value, a reference to the variable containing
105 // the return value must be passed to the contructor of the object, and
106 // the return value must be set before return (since the mark object has
107 // a reference to it).
108 //
109 // Example:
110 // DT_RETURN_MARK_DECL(SomeFunc, int);
111 // JNI_ENTRY(int, SomeFunc, ...)
112 // int return_value = 0;
113 // DT_RETURN_MARK(SomeFunc, int, (const int&)return_value);
114 // foo(CHECK_0)
115 // return_value = 5;
|
75 #include "services/runtimeService.hpp"
76 #include "trace/tracing.hpp"
77 #include "trace/traceEventTypes.hpp"
78 #include "utilities/defaultStream.hpp"
79 #include "utilities/dtrace.hpp"
80 #include "utilities/events.hpp"
81 #include "utilities/histogram.hpp"
82 #ifdef TARGET_OS_FAMILY_linux
83 # include "os_linux.inline.hpp"
84 #endif
85 #ifdef TARGET_OS_FAMILY_solaris
86 # include "os_solaris.inline.hpp"
87 #endif
88 #ifdef TARGET_OS_FAMILY_windows
89 # include "os_windows.inline.hpp"
90 #endif
91 #ifdef TARGET_OS_FAMILY_bsd
92 # include "os_bsd.inline.hpp"
93 #endif
94
95 static jint CurrentVersion = JNI_VERSION_1_8;
96
97
98 // The DT_RETURN_MARK macros create a scoped object to fire the dtrace
99 // '-return' probe regardless of the return path is taken out of the function.
100 // Methods that have multiple return paths use this to avoid having to
101 // instrument each return path. Methods that use CHECK or THROW must use this
102 // since those macros can cause an immedate uninstrumented return.
103 //
104 // In order to get the return value, a reference to the variable containing
105 // the return value must be passed to the contructor of the object, and
106 // the return value must be set before return (since the mark object has
107 // a reference to it).
108 //
109 // Example:
110 // DT_RETURN_MARK_DECL(SomeFunc, int);
111 // JNI_ENTRY(int, SomeFunc, ...)
112 // int return_value = 0;
113 // DT_RETURN_MARK(SomeFunc, int, (const int&)return_value);
114 // foo(CHECK_0)
115 // return_value = 5;
|