diff options
Diffstat (limited to 'tools/perf/perf.c')
-rw-r--r-- | tools/perf/perf.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 19fc7feb9d59..624e62d9d1e0 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c | |||
@@ -89,8 +89,8 @@ static int handle_options(const char*** argv, int* argc, int* envchanged) | |||
89 | /* | 89 | /* |
90 | * Check remaining flags. | 90 | * Check remaining flags. |
91 | */ | 91 | */ |
92 | if (!prefixcmp(cmd, "--exec-path")) { | 92 | if (!prefixcmp(cmd, CMD_EXEC_PATH)) { |
93 | cmd += 11; | 93 | cmd += strlen(CMD_EXEC_PATH); |
94 | if (*cmd == '=') | 94 | if (*cmd == '=') |
95 | perf_set_argv_exec_path(cmd + 1); | 95 | perf_set_argv_exec_path(cmd + 1); |
96 | else { | 96 | else { |
@@ -117,8 +117,8 @@ static int handle_options(const char*** argv, int* argc, int* envchanged) | |||
117 | (*argv)++; | 117 | (*argv)++; |
118 | (*argc)--; | 118 | (*argc)--; |
119 | handled++; | 119 | handled++; |
120 | } else if (!prefixcmp(cmd, "--perf-dir=")) { | 120 | } else if (!prefixcmp(cmd, CMD_PERF_DIR)) { |
121 | setenv(PERF_DIR_ENVIRONMENT, cmd + 10, 1); | 121 | setenv(PERF_DIR_ENVIRONMENT, cmd + strlen(CMD_PERF_DIR), 1); |
122 | if (envchanged) | 122 | if (envchanged) |
123 | *envchanged = 1; | 123 | *envchanged = 1; |
124 | } else if (!strcmp(cmd, "--work-tree")) { | 124 | } else if (!strcmp(cmd, "--work-tree")) { |
@@ -131,8 +131,8 @@ static int handle_options(const char*** argv, int* argc, int* envchanged) | |||
131 | *envchanged = 1; | 131 | *envchanged = 1; |
132 | (*argv)++; | 132 | (*argv)++; |
133 | (*argc)--; | 133 | (*argc)--; |
134 | } else if (!prefixcmp(cmd, "--work-tree=")) { | 134 | } else if (!prefixcmp(cmd, CMD_WORK_TREE)) { |
135 | setenv(PERF_WORK_TREE_ENVIRONMENT, cmd + 12, 1); | 135 | setenv(PERF_WORK_TREE_ENVIRONMENT, cmd + strlen(CMD_WORK_TREE), 1); |
136 | if (envchanged) | 136 | if (envchanged) |
137 | *envchanged = 1; | 137 | *envchanged = 1; |
138 | } else if (!strcmp(cmd, "--debugfs-dir")) { | 138 | } else if (!strcmp(cmd, "--debugfs-dir")) { |
@@ -146,8 +146,8 @@ static int handle_options(const char*** argv, int* argc, int* envchanged) | |||
146 | *envchanged = 1; | 146 | *envchanged = 1; |
147 | (*argv)++; | 147 | (*argv)++; |
148 | (*argc)--; | 148 | (*argc)--; |
149 | } else if (!prefixcmp(cmd, "--debugfs-dir=")) { | 149 | } else if (!prefixcmp(cmd, CMD_DEBUGFS_DIR)) { |
150 | strncpy(debugfs_mntpt, cmd + 14, MAXPATHLEN); | 150 | strncpy(debugfs_mntpt, cmd + strlen(CMD_DEBUGFS_DIR), MAXPATHLEN); |
151 | debugfs_mntpt[MAXPATHLEN - 1] = '\0'; | 151 | debugfs_mntpt[MAXPATHLEN - 1] = '\0'; |
152 | if (envchanged) | 152 | if (envchanged) |
153 | *envchanged = 1; | 153 | *envchanged = 1; |