diff options
author | Josh Poimboeuf <jpoimboe@redhat.com> | 2015-12-15 16:39:37 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-12-17 01:34:28 +0100 |
commit | 46113a54be53aea50a4f5926b87e86e2e66c4266 (patch) | |
tree | 950a873f47d9b2487d0a6fd61e002875acab8b88 /tools/perf/util | |
parent | perf tools: Remove subcmd dependencies on strbuf (diff) | |
download | linux-46113a54be53aea50a4f5926b87e86e2e66c4266.tar.xz linux-46113a54be53aea50a4f5926b87e86e2e66c4266.zip |
perf tools: Remove 'perf' from subcmd function and variable names
In preparation for moving exec_cmd.c and run-command.c out of perf and
into a library, remove 'perf' from all the symbol names.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/bc3ee82b40b8f396b644fa49e0f7260ce442635b.1450193761.git.jpoimboe@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/exec_cmd.c | 20 | ||||
-rw-r--r-- | tools/perf/util/exec_cmd.h | 12 | ||||
-rw-r--r-- | tools/perf/util/help.c | 4 | ||||
-rw-r--r-- | tools/perf/util/run-command.c | 6 | ||||
-rw-r--r-- | tools/perf/util/run-command.h | 4 |
5 files changed, 23 insertions, 23 deletions
diff --git a/tools/perf/util/exec_cmd.c b/tools/perf/util/exec_cmd.c index 65d86dcaa984..701111ac7699 100644 --- a/tools/perf/util/exec_cmd.c +++ b/tools/perf/util/exec_cmd.c @@ -32,7 +32,7 @@ char *system_path(const char *path) return buf; } -const char *perf_extract_argv0_path(const char *argv0) +const char *extract_argv0_path(const char *argv0) { const char *slash; @@ -51,7 +51,7 @@ const char *perf_extract_argv0_path(const char *argv0) return argv0; } -void perf_set_argv_exec_path(const char *exec_path) +void set_argv_exec_path(const char *exec_path) { argv_exec_path = exec_path; /* @@ -61,8 +61,8 @@ void perf_set_argv_exec_path(const char *exec_path) } -/* Returns the highest-priority, location to look for perf programs. */ -char *perf_exec_path(void) +/* Returns the highest-priority location to look for subprograms. */ +char *get_argv_exec_path(void) { char *env; @@ -92,7 +92,7 @@ void setup_path(void) { const char *old_path = getenv("PATH"); char *new_path = NULL; - char *tmp = perf_exec_path(); + char *tmp = get_argv_exec_path(); add_path(&new_path, tmp); add_path(&new_path, argv0_path); @@ -108,7 +108,7 @@ void setup_path(void) free(new_path); } -static const char **prepare_perf_cmd(const char **argv) +static const char **prepare_exec_cmd(const char **argv) { int argc; const char **nargv; @@ -124,8 +124,8 @@ static const char **prepare_perf_cmd(const char **argv) return nargv; } -int execv_perf_cmd(const char **argv) { - const char **nargv = prepare_perf_cmd(argv); +int execv_cmd(const char **argv) { + const char **nargv = prepare_exec_cmd(argv); /* execvp() can only ever return if it fails */ execvp(subcmd_config.exec_name, (char **)nargv); @@ -135,7 +135,7 @@ int execv_perf_cmd(const char **argv) { } -int execl_perf_cmd(const char *cmd,...) +int execl_cmd(const char *cmd,...) { int argc; const char *argv[MAX_ARGS + 1]; @@ -155,5 +155,5 @@ int execl_perf_cmd(const char *cmd,...) return error("too many args to run %s", cmd); argv[argc] = NULL; - return execv_perf_cmd(argv); + return execv_cmd(argv); } diff --git a/tools/perf/util/exec_cmd.h b/tools/perf/util/exec_cmd.h index fd4434e48d21..f1bd3436ad5f 100644 --- a/tools/perf/util/exec_cmd.h +++ b/tools/perf/util/exec_cmd.h @@ -4,13 +4,13 @@ extern void exec_cmd_init(const char *exec_name, const char *prefix, const char *exec_path, const char *exec_path_env); -extern void perf_set_argv_exec_path(const char *exec_path); -extern const char *perf_extract_argv0_path(const char *path); +extern void set_argv_exec_path(const char *exec_path); +extern const char *extract_argv0_path(const char *path); extern void setup_path(void); -extern int execv_perf_cmd(const char **argv); /* NULL terminated */ -extern int execl_perf_cmd(const char *cmd, ...); -/* perf_exec_path and system_path return malloc'd string, caller must free it */ -extern char *perf_exec_path(void); +extern int execv_cmd(const char **argv); /* NULL terminated */ +extern int execl_cmd(const char *cmd, ...); +/* get_argv_exec_path and system_path return malloc'd string, caller must free it */ +extern char *get_argv_exec_path(void); extern char *system_path(const char *path); #endif /* __PERF_EXEC_CMD_H */ diff --git a/tools/perf/util/help.c b/tools/perf/util/help.c index 8e5e0ce3870e..303a347ee234 100644 --- a/tools/perf/util/help.c +++ b/tools/perf/util/help.c @@ -155,7 +155,7 @@ void load_command_list(const char *prefix, struct cmdnames *other_cmds) { const char *env_path = getenv("PATH"); - char *exec_path = perf_exec_path(); + char *exec_path = get_argv_exec_path(); if (exec_path) { list_commands_in_dir(main_cmds, exec_path, prefix); @@ -200,7 +200,7 @@ void list_commands(const char *title, struct cmdnames *main_cmds, longest = other_cmds->names[i]->len; if (main_cmds->cnt) { - char *exec_path = perf_exec_path(); + char *exec_path = get_argv_exec_path(); printf("available %s in '%s'\n", title, exec_path); printf("----------------"); mput_char('-', strlen(title) + strlen(exec_path)); diff --git a/tools/perf/util/run-command.c b/tools/perf/util/run-command.c index 34622b53e733..910c0f6479f4 100644 --- a/tools/perf/util/run-command.c +++ b/tools/perf/util/run-command.c @@ -112,8 +112,8 @@ int start_command(struct child_process *cmd) } if (cmd->preexec_cb) cmd->preexec_cb(); - if (cmd->perf_cmd) { - execv_perf_cmd(cmd->argv); + if (cmd->exec_cmd) { + execv_cmd(cmd->argv); } else { execvp(cmd->argv[0], (char *const*) cmd->argv); } @@ -207,7 +207,7 @@ static void prepare_run_command_v_opt(struct child_process *cmd, memset(cmd, 0, sizeof(*cmd)); cmd->argv = argv; cmd->no_stdin = opt & RUN_COMMAND_NO_STDIN ? 1 : 0; - cmd->perf_cmd = opt & RUN_PERF_CMD ? 1 : 0; + cmd->exec_cmd = opt & RUN_EXEC_CMD ? 1 : 0; cmd->stdout_to_stderr = opt & RUN_COMMAND_STDOUT_TO_STDERR ? 1 : 0; } diff --git a/tools/perf/util/run-command.h b/tools/perf/util/run-command.h index 1ef264d5069c..cf7d655ee2a3 100644 --- a/tools/perf/util/run-command.h +++ b/tools/perf/util/run-command.h @@ -41,7 +41,7 @@ struct child_process { unsigned no_stdin:1; unsigned no_stdout:1; unsigned no_stderr:1; - unsigned perf_cmd:1; /* if this is to be perf sub-command */ + unsigned exec_cmd:1; /* if this is to be external sub-command */ unsigned stdout_to_stderr:1; void (*preexec_cb)(void); }; @@ -51,7 +51,7 @@ int finish_command(struct child_process *); int run_command(struct child_process *); #define RUN_COMMAND_NO_STDIN 1 -#define RUN_PERF_CMD 2 /*If this is to be perf sub-command */ +#define RUN_EXEC_CMD 2 /*If this is to be external sub-command */ #define RUN_COMMAND_STDOUT_TO_STDERR 4 int run_command_v_opt(const char **argv, int opt); |