trace2:data: add trace2 transport child classification
authorJeff Hostetler <jeffhost@microsoft.com>
Fri, 22 Feb 2019 22:25:05 +0000 (14:25 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 Feb 2019 23:28:14 +0000 (15:28 -0800)
Add trace2 child classification for transport processes.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
connect.c
transport-helper.c
index 4813f005ab05279a72ef2894cfae8887965d9640..2778481264d0e1fdd8864743fc860ef63718524e 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -1248,6 +1248,7 @@ struct child_process *git_connect(int fd[2], const char *url,
                conn = NULL;
        } else if (protocol == PROTO_GIT) {
                conn = git_connect_git(fd, hostandport, path, prog, version, flags);
+               conn->trace2_child_class = "transport/git";
        } else {
                struct strbuf cmd = STRBUF_INIT;
                const char *const *var;
@@ -1290,9 +1291,11 @@ struct child_process *git_connect(int fd[2], const char *url,
                                strbuf_release(&cmd);
                                return NULL;
                        }
+                       conn->trace2_child_class = "transport/ssh";
                        fill_ssh_args(conn, ssh_host, port, version, flags);
                } else {
                        transport_check_allowed("file");
+                       conn->trace2_child_class = "transport/file";
                        if (version > 0) {
                                argv_array_pushf(&conn->env_array, GIT_PROTOCOL_ENVIRONMENT "=version=%d",
                                                 version);
index 1f52c95fd87b1a02968727bde71dcc1eddc50410..cec83bd663d0f27589bd09176e38b084270f56c4 100644 (file)
@@ -127,6 +127,8 @@ static struct child_process *get_helper(struct transport *transport)
                argv_array_pushf(&helper->env_array, "%s=%s",
                                 GIT_DIR_ENVIRONMENT, get_git_dir());
 
+       helper->trace2_child_class = helper->args.argv[0]; /* "remote-<name>" */
+
        code = start_command(helper);
        if (code < 0 && errno == ENOENT)
                die(_("unable to find remote helper for '%s'"), data->name);