diff options
author | 2024-08-09 12:21:49 +0000 | |
---|---|---|
committer | 2024-08-09 12:21:49 +0000 | |
commit | 948ce5eb667b05bd69069c42a3101e58490215fa (patch) | |
tree | c60a8615f82cdab178694eb31cda152233ab19c5 | |
parent | 084f8d431f73869489062c12fa3e67167d2febd8 (diff) | |
parent | 6a2489cfe8ea330f3155bd576fb95b00b07d4e5f (diff) |
Merge "Add a hidden API to set trace tag on atrace counters." into main
-rw-r--r-- | core/java/android/os/Trace.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/core/java/android/os/Trace.java b/core/java/android/os/Trace.java index edb3a641f107..4a37e0a70443 100644 --- a/core/java/android/os/Trace.java +++ b/core/java/android/os/Trace.java @@ -520,8 +520,20 @@ public final class Trace { * @param counterValue The counter value. */ public static void setCounter(@NonNull String counterName, long counterValue) { - if (isTagEnabled(TRACE_TAG_APP)) { - nativeTraceCounter(TRACE_TAG_APP, counterName, counterValue); + setCounter(TRACE_TAG_APP, counterName, counterValue); + } + + /** + * Writes trace message to indicate the value of a given counter under a given trace tag. + * + * @param traceTag The trace tag. + * @param counterName The counter name to appear in the trace. + * @param counterValue The counter value. + * @hide + */ + public static void setCounter(long traceTag, @NonNull String counterName, long counterValue) { + if (isTagEnabled(traceTag)) { + nativeTraceCounter(traceTag, counterName, counterValue); } } |