Skip to content

Commit 6206286

Browse files
jeffhostetlergitster
authored andcommitted
trace2:data: add trace2 hook classification
Classify certain child processes as hooks. Signed-off-by: Jeff Hostetler <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent abd81a3 commit 6206286

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

builtin/am.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ static int run_post_rewrite_hook(const struct am_state *state)
453453

454454
cp.in = xopen(am_path(state, "rewritten"), O_RDONLY);
455455
cp.stdout_to_stderr = 1;
456+
cp.trace2_hook_name = "post-rewrite";
456457

457458
ret = run_command(&cp);
458459

builtin/receive-pack.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,8 @@ static int run_and_feed_hook(const char *hook_name, feed_fn feed,
694694
proc.argv = argv;
695695
proc.in = -1;
696696
proc.stdout_to_stderr = 1;
697+
proc.trace2_hook_name = hook_name;
698+
697699
if (feed_state->push_options) {
698700
int i;
699701
for (i = 0; i < feed_state->push_options->nr; i++)
@@ -807,6 +809,7 @@ static int run_update_hook(struct command *cmd)
807809
proc.stdout_to_stderr = 1;
808810
proc.err = use_sideband ? -1 : 0;
809811
proc.argv = argv;
812+
proc.trace2_hook_name = "update";
810813

811814
code = start_command(&proc);
812815
if (code)
@@ -1190,6 +1193,7 @@ static void run_update_post_hook(struct command *commands)
11901193
proc.no_stdin = 1;
11911194
proc.stdout_to_stderr = 1;
11921195
proc.err = use_sideband ? -1 : 0;
1196+
proc.trace2_hook_name = "post-update";
11931197

11941198
if (!start_command(&proc)) {
11951199
if (use_sideband)

builtin/worktree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ static int add_worktree(const char *path, const char *refname,
402402
cp.dir = path;
403403
cp.env = env;
404404
cp.argv = NULL;
405+
cp.trace2_hook_name = "post-checkout";
405406
argv_array_pushl(&cp.args, absolute_path(hook),
406407
oid_to_hex(&null_oid),
407408
oid_to_hex(&commit->object.oid),

sequencer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,7 @@ static int run_rewrite_hook(const struct object_id *oldoid,
11031103
proc.argv = argv;
11041104
proc.in = -1;
11051105
proc.stdout_to_stderr = 1;
1106+
proc.trace2_hook_name = "post-rewrite";
11061107

11071108
code = start_command(&proc);
11081109
if (code)
@@ -3786,6 +3787,7 @@ static int pick_commits(struct repository *r,
37863787
hook.in = open(rebase_path_rewritten_list(),
37873788
O_RDONLY);
37883789
hook.stdout_to_stderr = 1;
3790+
hook.trace2_hook_name = "post-rewrite";
37893791
argv_array_push(&hook.args, post_rewrite_hook);
37903792
argv_array_push(&hook.args, "rebase");
37913793
/* we don't care if this hook failed */

transport.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,7 @@ static int run_pre_push_hook(struct transport *transport,
10621062

10631063
proc.argv = argv;
10641064
proc.in = -1;
1065+
proc.trace2_hook_name = "pre-push";
10651066

10661067
if (start_command(&proc)) {
10671068
finish_command(&proc);

0 commit comments

Comments
 (0)