diff options
| author | Glen Choo <chooglen@google.com> | 2023-06-28 19:26:26 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-06-28 14:06:39 -0700 |
| commit | dc9020849773393e47c37c2834a5582374b55ecc (patch) | |
| tree | 1e5986fbb89b5af24d059199f220e78448dc2a68 /trace2/tr2_tgt_normal.c | |
| parent | 26b669324bb3ef8fd15387815bc020f08d0b4e7b (diff) | |
| download | git-dc9020849773393e47c37c2834a5582374b55ecc.tar.gz | |
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 <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace2/tr2_tgt_normal.c')
| -rw-r--r-- | trace2/tr2_tgt_normal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/trace2/tr2_tgt_normal.c b/trace2/tr2_tgt_normal.c index 1ebfb464d5..d25ea13164 100644 --- a/trace2/tr2_tgt_normal.c +++ b/trace2/tr2_tgt_normal.c @@ -297,10 +297,10 @@ static void fn_exec_result_fl(const char *file, int line, } static void fn_param_fl(const char *file, int line, const char *param, - const char *value) + const char *value, const struct key_value_info *kvi) { struct strbuf buf_payload = STRBUF_INIT; - enum config_scope scope = current_config_scope(); + enum config_scope scope = kvi->scope; const char *scope_name = config_scope_name(scope); strbuf_addf(&buf_payload, "def_param scope:%s %s=%s", scope_name, param, |
