comparison src/share/vm/runtime/os.hpp @ 12117:f92b82d454fa

8014135: The JVMTI specification does not conform to recent changes in JNI specification Summary: Added support for statically linked agents Reviewed-by: sspitsyn, bobv, coleenp
author bpittore
date Fri, 23 Aug 2013 20:33:02 -0400
parents af21010d1062
children 62f527c674d2
comparison
equal deleted inserted replaced
12094:73921c720b94 12117:f92b82d454fa
44 #ifdef TARGET_OS_FAMILY_bsd 44 #ifdef TARGET_OS_FAMILY_bsd
45 # include "jvm_bsd.h" 45 # include "jvm_bsd.h"
46 # include <setjmp.h> 46 # include <setjmp.h>
47 #endif 47 #endif
48 48
49 class AgentLibrary;
50
49 // os defines the interface to operating system; this includes traditional 51 // os defines the interface to operating system; this includes traditional
50 // OS services (time, I/O) as well as other functionality with system- 52 // OS services (time, I/O) as well as other functionality with system-
51 // dependent code. 53 // dependent code.
52 54
53 typedef void (*dll_func)(...); 55 typedef void (*dll_func)(...);
535 static void* dll_lookup(void* handle, const char* name); 537 static void* dll_lookup(void* handle, const char* name);
536 538
537 // Unload library 539 // Unload library
538 static void dll_unload(void *lib); 540 static void dll_unload(void *lib);
539 541
542 // Return the handle of this process
543 static void* get_default_process_handle();
544
545 // Check for static linked agent library
546 static bool find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
547 size_t syms_len);
548
549 // Find agent entry point
550 static void *find_agent_function(AgentLibrary *agent_lib, bool check_lib,
551 const char *syms[], size_t syms_len);
552
540 // Print out system information; they are called by fatal error handler. 553 // Print out system information; they are called by fatal error handler.
541 // Output format may be different on different platforms. 554 // Output format may be different on different platforms.
542 static void print_os_info(outputStream* st); 555 static void print_os_info(outputStream* st);
543 static void print_os_info_brief(outputStream* st); 556 static void print_os_info_brief(outputStream* st);
544 static void print_cpu_info(outputStream* st); 557 static void print_cpu_info(outputStream* st);
803 // Used at creation if requested by the diagnostic flag PauseAtStartup. 816 // Used at creation if requested by the diagnostic flag PauseAtStartup.
804 // Causes the VM to wait until an external stimulus has been applied 817 // Causes the VM to wait until an external stimulus has been applied
805 // (for Unix, that stimulus is a signal, for Windows, an external 818 // (for Unix, that stimulus is a signal, for Windows, an external
806 // ResumeThread call) 819 // ResumeThread call)
807 static void pause(); 820 static void pause();
821
822 // Builds a platform dependent Agent_OnLoad_<libname> function name
823 // which is used to find statically linked in agents.
824 static char* build_agent_function_name(const char *sym, const char *cname,
825 bool is_absolute_path);
808 826
809 class SuspendedThreadTaskContext { 827 class SuspendedThreadTaskContext {
810 public: 828 public:
811 SuspendedThreadTaskContext(Thread* thread, void *ucontext) : _thread(thread), _ucontext(ucontext) {} 829 SuspendedThreadTaskContext(Thread* thread, void *ucontext) : _thread(thread), _ucontext(ucontext) {}
812 Thread* thread() const { return _thread; } 830 Thread* thread() const { return _thread; }