summaryrefslogtreecommitdiff
path: root/trace2.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-10-13 15:15:57 -0700
committerJunio C Hamano <gitster@pobox.com>2021-10-13 15:15:58 -0700
commitaf303ee39214a04ad3c01e5924f2e8c09b5c18cb (patch)
treea11254d63d48bb387ed4bdd3927568d9ff9e0276 /trace2.c
parenta5e61a4225a7319ab5fdd6d7b63e250f5b08255c (diff)
parent05881a6fc9020b5c227a98490bf256d129da01f6 (diff)
downloadgit-af303ee39214a04ad3c01e5924f2e8c09b5c18cb.tar.gz
Merge branch 'jh/builtin-fsmonitor-part1'
Built-in fsmonitor (part 1). * jh/builtin-fsmonitor-part1: t/helper/simple-ipc: convert test-simple-ipc to use start_bg_command run-command: create start_bg_command simple-ipc/ipc-win32: add Windows ACL to named pipe simple-ipc/ipc-win32: add trace2 debugging simple-ipc: move definition of ipc_active_state outside of ifdef simple-ipc: preparations for supporting binary messages. trace2: add trace2_child_ready() to report on background children
Diffstat (limited to 'trace2.c')
-rw-r--r--trace2.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/trace2.c b/trace2.c
index b9b154ac44..b2d471526f 100644
--- a/trace2.c
+++ b/trace2.c
@@ -394,6 +394,37 @@ void trace2_child_exit_fl(const char *file, int line, struct child_process *cmd,
us_elapsed_child);
}
+void trace2_child_ready_fl(const char *file, int line,
+ struct child_process *cmd,
+ const char *ready)
+{
+ struct tr2_tgt *tgt_j;
+ int j;
+ uint64_t us_now;
+ uint64_t us_elapsed_absolute;
+ uint64_t us_elapsed_child;
+
+ if (!trace2_enabled)
+ return;
+
+ us_now = getnanotime() / 1000;
+ us_elapsed_absolute = tr2tls_absolute_elapsed(us_now);
+
+ if (cmd->trace2_child_us_start)
+ us_elapsed_child = us_now - cmd->trace2_child_us_start;
+ else
+ us_elapsed_child = 0;
+
+ for_each_wanted_builtin (j, tgt_j)
+ if (tgt_j->pfn_child_ready_fl)
+ tgt_j->pfn_child_ready_fl(file, line,
+ us_elapsed_absolute,
+ cmd->trace2_child_id,
+ cmd->pid,
+ ready,
+ us_elapsed_child);
+}
+
int trace2_exec_fl(const char *file, int line, const char *exe,
const char **argv)
{