summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-08-09 12:21:49 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-08-09 12:21:49 +0000
commit948ce5eb667b05bd69069c42a3101e58490215fa (patch)
treec60a8615f82cdab178694eb31cda152233ab19c5
parent084f8d431f73869489062c12fa3e67167d2febd8 (diff)
parent6a2489cfe8ea330f3155bd576fb95b00b07d4e5f (diff)
Merge "Add a hidden API to set trace tag on atrace counters." into main
-rw-r--r--core/java/android/os/Trace.java16
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);
}
}