Skip to content

Commit

Permalink
[skip ci] Refactor Systrace.traceSection() to unblock CI (facebook#46994
Browse files Browse the repository at this point in the history
)

Summary:

This diff makes a small refactor on Systrace.traceSection() to unblock CI, which was broken by D64141515 

changelog: [internal] internal

Reviewed By: Abbondanzo

Differential Revision: D64276651
  • Loading branch information
mdvacca authored and facebook-github-bot committed Oct 12, 2024
1 parent 401991c commit 5832bec
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package com.facebook.systrace

import androidx.tracing.Trace
import java.lang.Runnable
import kotlin.text.StringBuilder

/**
Expand All @@ -32,12 +33,12 @@ public object Systrace {
@JvmStatic public fun traceInstant(tag: Long, title: String?, scope: EventScope?): Unit = Unit

@JvmStatic
public fun traceSection(tag: Long, sectionName: String, block: () -> T) {
beginSection(sectionName)
public fun traceSection(tag: Long, sectionName: String, block: Runnable) {
beginSection(tag, sectionName)
try {
return block()
block.run()
} finally {
endSection(sectionName)
endSection(tag)
}
}

Expand Down

0 comments on commit 5832bec

Please sign in to comment.