From dc9020849773393e47c37c2834a5582374b55ecc Mon Sep 17 00:00:00 2001 From: Glen Choo Date: Wed, 28 Jun 2023 19:26:26 +0000 Subject: trace2: plumb config kvi There is a code path starting from trace2_def_param_fl() that eventually calls current_config_scope(), and thus it needs to have "kvi" plumbed through it. Additional plumbing is also needed to get "kvi" to trace2_def_param_fl(), which gets called by two code paths: - Through tr2_cfg_cb(), which is a config callback, so it trivially receives "kvi" via the "struct config_context ctx" parameter. - Through tr2_list_env_vars_fl(), which is a high level function that lists environment variables for tracing. This has been secretly behaving like git_config_from_parameters() (in that it parses config from environment variables/the CLI), but does not set config source information. Teach tr2_list_env_vars_fl() to be well-behaved by using kvi_from_param(), which is used elsewhere for CLI/environment variable-based config. As a result, current_config_scope() has no more callers, so remove it. Signed-off-by: Glen Choo Signed-off-by: Junio C Hamano --- trace2.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'trace2.h') diff --git a/trace2.h b/trace2.h index 4ced30c0db..f5c5a9e6ba 100644 --- a/trace2.h +++ b/trace2.h @@ -325,6 +325,7 @@ void trace2_thread_exit_fl(const char *file, int line); #define trace2_thread_exit() trace2_thread_exit_fl(__FILE__, __LINE__) +struct key_value_info; /* * Emits a "def_param" message containing a key/value pair. * @@ -334,7 +335,7 @@ void trace2_thread_exit_fl(const char *file, int line); * `core.abbrev`, `status.showUntrackedFiles`, or `--no-ahead-behind`. */ void trace2_def_param_fl(const char *file, int line, const char *param, - const char *value); + const char *value, const struct key_value_info *kvi); #define trace2_def_param(param, value) \ trace2_def_param_fl(__FILE__, __LINE__, (param), (value)) -- cgit v1.2.3