Skip to content

Commit 9afaef2

Browse files
committed
trace2:data: add trace2 hook classification
Classify certain child processes as hooks. Signed-off-by: Jeff Hostetler <[email protected]>
1 parent cba8ef2 commit 9afaef2

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
@@ -468,6 +468,7 @@ static int run_post_rewrite_hook(const struct am_state *state)
468468

469469
cp.in = xopen(am_path(state, "rewritten"), O_RDONLY);
470470
cp.stdout_to_stderr = 1;
471+
cp.trace2_hook_name = "post-rewrite";
471472

472473
ret = run_command(&cp);
473474

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
@@ -401,6 +401,7 @@ static int add_worktree(const char *path, const char *refname,
401401
cp.dir = path;
402402
cp.env = env;
403403
cp.argv = NULL;
404+
cp.trace2_hook_name = "post-checkout";
404405
argv_array_pushl(&cp.args, absolute_path(hook),
405406
oid_to_hex(&null_oid),
406407
oid_to_hex(&commit->object.oid),

sequencer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,7 @@ static int run_rewrite_hook(const struct object_id *oldoid,
10931093
proc.argv = argv;
10941094
proc.in = -1;
10951095
proc.stdout_to_stderr = 1;
1096+
proc.trace2_hook_name = "post-rewrite";
10961097

10971098
code = start_command(&proc);
10981099
if (code)
@@ -3730,6 +3731,7 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
37303731
hook.in = open(rebase_path_rewritten_list(),
37313732
O_RDONLY);
37323733
hook.stdout_to_stderr = 1;
3734+
hook.trace2_hook_name = "post-rewrite";
37333735
argv_array_push(&hook.args, post_rewrite_hook);
37343736
argv_array_push(&hook.args, "rebase");
37353737
/* we don't care if this hook failed */

transport.c

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

10621062
proc.argv = argv;
10631063
proc.in = -1;
1064+
proc.trace2_hook_name = "pre-push";
10641065

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

0 commit comments

Comments
 (0)