diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-03-18 13:04:25 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-03-18 13:04:25 -0700 |
| commit | 7f1e92643d9a74857bddc12280b511b7e06c08a7 (patch) | |
| tree | 50dd9fe98d7c35c386accb34bd0dd6d0a9663616 /trace2.c | |
| parent | Merge branch 'pw/rebase-i-ignore-cherry-pick-help-environment' (diff) | |
| parent | trace2: emit 'def_param' set with 'cmd_name' event (diff) | |
| download | git-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.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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); } |
