aboutsummaryrefslogtreecommitdiffstats
path: root/trace2.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-03-18 13:04:25 -0700
committerJunio C Hamano <gitster@pobox.com>2024-03-18 13:04:25 -0700
commit7f1e92643d9a74857bddc12280b511b7e06c08a7 (patch)
tree50dd9fe98d7c35c386accb34bd0dd6d0a9663616 /trace2.c
parentMerge branch 'pw/rebase-i-ignore-cherry-pick-help-environment' (diff)
parenttrace2: emit 'def_param' set with 'cmd_name' event (diff)
downloadgit-7f1e92643d9a74857bddc12280b511b7e06c08a7.tar.gz
git-7f1e92643d9a74857bddc12280b511b7e06c08a7.zip
Merge branch 'jh/trace2-missing-def-param-fix'
Some trace2 events that lacked def_param have learned to show it, enriching the output. Reviewed-by: Josh Steadmon <steadmon@google.com> cf. <ZejkVOVQBZhLVfHW@google.com> * jh/trace2-missing-def-param-fix: trace2: emit 'def_param' set with 'cmd_name' event trace2: avoid emitting 'def_param' set more than once t0211: demonstrate missing 'def_param' events for certain commands
Diffstat (limited to 'trace2.c')
-rw-r--r--trace2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/trace2.c b/trace2.c
index f1e268bd15..f894532d05 100644
--- a/trace2.c
+++ b/trace2.c
@@ -433,6 +433,9 @@ void trace2_cmd_name_fl(const char *file, int line, const char *name)
for_each_wanted_builtin (j, tgt_j)
if (tgt_j->pfn_command_name_fl)
tgt_j->pfn_command_name_fl(file, line, name, hierarchy);
+
+ trace2_cmd_list_config();
+ trace2_cmd_list_env_vars();
}
void trace2_cmd_mode_fl(const char *file, int line, const char *mode)
@@ -464,17 +467,29 @@ void trace2_cmd_alias_fl(const char *file, int line, const char *alias,
void trace2_cmd_list_config_fl(const char *file, int line)
{
+ static int emitted = 0;
+
if (!trace2_enabled)
return;
+ if (emitted)
+ return;
+ emitted = 1;
+
tr2_cfg_list_config_fl(file, line);
}
void trace2_cmd_list_env_vars_fl(const char *file, int line)
{
+ static int emitted = 0;
+
if (!trace2_enabled)
return;
+ if (emitted)
+ return;
+ emitted = 1;
+
tr2_list_env_vars_fl(file, line);
}