Skip to content

Commit

Permalink
gvfs:trace2: add trace2 tracing around read_object_process
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
  • Loading branch information
jeffhostetler committed Oct 10, 2018
1 parent e0f95f3 commit 8645713
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions sha1-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,8 @@ static int read_object_process(const struct object_id *oid)

start = getnanotime();

trace2_region_enter("subprocess", "read_object", the_repository);

if (!subprocess_map_initialized) {
subprocess_map_initialized = 1;
hashmap_init(&subprocess_map, (hashmap_cmp_fn)cmd2process_cmp,
Expand All @@ -761,13 +763,16 @@ static int read_object_process(const struct object_id *oid)
if (subprocess_start(&subprocess_map, &entry->subprocess, cmd,
start_read_object_fn)) {
free(entry);
return -1;
err = -1;
goto leave_region;
}
}
process = &entry->subprocess.process;

if (!(CAP_GET & entry->supported_capabilities))
return -1;
if (!(CAP_GET & entry->supported_capabilities)) {
err = -1;
goto leave_region;
}

sigchain_push(SIGPIPE, SIG_IGN);

Expand Down Expand Up @@ -816,6 +821,10 @@ static int read_object_process(const struct object_id *oid)

trace_performance_since(start, "read_object_process");

leave_region:
trace2_region_leave_printf("subprocess", "read_object", the_repository,
"result %d", err);

return err;
}

Expand Down

0 comments on commit 8645713

Please sign in to comment.