Skip to content

Commit 62ad636

Browse files
committed
update tracy zones
1 parent eda4fb3 commit 62ad636

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/DocumentStore.zig

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ pub const Handle = struct {
483483
comptime Context: type,
484484
) error{OutOfMemory}!T {
485485
@branchHint(.cold);
486-
const tracy_zone = tracy.trace(@src());
486+
const tracy_zone = tracy.traceNamed(@src(), "getLazy(" ++ name ++ ")");
487487
defer tracy_zone.end();
488488

489489
const has_data_field_name = "has_" ++ name;
@@ -598,6 +598,9 @@ pub fn getHandle(self: *DocumentStore, uri: Uri) ?*Handle {
598598
}
599599

600600
pub fn readUri(store: *DocumentStore, uri: Uri) ?[:0]const u8 {
601+
const tracy_zone = tracy.trace(@src());
602+
defer tracy_zone.end();
603+
601604
const file_path = URI.parse(store.allocator, uri) catch |err| {
602605
log.err("failed to parse URI '{s}': {}", .{ uri, err });
603606
return null;
@@ -912,6 +915,9 @@ fn notifyBuildEnd(self: *DocumentStore, status: EndStatus) void {
912915
}
913916

914917
fn invalidateBuildFileWorker(self: *DocumentStore, build_file: *BuildFile) void {
918+
const tracy_zone = tracy.trace(@src());
919+
defer tracy_zone.end();
920+
915921
{
916922
build_file.impl.mutex.lock();
917923
defer build_file.impl.mutex.unlock();
@@ -993,6 +999,9 @@ fn invalidateBuildFileWorker(self: *DocumentStore, build_file: *BuildFile) void
993999
}
9941000

9951001
pub fn loadTrigramStores(self: *DocumentStore) error{OutOfMemory}![]*DocumentStore.Handle {
1002+
const tracy_zone = tracy.trace(@src());
1003+
defer tracy_zone.end();
1004+
9961005
if (builtin.single_threaded) {
9971006
for (self.handles.values()) |handle| {
9981007
_ = try handle.getTrigramStore();
@@ -1209,6 +1218,9 @@ fn buildDotZigExists(dir_path: []const u8) bool {
12091218
/// See `Handle.getAssociatedBuildFileUri`.
12101219
/// Caller owns returned memory.
12111220
fn collectPotentialBuildFiles(self: *DocumentStore, uri: Uri) ![]*BuildFile {
1221+
const tracy_zone = tracy.trace(@src());
1222+
defer tracy_zone.end();
1223+
12121224
var potential_build_files: std.ArrayListUnmanaged(*BuildFile) = .empty;
12131225
errdefer potential_build_files.deinit(self.allocator);
12141226

@@ -1415,6 +1427,9 @@ fn createAndStoreDocument(
14151427
}
14161428

14171429
pub fn loadDirectoryRecursive(store: *DocumentStore, directory_uri: Uri) !usize {
1430+
const tracy_zone = tracy.trace(@src());
1431+
defer tracy_zone.end();
1432+
14181433
const workspace_path = try URI.parse(store.allocator, directory_uri);
14191434
defer store.allocator.free(workspace_path);
14201435

0 commit comments

Comments
 (0)