Skip to content

Commit 10160a9

Browse files
jensjohaCommit Queue
authored andcommitted
[CFE] Fixes for instrumenter
Change-Id: Ib63140b2a64a9ab1a235d1b8e2e8872e13eecd34 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448401 Commit-Queue: Jens Johansen <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
1 parent 9e89e91 commit 10160a9

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

pkg/front_end/tool/flame/instrumenter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class TimerCounterInstrumenterConfig implements InstrumenterConfig {
247247
Set<String> procedureNamesWantedInFile =
248248
wanted[p.fileUri.pathSegments.last] ?? const {};
249249
return procedureNamesWantedInFile.contains(name) ||
250-
!procedureNamesWantedInFile.contains("*");
250+
procedureNamesWantedInFile.contains("*");
251251
}
252252

253253
@override

pkg/front_end/tool/flame/instrumenter_lib.dart

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,18 @@ void _processData(WithOutputInfo? withOutputInfo, int factorForMicroSeconds) {
112112
"${withOutputInfo.names[enterProcedureNumber]}.",
113113
);
114114
}
115-
bool foundMatch = false;
116-
int steps = 1;
115+
int? foundAt;
117116
for (int i = _activeStack.length - 2; i >= 0; i -= 2) {
118-
steps++;
119117
if (_activeStack[i] == procedureNumber) {
120-
foundMatch = true;
118+
foundAt = i;
121119
break;
122120
}
123121
}
124-
if (foundMatch) {
122+
if (foundAt != null) {
125123
_activeStack.add(enterProcedureNumber);
126124
_activeStack.add(enterTicks);
127-
enterProcedureNumber = _activeStack.removeAt(
128-
_activeStack.length - steps * 2,
129-
);
130-
enterTicks = _activeStack.removeAt(_activeStack.length - steps * 2);
125+
enterProcedureNumber = _activeStack.removeAt(foundAt);
126+
enterTicks = _activeStack.removeAt(foundAt);
131127
assert(enterProcedureNumber != procedureNumber);
132128
} else {
133129
throw "Mismatching enter/exit with no matching "

0 commit comments

Comments
 (0)