GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — async-profiler/src/lockTracer.h at jonoffcpu-dev · jonoffcpu/async-profiler

Expand file tree

/

lockTracer.h

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
73 lines (54 loc) · 2.13 KB
/

lockTracer.h

Copy path

File metadata and controls

73 lines (54 loc) · 2.13 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* Copyright The async-profiler authors
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _LOCKTRACER_H
#define _LOCKTRACER_H
#include <jvmti.h>
#include "arch.h"
#include "engine.h"
#include "event.h"
typedef jint (JNICALL *RegisterNativesFunc)(JNIEnv*, jclass, const JNINativeMethod*, jint);
typedef void (JNICALL *UnsafeParkFunc)(JNIEnv*, jobject, jboolean, jlong);
class LockTracer : public Engine {
private:
static bool _initialized;
static double _ticks_to_nanos;
static u64 _interval;
static volatile u64 _total_duration;
static u64 _start_time;
static jclass _Unsafe;
static jclass _LockTracer;
static jfieldID _parkBlocker;
static jmethodID _setEntry;
static Error initialize(jvmtiEnv* jvmti, JNIEnv* env);
static void setUnsafeParkEntry(JNIEnv* env, UnsafeParkFunc entry);
static void setEntry0(JNIEnv* env, jclass cls, jlong entry);
static RegisterNativesFunc _orig_register_natives;
static jint JNICALL RegisterNativesHook(JNIEnv* env, jclass cls, const JNINativeMethod* methods, jint nMethods);
static UnsafeParkFunc _orig_unsafe_park;
static void JNICALL UnsafeParkHook(JNIEnv* env, jobject instance, jboolean isAbsolute, jlong time);
static jobject getParkBlocker(jvmtiEnv* jvmti, JNIEnv* env);
static char* getLockName(jvmtiEnv* jvmti, JNIEnv* env, jobject lock);
static bool isConcurrentLock(const char* lock_name);
static void recordContendedLock(EventType event_type, u64 start_time, u64 end_time,
const char* lock_name, jobject lock, jlong timeout);
public:
const char* type() {
return "lock_tracer";
}
const char* title() {
return "Lock profile";
}
const char* units() {
return "ns";
}
long interval() {
return (long) (_interval * _ticks_to_nanos);
}
Error start(Arguments& args);
void stop();
static void JNICALL MonitorContendedEnter(jvmtiEnv* jvmti, JNIEnv* env, jthread thread, jobject object);
static void JNICALL MonitorContendedEntered(jvmtiEnv* jvmti, JNIEnv* env, jthread thread, jobject object);
};
#endif // _LOCKTRACER_H
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.