Skip to content

Commit

Permalink
Refactor Systrace.traceSection() to unblock CI (#46994)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46994

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

fbshipit-source-id: e35950f88cde3d547992bb700208a4d4d309710f
  • Loading branch information
mdvacca authored and facebook-github-bot committed Oct 12, 2024
1 parent 401991c commit 621622a
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 621622a

Please sign in to comment.