Use macOS signpost api for tracing (#14871)

Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Don Isaac <donald.isaac@gmail.com>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2025-03-31 04:13:11 -07:00
committed by GitHub
parent 0814abe21e
commit f3da1b80bc
26 changed files with 596 additions and 129 deletions

View File

@@ -760,21 +760,15 @@ pub const CommandLineReporter = struct {
comptime reporters: TestCommand.Reporters,
comptime enable_ansi_colors: bool,
) !void {
const trace = bun.tracy.traceNamed(@src(), comptime brk: {
if (reporters.text and reporters.lcov) {
break :brk "TestCommand.printCodeCoverageLCovAndText";
}
if (reporters.text) {
break :brk "TestCommand.printCodeCoverageText";
}
if (reporters.lcov) {
break :brk "TestCommand.printCodeCoverageLCov";
}
const trace = if (reporters.text and reporters.lcov)
bun.perf.trace("TestCommand.printCodeCoverageLCovAndText")
else if (reporters.text)
bun.perf.trace("TestCommand.printCodeCoverageText")
else if (reporters.lcov)
bun.perf.trace("TestCommand.printCodeCoverageLCov")
else
@compileError("No reporters enabled");
});
defer trace.end();
if (comptime !reporters.text and !reporters.lcov) {
@@ -1335,7 +1329,7 @@ pub const TestCommand = struct {
strings.startsWith(arg, "./") or
strings.startsWith(arg, "../") or
(Environment.isWindows and (strings.startsWith(arg, ".\\") or
strings.startsWith(arg, "..\\")))) break true;
strings.startsWith(arg, "..\\")))) break true;
} else false) {
// One of the files is a filepath. Instead of treating the arguments as filters, treat them as filepaths
for (ctx.positionals[1..]) |arg| {
@@ -1453,9 +1447,9 @@ pub const TestCommand = struct {
if (has_file_like == null and
(strings.hasSuffixComptime(filter, ".ts") or
strings.hasSuffixComptime(filter, ".tsx") or
strings.hasSuffixComptime(filter, ".js") or
strings.hasSuffixComptime(filter, ".jsx")))
strings.hasSuffixComptime(filter, ".tsx") or
strings.hasSuffixComptime(filter, ".js") or
strings.hasSuffixComptime(filter, ".jsx")))
{
has_file_like = i;
}