add more tracy hooks

This commit is contained in:
Jakub Konka 2024-07-21 21:14:57 +02:00
parent 59733374ed
commit 79fefec599
4 changed files with 14 additions and 0 deletions

View file

@ -2387,6 +2387,9 @@ fn resizeSections(self: *MachO) !void {
}
fn writeSectionsAndUpdateLinkeditSizes(self: *MachO) !void {
const tracy = trace(@src());
defer tracy.end();
const gpa = self.base.comp.gpa;
const cmd = self.symtab_cmd;
@ -3513,6 +3516,8 @@ pub fn getTarget(self: MachO) std.Target {
/// the original file. This is super messy, but there doesn't seem any other
/// way to please the XNU.
pub fn invalidateKernelCache(dir: fs.Dir, sub_path: []const u8) !void {
const tracy = trace(@src());
defer tracy.end();
if (comptime builtin.target.isDarwin() and builtin.target.cpu.arch == .aarch64) {
try dir.copyFile(sub_path, dir, sub_path, .{});
}

View file

@ -7,6 +7,7 @@ const log = std.log.scoped(.link);
const macho = std.macho;
const mem = std.mem;
const testing = std.testing;
const trace = @import("../../tracy.zig").trace;
const Allocator = mem.Allocator;
const Hasher = @import("hasher.zig").ParallelHasher;
const MachO = @import("../MachO.zig");
@ -264,6 +265,9 @@ pub fn writeAdhocSignature(
opts: WriteOpts,
writer: anytype,
) !void {
const tracy = trace(@src());
defer tracy.end();
const allocator = macho_file.base.comp.gpa;
var header: macho.SuperBlob = .{

View file

@ -55,6 +55,8 @@ pub fn ParallelHasher(comptime Hasher: type) type {
out: *[hash_size]u8,
err: *fs.File.PReadError!usize,
) void {
const tracy = trace(@src());
defer tracy.end();
err.* = file.preadAll(buffer, fstart);
Hasher.hash(buffer, out, .{});
}

View file

@ -211,6 +211,9 @@ fn verifyLibcxxCorrectlyLinked() void {
}
fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
const tr = tracy.trace(@src());
defer tr.end();
if (args.len <= 1) {
std.log.info("{s}", .{usage});
fatal("expected command argument", .{});