Skip to content

Commit

Permalink
Merge pull Tencent#844
Browse files Browse the repository at this point in the history
  • Loading branch information
ifshuaishuai committed Sep 28, 2024
1 parent 772d9e3 commit 73ed478
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class AgpCompat {
@JvmStatic
val asmApi: Int
get() = when {
VersionsCompat.greatThanOrEqual(AGPVersion.AGP_7_3_1) -> Opcodes.ASM7
VersionsCompat.greatThanOrEqual(AGPVersion.AGP_7_0_0) -> Opcodes.ASM6
else -> Opcodes.ASM5
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ enum class AGPVersion(
AGP_3_6_0("3.6.0"),
AGP_4_0_0("4.0.0"),
AGP_4_1_0("4.1.0"),
AGP_7_0_0("7.0.0")
AGP_7_0_0("7.0.0"),
AGP_7_3_1("7.3.1")
}

class VersionsCompat {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,18 @@ public boolean isValid() {
@Override
public void onDispatchBegin(String log) {
indexRecord = AppMethodBeat.getInstance().maskIndex("EvilMethodTracer#dispatchBegin");

if (config.isAppMethodBeatEnable()) {
AppMethodBeat.i(AppMethodBeat.METHOD_ID_DISPATCH);
}
}

@Override
public void onDispatchEnd(String log, long beginNs, long endNs) {
if (config.isAppMethodBeatEnable()) {
AppMethodBeat.o(AppMethodBeat.METHOD_ID_DISPATCH);
}

long dispatchCost = (endNs - beginNs) / Constants.TIME_MILLIS_TO_NANO;
try {
if (dispatchCost >= evilThresholdMs) {
Expand Down

0 comments on commit 73ed478

Please sign in to comment.