trace2:data: add trace2 hook classification
authorJeff Hostetler <jeffhost@microsoft.com>
Fri, 22 Feb 2019 22:25:06 +0000 (14:25 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 22 Feb 2019 23:28:21 +0000 (15:28 -0800)
Classify certain child processes as hooks.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c
builtin/receive-pack.c
builtin/worktree.c
sequencer.c
transport.c
index 58a2aef28bbcd715660422dc37042e79d4d350c1..cca494d9c3bac6d256dc9d0e42161975541a1357 100644 (file)
@@ -453,6 +453,7 @@ static int run_post_rewrite_hook(const struct am_state *state)
 
        cp.in = xopen(am_path(state, "rewritten"), O_RDONLY);
        cp.stdout_to_stderr = 1;
+       cp.trace2_hook_name = "post-rewrite";
 
        ret = run_command(&cp);
 
index d58b7750b6b46565ca4ebb8299e5260943aa364e..8bc714a5fc30e13cff98dc7ff7e68578b4842863 100644 (file)
@@ -694,6 +694,8 @@ static int run_and_feed_hook(const char *hook_name, feed_fn feed,
        proc.argv = argv;
        proc.in = -1;
        proc.stdout_to_stderr = 1;
+       proc.trace2_hook_name = hook_name;
+
        if (feed_state->push_options) {
                int i;
                for (i = 0; i < feed_state->push_options->nr; i++)
@@ -807,6 +809,7 @@ static int run_update_hook(struct command *cmd)
        proc.stdout_to_stderr = 1;
        proc.err = use_sideband ? -1 : 0;
        proc.argv = argv;
+       proc.trace2_hook_name = "update";
 
        code = start_command(&proc);
        if (code)
@@ -1190,6 +1193,7 @@ static void run_update_post_hook(struct command *commands)
        proc.no_stdin = 1;
        proc.stdout_to_stderr = 1;
        proc.err = use_sideband ? -1 : 0;
+       proc.trace2_hook_name = "post-update";
 
        if (!start_command(&proc)) {
                if (use_sideband)
index 3f9907fcc994d248ba604509f6feb5bdc0499329..6cc094a453806308442d054a7d1c073ecf18b87b 100644 (file)
@@ -402,6 +402,7 @@ static int add_worktree(const char *path, const char *refname,
                        cp.dir = path;
                        cp.env = env;
                        cp.argv = NULL;
+                       cp.trace2_hook_name = "post-checkout";
                        argv_array_pushl(&cp.args, absolute_path(hook),
                                         oid_to_hex(&null_oid),
                                         oid_to_hex(&commit->object.oid),
index 0db410d59023e4b2fdd21bc342872324e7c2e7b3..1625f48f833e139a38c34034e067d1799c2e1e11 100644 (file)
@@ -1103,6 +1103,7 @@ static int run_rewrite_hook(const struct object_id *oldoid,
        proc.argv = argv;
        proc.in = -1;
        proc.stdout_to_stderr = 1;
+       proc.trace2_hook_name = "post-rewrite";
 
        code = start_command(&proc);
        if (code)
@@ -3786,6 +3787,7 @@ static int pick_commits(struct repository *r,
                                hook.in = open(rebase_path_rewritten_list(),
                                        O_RDONLY);
                                hook.stdout_to_stderr = 1;
+                               hook.trace2_hook_name = "post-rewrite";
                                argv_array_push(&hook.args, post_rewrite_hook);
                                argv_array_push(&hook.args, "rebase");
                                /* we don't care if this hook failed */
index e078812897eddefcd5a55a7d474dd4a7a89434fc..d0608df5c90cab4d2e2a2071a7416aeac75004e1 100644 (file)
@@ -1062,6 +1062,7 @@ static int run_pre_push_hook(struct transport *transport,
 
        proc.argv = argv;
        proc.in = -1;
+       proc.trace2_hook_name = "pre-push";
 
        if (start_command(&proc)) {
                finish_command(&proc);