Skip to content

Commit dbee7ff

Browse files
bric3jbachorik
authored andcommitted
Unify unwinding counters to single counters
PROF-11368
1 parent 9f3567c commit dbee7ff

File tree

6 files changed

+39
-41
lines changed

6 files changed

+39
-41
lines changed

ddprof-lib/src/main/cpp/counters.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@
6060
X(AGCT_NATIVE_NO_JAVA_CONTEXT, "agct_native_no_java_context") \
6161
X(AGCT_BLOCKED_IN_VM, "agct_blocked_in_vm") \
6262
X(SKIPPED_WALLCLOCK_UNWINDS, "skipped_wallclock_unwinds") \
63-
X(UNWINDING_STUB_TIME, "unwinding_stub_time") \
64-
X(UNWINDING_COMPILED_TIME, "unwinding_compiled_time") \
65-
X(UNWINDING_ATOMIC_STUB_TIME, "unwinding_atomic_stub_time")
63+
X(UNWINDING_TIME, "unwinding_time")
6664
#define X_ENUM(a, b) a,
6765
typedef enum CounterId : int {
6866
DD_COUNTER_TABLE(X_ENUM) DD_NUM_COUNTERS

ddprof-lib/src/main/cpp/stackFrame_aarch64.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
7575
const u64 endTime = TSC::ticks();
7676
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
7777
if (duration > 1) {
78-
Counters::increment(UNWINDING_STUB_TIME, duration);
78+
Counters::increment(UNWINDING_TIME, duration);
7979
}
8080
return true;
8181
} else if (strcmp(name, "forward_copy_longs") == 0 ||
@@ -97,7 +97,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
9797
const u64 endTime = TSC::ticks();
9898
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
9999
if (duration > 1) {
100-
Counters::increment(UNWINDING_STUB_TIME, duration);
100+
Counters::increment(UNWINDING_TIME, duration);
101101
}
102102
return true;
103103
} else if (entry != NULL && entry[0] == 0xa9bf7bfd) {
@@ -111,7 +111,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
111111
const u64 endTime = TSC::ticks();
112112
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
113113
if (duration > 1) {
114-
Counters::increment(UNWINDING_STUB_TIME, duration);
114+
Counters::increment(UNWINDING_TIME, duration);
115115
}
116116
return true;
117117
} else if (entry[1] == 0x910003fd && withinCurrentStack(fp)) {
@@ -122,7 +122,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
122122
const u64 endTime = TSC::ticks();
123123
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
124124
if (duration > 1) {
125-
Counters::increment(UNWINDING_STUB_TIME, duration);
125+
Counters::increment(UNWINDING_TIME, duration);
126126
}
127127
return true;
128128
}
@@ -136,15 +136,15 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
136136
const u64 endTime = TSC::ticks();
137137
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
138138
if (duration > 1) {
139-
Counters::increment(UNWINDING_STUB_TIME, duration);
139+
Counters::increment(UNWINDING_TIME, duration);
140140
}
141141
return true;
142142
}
143143

144144
const u64 endTime = TSC::ticks();
145145
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
146146
if (duration > 1) {
147-
Counters::increment(UNWINDING_STUB_TIME, duration);
147+
Counters::increment(UNWINDING_TIME, duration);
148148
}
149149
return false;
150150
}
@@ -170,7 +170,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
170170
const u64 endTime = TSC::ticks();
171171
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
172172
if (duration > 1) {
173-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
173+
Counters::increment(UNWINDING_TIME, duration);
174174
}
175175
} else if (ip > entry && ip[0] == 0x910003fd && ip[-1] == 0xa9bf7bfd) {
176176
// stp x29, x30, [sp, #-16]!
@@ -181,7 +181,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
181181
const u64 endTime = TSC::ticks();
182182
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
183183
if (duration > 1) {
184-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
184+
Counters::increment(UNWINDING_TIME, duration);
185185
}
186186
} else if (ip > entry + 3 && !nm->isFrameCompleteAt(ip) &&
187187
(isEntryBarrier(ip) || isEntryBarrier(ip + 1))) {
@@ -193,7 +193,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
193193
const u64 endTime = TSC::ticks();
194194
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
195195
if (duration > 1) {
196-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
196+
Counters::increment(UNWINDING_TIME, duration);
197197
}
198198
} else {
199199
// Just try
@@ -203,7 +203,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
203203
const u64 endTime = TSC::ticks();
204204
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
205205
if (duration > 1) {
206-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
206+
Counters::increment(UNWINDING_TIME, duration);
207207
}
208208
return true;
209209
}
@@ -220,7 +220,7 @@ bool StackFrame::unwindAtomicStub(const void*& pc) {
220220
const u64 endTime = TSC::ticks();
221221
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
222222
if (duration > 1) {
223-
Counters::increment(UNWINDING_ATOMIC_STUB_TIME, duration);
223+
Counters::increment(UNWINDING_TIME, duration);
224224
}
225225
return true;
226226
}
@@ -229,7 +229,7 @@ bool StackFrame::unwindAtomicStub(const void*& pc) {
229229
const u64 endTime = TSC::ticks();
230230
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
231231
if (duration > 1) {
232-
Counters::increment(UNWINDING_ATOMIC_STUB_TIME, duration);
232+
Counters::increment(UNWINDING_TIME, duration);
233233
}
234234
return false;
235235
}

ddprof-lib/src/main/cpp/stackFrame_arm.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
8787
const u64 endTime = TSC::ticks();
8888
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
8989
if (duration > 1) {
90-
Counters::increment(UNWINDING_STUB_TIME, duration);
90+
Counters::increment(UNWINDING_TIME, duration);
9191
}
9292
return true;
9393
}
9494

9595
const u64 endTime = TSC::ticks();
9696
u64 duration = TSC::ticks_to_millis(endTime - startTime);
9797
if (duration > 1) {
98-
Counters::increment(UNWINDING_STUB_TIME, duration);
98+
Counters::increment(UNWINDING_TIME, duration);
9999
}
100100
return false;
101101
}
@@ -116,7 +116,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
116116
const u64 endTime = TSC::ticks();
117117
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
118118
if (duration > 1) {
119-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
119+
Counters::increment(UNWINDING_TIME, duration);
120120
}
121121
return true;
122122
} else if (*ip == 0xe8bd4800) {
@@ -129,7 +129,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
129129
const u64 endTime = TSC::ticks();
130130
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
131131
if (duration > 1) {
132-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
132+
Counters::increment(UNWINDING_TIME, duration);
133133
}
134134
return true;
135135
}
@@ -138,7 +138,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
138138
const u64 endTime = TSC::ticks();
139139
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
140140
if (duration > 1) {
141-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
141+
Counters::increment(UNWINDING_TIME, duration);
142142
}
143143
return true;
144144
}

ddprof-lib/src/main/cpp/stackFrame_i386.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
8282
const u64 endTime = TSC::ticks();
8383
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
8484
if (duration > 1) {
85-
Counters::increment(UNWINDING_STUB_TIME, duration);
85+
Counters::increment(UNWINDING_TIME, duration);
8686
}
8787
return true;
8888
} else if (entry != NULL && entry[0] == 0x55 && entry[1] == 0x8b &&
@@ -97,7 +97,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
9797
const u64 endTime = TSC::ticks();
9898
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
9999
if (duration > 1) {
100-
Counters::increment(UNWINDING_STUB_TIME, duration);
100+
Counters::increment(UNWINDING_TIME, duration);
101101
}
102102
return true;
103103
} else if (withinCurrentStack(fp)) {
@@ -108,7 +108,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
108108
const u64 endTime = TSC::ticks();
109109
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
110110
if (duration > 1) {
111-
Counters::increment(UNWINDING_STUB_TIME, duration);
111+
Counters::increment(UNWINDING_TIME, duration);
112112
}
113113
return true;
114114
}
@@ -117,7 +117,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
117117
const u64 endTime = TSC::ticks();
118118
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
119119
if (duration > 1) {
120-
Counters::increment(UNWINDING_STUB_TIME, duration);
120+
Counters::increment(UNWINDING_TIME, duration);
121121
}
122122
return false;
123123
}
@@ -137,7 +137,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
137137
const u64 endTime = TSC::ticks();
138138
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
139139
if (duration > 1) {
140-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
140+
Counters::increment(UNWINDING_TIME, duration);
141141
}
142142
return true;
143143
} else if (*ip == 0x5d) {
@@ -149,15 +149,15 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
149149
const u64 endTime = TSC::ticks();
150150
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
151151
if (duration > 1) {
152-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
152+
Counters::increment(UNWINDING_TIME, duration);
153153
}
154154
return true;
155155
}
156156

157157
const u64 endTime = TSC::ticks();
158158
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
159159
if (duration > 1) {
160-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
160+
Counters::increment(UNWINDING_TIME, duration);
161161
}
162162
return false;
163163
}

ddprof-lib/src/main/cpp/stackFrame_ppc64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
121121
const u64 endTime = TSC::ticks();
122122
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
123123
if (duration > 1) {
124-
Counters::increment(UNWINDING_STUB_TIME, duration);
124+
Counters::increment(UNWINDING_TIME, duration);
125125
}
126126
return true;
127127
}
@@ -156,7 +156,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
156156
const u64 endTime = TSC::ticks();
157157
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
158158
if (duration > 1) {
159-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
159+
Counters::increment(UNWINDING_TIME, duration);
160160
}
161161
return true;
162162
}

ddprof-lib/src/main/cpp/stackFrame_x64.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
7676
const u64 endTime = TSC::ticks();
7777
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
7878
if (duration > 1) {
79-
Counters::increment(UNWINDING_STUB_TIME, duration);
79+
Counters::increment(UNWINDING_TIME, duration);
8080
}
8181
return true;
8282
}
8383
if (entry == nullptr) {
8484
const u64 endTime = TSC::ticks();
8585
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
8686
if (duration > 1) {
87-
Counters::increment(UNWINDING_STUB_TIME, duration);
87+
Counters::increment(UNWINDING_TIME, duration);
8888
}
8989
return false;
9090
}
@@ -93,7 +93,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
9393
const u64 endTime = TSC::ticks();
9494
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
9595
if (duration > 1) {
96-
Counters::increment(UNWINDING_STUB_TIME, duration);
96+
Counters::increment(UNWINDING_TIME, duration);
9797
}
9898
return false;
9999
}
@@ -108,7 +108,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
108108
const u64 endTime = TSC::ticks();
109109
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
110110
if (duration > 1) {
111-
Counters::increment(UNWINDING_STUB_TIME, duration);
111+
Counters::increment(UNWINDING_TIME, duration);
112112
}
113113
return true;
114114
} else if (withinCurrentStack(fp)) {
@@ -119,7 +119,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
119119
const u64 endTime = TSC::ticks();
120120
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
121121
if (duration > 1) {
122-
Counters::increment(UNWINDING_STUB_TIME, duration);
122+
Counters::increment(UNWINDING_TIME, duration);
123123
}
124124
return true;
125125
}
@@ -128,7 +128,7 @@ bool StackFrame::unwindStub(instruction_t *entry, const char *name,
128128
const u64 endTime = TSC::ticks();
129129
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
130130
if (duration > 1) {
131-
Counters::increment(UNWINDING_STUB_TIME, duration);
131+
Counters::increment(UNWINDING_TIME, duration);
132132
}
133133
return false;
134134
}
@@ -153,7 +153,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
153153
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
154154
if (duration > 1)
155155
{
156-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
156+
Counters::increment(UNWINDING_TIME, duration);
157157
}
158158
return true;
159159
} else if (*ip == 0x5d) {
@@ -165,7 +165,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
165165
const u64 endTime = TSC::ticks();
166166
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
167167
if (duration > 1) {
168-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
168+
Counters::increment(UNWINDING_TIME, duration);
169169
}
170170
return true;
171171
} else if (ip <= entry + 15 && ((uintptr_t)ip & 0xfff) && ip[-1] == 0x55) {
@@ -176,7 +176,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
176176
const u64 endTime = TSC::ticks();
177177
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
178178
if (duration > 1) {
179-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
179+
Counters::increment(UNWINDING_TIME, duration);
180180
}
181181
return true;
182182
} else if (ip <= entry + 7 && ip[0] == 0x48 && ip[1] == 0x89 &&
@@ -188,7 +188,7 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
188188
const u64 endTime = TSC::ticks();
189189
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
190190
if (duration > 1) {
191-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
191+
Counters::increment(UNWINDING_TIME, duration);
192192
}
193193
return true;
194194
} else if ((ip[0] == 0x41 && ip[1] == 0x81 && ip[2] == 0x7f &&
@@ -204,15 +204,15 @@ bool StackFrame::unwindCompiled(NMethod *nm, uintptr_t &pc, uintptr_t &sp,
204204
const u64 endTime = TSC::ticks();
205205
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
206206
if (duration > 1) {
207-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
207+
Counters::increment(UNWINDING_TIME, duration);
208208
}
209209
return true;
210210
}
211211

212212
const u64 endTime = TSC::ticks();
213213
const u64 duration = TSC::ticks_to_millis(endTime - startTime);
214214
if (duration > 1) {
215-
Counters::increment(UNWINDING_COMPILED_TIME, duration);
215+
Counters::increment(UNWINDING_TIME, duration);
216216
}
217217
return false;
218218
}

0 commit comments

Comments
 (0)