Skip to content

Commit

Permalink
issue-525:Fix the issue where ttlagent does not work when adding othe…
Browse files Browse the repository at this point in the history
…r agent
  • Loading branch information
zdu committed Jul 6, 2023
1 parent d2407c2 commit a0c542f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ttl-agent/src/main/java/com/alibaba/ttl3/agent/TtlAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadPoolExecutor;

/**
* TTL Java Agent.
Expand Down Expand Up @@ -218,6 +224,7 @@ public static void premain(final String agentArgs, @NonNull final Instrumentatio

final ClassFileTransformer transformer = new TtlTransformer(transformletList, isLogClassTransform());
inst.addTransformer(transformer, true);
inst.retransformClasses(ThreadPoolExecutor.class, ForkJoinPool.class, ForkJoinTask.class, ScheduledThreadPoolExecutor.class, PriorityBlockingQueue.class, PriorityQueue.class);
logger.info("[TtlAgent.premain] add Transformer " + transformer.getClass().getName() + " success");

logger.info("[TtlAgent.premain] end");
Expand Down

0 comments on commit a0c542f

Please sign in to comment.