GitLab will be upgraded on 30 Jan 2023 from 2.00 pm (AEDT) to 3.00 pm (AEDT). During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

dacapolog.h 2.68 KB
Newer Older
john's avatar
john committed
1
2
3
4
5
#ifndef DACAPO_LOG_H
#define DACAPO_LOG_H

#include "dacapo.h"

john's avatar
john committed
6
7
#include "dacapolock.h"

8
9
10
#define LOG_PREFIX_START                      "START"
#define LOG_PREFIX_STOP                       "STOP"

john's avatar
john committed
11
12
#define LOG_PREFIX_ALLOCATION                 "HA"
#define LOG_PREFIX_FREE                       "HF"
john's avatar
john committed
13
#define LOG_PREFIX_POINTER                    "HC"
john's avatar
john committed
14
#define LOG_PREFIX_STATIC_POINTER             "HS"
john's avatar
john committed
15
16
17

#define LOG_PREFIX_CLASS_PREPARE              "LD"
#define LOG_PREFIX_METHOD_PREPARE             "LM"
18
#define LOG_PREFIX_CLASS_INITIALIZATION       "CI"
john's avatar
john committed
19
20
21

#define LOG_PREFIX_THREAD_START               "TS"
#define LOG_PREFIX_THREAD_STOP                "TE"
john's avatar
john committed
22
#define LOG_PREFIX_THREAD_STATUS              "TA"
23
#define LOG_PREFIX_THREAD_TIME                "TT"               
john's avatar
john committed
24
25
26
27

#define LOG_PREFIX_METHOD_ENTER               "CS"
#define LOG_PREFIX_METHOD_EXIT                "CE"

john's avatar
john committed
28
#define LOG_PREFIX_MONITOR_ACQUIRE            "MS"
john's avatar
john committed
29
#define LOG_PREFIX_MONITOR_RELEASE            "ME"
john's avatar
john committed
30
#define LOG_PREFIX_MONITOR_NOTIFY             "MN"
john's avatar
john committed
31
32
33
34
35
#define LOG_PREFIX_MONITOR_CONTENTED_ENTER    "MC"
#define LOG_PREFIX_MONITOR_CONTENTED_ENTERED  "Mc"
#define LOG_PREFIX_MONITOR_WAIT               "MW"
#define LOG_PREFIX_MONITOR_WAITED             "Mw"

john's avatar
john committed
36
37
38
#define LOG_PREFIX_VOLATILE                   "VF"
#define LOG_PREFIX_VOLATILE_ACCESS            "VA"

john's avatar
john committed
39
40
41
#define LOG_PREFIX_EXCEPTION                  "XT"
#define LOG_PREFIX_EXCEPTION_CATCH            "XC"

42
43
#define LOG_PREFIX_TIME                       "TM"

44
#define LOG_PREFIX_GC                         "GC"
45
#define LOG_PREFIX_HEAP_REPORT                "HR"
46

john's avatar
john committed
47
48
49
50
#define LOG_PREFIX_CALL_CHAIN_START           "ES"
#define LOG_PREFIX_CALL_CHAIN_FRAME           "EF"
#define LOG_PREFIX_CALL_CHAIN_STOP            "EE"

51

john's avatar
john committed
52
53
extern MonitorLockType       lockLog;
extern MonitorLockType       agentLock;
54

john's avatar
john committed
55
56
57
extern jboolean            logState;

_Bool dacapo_log_init();
john's avatar
john committed
58
59
_Bool logFileOpen();
void  dacapo_log_stop();
john's avatar
john committed
60

61
void  callReportHeap(JNIEnv *env);
62
void  setReportHeap(JNIEnv *env, jboolean flag);
john's avatar
john committed
63
64
void  setReportCallChain(JNIEnv *env, jlong frequency, jboolean enable);

john's avatar
john committed
65
void* log_get_buffer();
john's avatar
john committed
66
67
68
void  log_field_string(const char* text);
void  log_field_string_n(const char* text, int text_length);
void  log_field_jboolean(jboolean v);
john's avatar
john committed
69
void  log_field_jint(int v);
john's avatar
john committed
70
71
72
73
void  log_field_int(int v);
void  log_field_pointer(const void* p);
void  log_field_jlong(jlong v);
void  log_field_long(long v);
74
void  log_field_current_time();
john's avatar
john committed
75
76
void  log_thread(jthread thread, jlong thread_tag, jboolean thread_has_new_tag, jobject klass, jlong klass_tag, jboolean klass_has_new_tag);
void  log_class(jobject klass, jlong klass_tag, jboolean klass_has_new_tag);
77
void  log_field_time(struct timeval* tv);
john's avatar
john committed
78
79
void  log_eol();

john's avatar
john committed
80
#endif