aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorThiago Farina <tfransosi@gmail.com>2010-01-27 18:05:55 -0500
committerIngo Molnar <mingo@elte.hu>2010-01-29 04:36:35 -0500
commit4c574159d03f4d8a136a7adff2d0b1d82cadcb18 (patch)
treee796859b5ccd38156ab7cc046ef04fbd9c1b312b /tools
parentae7f6711d6231c9ba54feb5ba9856c3775e482f8 (diff)
tools/perf/perf.c: Clean up trivial style issues
Checked with: ./../scripts/checkpatch.pl --terse --file perf.c perf.c: 51: ERROR: open brace '{' following function declarations go on the next line perf.c: 73: ERROR: "foo*** bar" should be "foo ***bar" perf.c:112: ERROR: space prohibited before that close parenthesis ')' perf.c:127: ERROR: space prohibited before that close parenthesis ')' perf.c:171: ERROR: "foo** bar" should be "foo **bar" perf.c:213: ERROR: "(foo*)" should be "(foo *)" perf.c:216: ERROR: "(foo*)" should be "(foo *)" perf.c:217: ERROR: space required before that '*' (ctx:OxV) perf.c:452: ERROR: do not initialise statics to 0 or NULL perf.c:453: ERROR: do not initialise statics to 0 or NULL Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Masami Hiramatsu <mhiramat@redhat.com> LKML-Reference: <1264633557-17597-7-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/perf.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 05c861c045d5..109b89b30ced 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -48,7 +48,8 @@ int check_pager_config(const char *cmd)
48 return c.val; 48 return c.val;
49} 49}
50 50
51static void commit_pager_choice(void) { 51static void commit_pager_choice(void)
52{
52 switch (use_pager) { 53 switch (use_pager) {
53 case 0: 54 case 0:
54 setenv("PERF_PAGER", "cat", 1); 55 setenv("PERF_PAGER", "cat", 1);
@@ -70,7 +71,7 @@ static void set_debugfs_path(void)
70 "tracing/events"); 71 "tracing/events");
71} 72}
72 73
73static int handle_options(const char*** argv, int* argc, int* envchanged) 74static int handle_options(const char ***argv, int *argc, int *envchanged)
74{ 75{
75 int handled = 0; 76 int handled = 0;
76 77
@@ -109,7 +110,7 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
109 *envchanged = 1; 110 *envchanged = 1;
110 } else if (!strcmp(cmd, "--perf-dir")) { 111 } else if (!strcmp(cmd, "--perf-dir")) {
111 if (*argc < 2) { 112 if (*argc < 2) {
112 fprintf(stderr, "No directory given for --perf-dir.\n" ); 113 fprintf(stderr, "No directory given for --perf-dir.\n");
113 usage(perf_usage_string); 114 usage(perf_usage_string);
114 } 115 }
115 setenv(PERF_DIR_ENVIRONMENT, (*argv)[1], 1); 116 setenv(PERF_DIR_ENVIRONMENT, (*argv)[1], 1);
@@ -124,7 +125,7 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
124 *envchanged = 1; 125 *envchanged = 1;
125 } else if (!strcmp(cmd, "--work-tree")) { 126 } else if (!strcmp(cmd, "--work-tree")) {
126 if (*argc < 2) { 127 if (*argc < 2) {
127 fprintf(stderr, "No directory given for --work-tree.\n" ); 128 fprintf(stderr, "No directory given for --work-tree.\n");
128 usage(perf_usage_string); 129 usage(perf_usage_string);
129 } 130 }
130 setenv(PERF_WORK_TREE_ENVIRONMENT, (*argv)[1], 1); 131 setenv(PERF_WORK_TREE_ENVIRONMENT, (*argv)[1], 1);
@@ -168,7 +169,7 @@ static int handle_alias(int *argcp, const char ***argv)
168{ 169{
169 int envchanged = 0, ret = 0, saved_errno = errno; 170 int envchanged = 0, ret = 0, saved_errno = errno;
170 int count, option_count; 171 int count, option_count;
171 const char** new_argv; 172 const char **new_argv;
172 const char *alias_command; 173 const char *alias_command;
173 char *alias_string; 174 char *alias_string;
174 175
@@ -210,11 +211,11 @@ static int handle_alias(int *argcp, const char ***argv)
210 if (!strcmp(alias_command, new_argv[0])) 211 if (!strcmp(alias_command, new_argv[0]))
211 die("recursive alias: %s", alias_command); 212 die("recursive alias: %s", alias_command);
212 213
213 new_argv = realloc(new_argv, sizeof(char*) * 214 new_argv = realloc(new_argv, sizeof(char *) *
214 (count + *argcp + 1)); 215 (count + *argcp + 1));
215 /* insert after command name */ 216 /* insert after command name */
216 memcpy(new_argv + count, *argv + 1, sizeof(char*) * *argcp); 217 memcpy(new_argv + count, *argv + 1, sizeof(char *) * *argcp);
217 new_argv[count+*argcp] = NULL; 218 new_argv[count + *argcp] = NULL;
218 219
219 *argv = new_argv; 220 *argv = new_argv;
220 *argcp += count - 1; 221 *argcp += count - 1;
@@ -450,8 +451,8 @@ int main(int argc, const char **argv)
450 setup_path(); 451 setup_path();
451 452
452 while (1) { 453 while (1) {
453 static int done_help = 0; 454 static int done_help;
454 static int was_alias = 0; 455 static int was_alias;
455 456
456 was_alias = run_argv(&argc, &argv); 457 was_alias = run_argv(&argc, &argv);
457 if (errno != ENOENT) 458 if (errno != ENOENT)