summaryrefslogtreecommitdiff
path: root/trace2/tr2_tgt_perf.c
diff options
context:
space:
mode:
authorLibravatar Jiang Xin <worldhello.net@gmail.com>2021-10-30 09:34:30 +0800
committerLibravatar Jiang Xin <worldhello.net@gmail.com>2021-10-30 09:34:30 +0800
commitcd9ef9ce67bf2934845a6a76a1ecdbc9a5f7a6e0 (patch)
treeba34cf45622ddcd8e9d250a048661a7e6a8a35ee /trace2/tr2_tgt_perf.c
parentMerge branch 'master' of github.com:nafmo/git-l10n-sv (diff)
parentGit 2.34-rc0 (diff)
downloadtgif-cd9ef9ce67bf2934845a6a76a1ecdbc9a5f7a6e0.tar.xz
Merge branch 'master' of github.com:git/git
* 'master' of github.com:git/git: (762 commits) Git 2.34-rc0 wrapper: remove xunsetenv() log: document --encoding behavior on iconv() failure Revert "logmsg_reencode(): warn when iconv() fails" completion: fix incorrect bash/zsh string equality check add, rm, mv: fix bug that prevents the update of non-sparse dirs git-bundle.txt: add missing words and punctuation Documentation/Makefile: fix lint-docs mkdir dependency submodule: drop unused sm_name parameter from append_fetch_remotes() The fifteenth batch gitweb.txt: change "folder" to "directory" gitignore.txt: change "folder" to "directory" git-multi-pack-index.txt: change "folder" to "directory" git.txt: fix typo archive: describe compression level option config.txt: fix typo command-list.txt: remove 'sparse-index' from main help userdiff-cpp: back out the digit-separators in numbers submodule--helper: fix incorrect newlines in an error message branch (doc): -m/-c copies config and reflog ...
Diffstat (limited to 'trace2/tr2_tgt_perf.c')
-rw-r--r--trace2/tr2_tgt_perf.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/trace2/tr2_tgt_perf.c b/trace2/tr2_tgt_perf.c
index a8018f18cc..e4acca13d6 100644
--- a/trace2/tr2_tgt_perf.c
+++ b/trace2/tr2_tgt_perf.c
@@ -253,6 +253,21 @@ static void fn_command_path_fl(const char *file, int line, const char *pathname)
strbuf_release(&buf_payload);
}
+static void fn_command_ancestry_fl(const char *file, int line, const char **parent_names)
+{
+ const char *event_name = "cmd_ancestry";
+ struct strbuf buf_payload = STRBUF_INIT;
+
+ strbuf_addstr(&buf_payload, "ancestry:[");
+ /* It's not an argv but the rules are basically the same. */
+ sq_append_quote_argv_pretty(&buf_payload, parent_names);
+ strbuf_addch(&buf_payload, ']');
+
+ perf_io_write_fl(file, line, event_name, NULL, NULL, NULL, NULL,
+ &buf_payload);
+ strbuf_release(&buf_payload);
+}
+
static void fn_command_name_fl(const char *file, int line, const char *name,
const char *hierarchy)
{
@@ -345,6 +360,20 @@ static void fn_child_exit_fl(const char *file, int line,
strbuf_release(&buf_payload);
}
+static void fn_child_ready_fl(const char *file, int line,
+ uint64_t us_elapsed_absolute, int cid, int pid,
+ const char *ready, uint64_t us_elapsed_child)
+{
+ const char *event_name = "child_ready";
+ struct strbuf buf_payload = STRBUF_INIT;
+
+ strbuf_addf(&buf_payload, "[ch%d] pid:%d ready:%s", cid, pid, ready);
+
+ perf_io_write_fl(file, line, event_name, NULL, &us_elapsed_absolute,
+ &us_elapsed_child, NULL, &buf_payload);
+ strbuf_release(&buf_payload);
+}
+
static void fn_thread_start_fl(const char *file, int line,
uint64_t us_elapsed_absolute)
{
@@ -532,11 +561,13 @@ struct tr2_tgt tr2_tgt_perf = {
fn_atexit,
fn_error_va_fl,
fn_command_path_fl,
+ fn_command_ancestry_fl,
fn_command_name_fl,
fn_command_mode_fl,
fn_alias_fl,
fn_child_start_fl,
fn_child_exit_fl,
+ fn_child_ready_fl,
fn_thread_start_fl,
fn_thread_exit_fl,
fn_exec_fl,