trace2:data: add trace2 transport child classification
Add trace2 child classification for transport processes. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff Hostetler committed
Feb 22, 2019 at 14:25 UTC
abd81a3d79d6c054f149ba0cd4d337b0a2d68027
2 files changed
+5
connect.c
+3
@@ -1248,6 +1248,7 @@ struct child_process *git_connect(int fd[2], const char *url,
1248
conn = NULL;
1249
} else if (protocol == PROTO_GIT) {
1250
conn = git_connect_git(fd, hostandport, path, prog, version, flags);
1251
+ conn->trace2_child_class = "transport/git";
1252
} else {
1253
struct strbuf cmd = STRBUF_INIT;
1254
const char *const *var;
@@ -1290,9 +1291,11 @@ struct child_process *git_connect(int fd[2], const char *url,
1291
strbuf_release(&cmd);
1292
return NULL;
1293
}
1294
+ conn->trace2_child_class = "transport/ssh";
1295
fill_ssh_args(conn, ssh_host, port, version, flags);
1296
} else {
1297
transport_check_allowed("file");
1298
+ conn->trace2_child_class = "transport/file";
1299
if (version > 0) {
1300
argv_array_pushf(&conn->env_array, GIT_PROTOCOL_ENVIRONMENT "=version=%d",
1301
version);
transport-helper.c
+2
@@ -127,6 +127,8 @@ static struct child_process *get_helper(struct transport *transport)
127
argv_array_pushf(&helper->env_array, "%s=%s",
128
GIT_DIR_ENVIRONMENT, get_git_dir());
129
130
+ helper->trace2_child_class = helper->args.argv[0]; /* "remote-<name>" */
131
+
132
code = start_command(helper);
133
if (code < 0 && errno == ENOENT)
134
die(_("unable to find remote helper for '%s'"), data->name);