-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathagent.h
More file actions
44 lines (31 loc) · 836 Bytes
/
agent.h
File metadata and controls
44 lines (31 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef _AGENT_H_
#define _AGENT_H_
#include <string>
#include <jvmti.h>
using namespace std;
class CPUProfiler;
class AllocationProfiler;
class LockProfiler;
class Agent {
public:
bool debug_mode;
bool is_attached;
CPUProfiler* cpu_profiler;
AllocationProfiler* allocation_profiler;
LockProfiler* lock_profiler;
Agent() {
debug_mode = false;
is_attached = false;
}
static Agent instance;
JavaVM* jvm;
JNIEnv* jni;
jvmtiEnv* jvmti;
void Init(JavaVM* jvm);
bool Attach();
bool CheckJVMTIError(jvmtiEnv* jvmti, jvmtiError error, string msg);
void LogMessage(string level, string msg);
void LogInfo(string msg);
void LogError(string msg);
};
#endif // _AGENT_H_