Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46113a54 authored by Josh Poimboeuf's avatar Josh Poimboeuf Committed by Arnaldo Carvalho de Melo
Browse files

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: default avatarJosh 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 901421a5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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

+4 −4
Original line number Diff line number Diff line
@@ -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];
+3 −3
Original line number Diff line number Diff line
@@ -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";

+1 −1
Original line number Diff line number Diff line
@@ -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) &&
+10 −10
Original line number Diff line number Diff line
@@ -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);
}
Loading