perf tools: Remove 'perf' from subcmd function and variable names
authorJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 15 Dec 2015 15:39:37 +0000 (09:39 -0600)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 17 Dec 2015 00:34:28 +0000 (21:34 -0300)
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>
tools/perf/builtin-help.c
tools/perf/builtin-script.c
tools/perf/perf.c
tools/perf/tests/attr.c
tools/perf/util/exec_cmd.c
tools/perf/util/exec_cmd.h
tools/perf/util/help.c
tools/perf/util/run-command.c
tools/perf/util/run-command.h

index a7d588bf3cdd345233042131373666af2f9d7598..275aa641c31cbd5a420944a7b61db01dbaf386d4 100644 (file)
@@ -407,7 +407,7 @@ static int get_html_page_path(struct strbuf *page_path, const char *page)
 #ifndef open_html
 static void open_html(const char *path)
 {
-       execl_perf_cmd("web--browse", "-c", "help.browser", path, NULL);
+       execl_cmd("web--browse", "-c", "help.browser", path, NULL);
 }
 #endif
 
index d259e9aa3a7102d59ec05fafb7706ef9eed9a49f..571016f16c5aabb40bcb0061ddbd71b8a5ddba6d 100644 (file)
@@ -1408,7 +1408,7 @@ static int list_available_scripts(const struct option *opt __maybe_unused,
        char first_half[BUFSIZ];
        char *script_root;
 
-       snprintf(scripts_path, MAXPATHLEN, "%s/scripts", perf_exec_path());
+       snprintf(scripts_path, MAXPATHLEN, "%s/scripts", get_argv_exec_path());
 
        scripts_dir = opendir(scripts_path);
        if (!scripts_dir)
@@ -1529,7 +1529,7 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
        if (!session)
                return -1;
 
-       snprintf(scripts_path, MAXPATHLEN, "%s/scripts", perf_exec_path());
+       snprintf(scripts_path, MAXPATHLEN, "%s/scripts", get_argv_exec_path());
 
        scripts_dir = opendir(scripts_path);
        if (!scripts_dir) {
@@ -1587,7 +1587,7 @@ static char *get_script_path(const char *script_root, const char *suffix)
        char lang_path[MAXPATHLEN];
        char *__script_root;
 
-       snprintf(scripts_path, MAXPATHLEN, "%s/scripts", perf_exec_path());
+       snprintf(scripts_path, MAXPATHLEN, "%s/scripts", get_argv_exec_path());
 
        scripts_dir = opendir(scripts_path);
        if (!scripts_dir)
@@ -1823,7 +1823,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
                scripting_max_stack = itrace_synth_opts.callchain_sz;
 
        /* make sure PERF_EXEC_PATH is set for scripts */
-       perf_set_argv_exec_path(perf_exec_path());
+       set_argv_exec_path(get_argv_exec_path());
 
        if (argc && !script_name && !rec_script_path && !rep_script_path) {
                int live_pipe[2];
index 783a3310a9d85dc2a6842fb5aab5afbd84a452e4..6894325fe9217bb7f0b95f71b32060892a51df43 100644 (file)
@@ -183,9 +183,9 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
                if (!prefixcmp(cmd, CMD_EXEC_PATH)) {
                        cmd += strlen(CMD_EXEC_PATH);
                        if (*cmd == '=')
-                               perf_set_argv_exec_path(cmd + 1);
+                               set_argv_exec_path(cmd + 1);
                        else {
-                               puts(perf_exec_path());
+                               puts(get_argv_exec_path());
                                exit(0);
                        }
                } else if (!strcmp(cmd, "--html-path")) {
@@ -538,7 +538,7 @@ int main(int argc, const char **argv)
        page_size = sysconf(_SC_PAGE_SIZE);
        cacheline_size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
 
-       cmd = perf_extract_argv0_path(argv[0]);
+       cmd = extract_argv0_path(argv[0]);
        if (!cmd)
                cmd = "perf-help";
 
index b66730eb94e3593cad9ff42c809bbaa974cbc8ba..6337f1c07f02dc44ea87dcf24732eb005c927026 100644 (file)
@@ -164,7 +164,7 @@ int test__attr(int subtest __maybe_unused)
                return run_dir("./tests", "./perf");
 
        /* Then installed path. */
-       snprintf(path_dir,  PATH_MAX, "%s/tests", perf_exec_path());
+       snprintf(path_dir,  PATH_MAX, "%s/tests", get_argv_exec_path());
        snprintf(path_perf, PATH_MAX, "%s/perf", BINDIR);
 
        if (!lstat(path_dir, &st) &&
index 65d86dcaa984cb6af78aaa4f021db0b115455338..701111ac7699f3ef128e1b349d7382811e523410 100644 (file)
@@ -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);
 }
index fd4434e48d2161d7c5aa82296c329164a73e396f..f1bd3436ad5fe01d78cc432a519e72f7f468e916 100644 (file)
@@ -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 */
index 8e5e0ce3870efa62ec5ac66aff68ff681771db01..303a347ee2349ea9ae0cc482fa9e7abd432d50f5 100644 (file)
@@ -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));
index 34622b53e733b53b8d47415c67d408900a3e504f..910c0f6479f470d46451fee7a83bfec3e23b24f1 100644 (file)
@@ -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;
 }
 
index 1ef264d5069c76490e309c082438ca3477111978..cf7d655ee2a39188f01ea004d00eb075f80d2063 100644 (file)
@@ -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);
 
This page took 0.0332 seconds and 5 git commands to generate.