Skip to content

Commit

Permalink
trace2: classify some child processes
Browse files Browse the repository at this point in the history
Classify editor, pager, and sub-process child processes.

The former two can be used to identify interactive commands,
for example.  A later effort could classify other types of
commands, such as "gc", "hook", and etc.

Signed-off-by: Jeff Hostetler <[email protected]>
  • Loading branch information
jeffhostetler authored and dscho committed Dec 15, 2018
1 parent 00bac7b commit 95597bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ static int launch_specified_editor(const char *editor, const char *path,
p.argv = args;
p.env = env;
p.use_shell = 1;
p.trace2_child_class = "editor";
if (start_command(&p) < 0)
return error("unable to start editor '%s'", editor);

Expand Down
1 change: 1 addition & 0 deletions pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ void prepare_pager_args(struct child_process *pager_process, const char *pager)
argv_array_push(&pager_process->args, pager);
pager_process->use_shell = 1;
setup_pager_env(&pager_process->env_array);
pager_process->trace2_child_class = "pager";
}

void setup_pager(void)
Expand Down
1 change: 1 addition & 0 deletions sub-process.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ int subprocess_start(struct hashmap *hashmap, struct subprocess_entry *entry, co
process->out = -1;
process->clean_on_exit = 1;
process->clean_on_exit_handler = subprocess_exit_handler;
process->trace2_child_class = "subprocess";

err = start_command(process);
if (err) {
Expand Down

0 comments on commit 95597bd

Please sign in to comment.