perf_counter tools: Uniform help printouts
authorIngo Molnar <mingo@elte.hu>
Fri, 13 Mar 2009 02:20:49 +0000 (03:20 +0100)
committerIngo Molnar <mingo@elte.hu>
Sat, 6 Jun 2009 12:41:49 +0000 (14:41 +0200)
Also add perf list to command-list.txt.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Documentation/perf_counter/builtin-help.c
Documentation/perf_counter/command-list.txt
Documentation/perf_counter/perf.c
Documentation/perf_counter/util/parse-options.c
Documentation/perf_counter/util/usage.c

index a3894bfb9b6ecf03cab5817395b35cf42096b942..0f32dc3f3c4c7a45b5d18bf8fac59aabedb8069f 100644 (file)
@@ -284,7 +284,7 @@ void list_common_cmds_help(void)
                        longest = strlen(common_cmds[i].name);
        }
 
-       puts("The most commonly used perf commands are:");
+       puts(" The most commonly used perf commands are:");
        for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
                printf("   %s   ", common_cmds[i].name);
                mput_char(' ', longest - strlen(common_cmds[i].name));
@@ -426,16 +426,16 @@ int cmd_help(int argc, const char **argv, const char *prefix)
                        builtin_help_usage, 0);
 
        if (show_all) {
-               printf("usage: %s\n\n", perf_usage_string);
+               printf("\n usage: %s\n\n", perf_usage_string);
                list_commands("perf commands", &main_cmds, &other_cmds);
-               printf("%s\n", perf_more_info_string);
+               printf(" %s\n\n", perf_more_info_string);
                return 0;
        }
 
        if (!argv[0]) {
-               printf("usage: %s\n\n", perf_usage_string);
+               printf("\n usage: %s\n\n", perf_usage_string);
                list_common_cmds_help();
-               printf("\n%s\n", perf_more_info_string);
+               printf("\n %s\n\n", perf_more_info_string);
                return 0;
        }
 
index 439029207770ffb8045d1ae67a3ebd7e6a581bdd..f0b922c9023458be70cee5c5642fb9cb987f5d65 100644 (file)
@@ -1,7 +1,9 @@
+#
 # List of known perf commands.
-# command name                         category [deprecated] [common]
-perf-record                             mainporcelain common
-perf-report                             mainporcelain common
-perf-stat                               mainporcelain common
-perf-top                                mainporcelain common
-
+# command name                 category [deprecated] [common]
+#
+perf-record                    mainporcelain common
+perf-report                    mainporcelain common
+perf-stat                      mainporcelain common
+perf-top                       mainporcelain common
+perf-list                      mainporcelain common
index 9ac75657a180f3b6a9b63c17260627ba5d9fb3b3..161824f1241faaad71f912146115cc7aac3536b0 100644 (file)
@@ -384,9 +384,9 @@ int main(int argc, const char **argv)
                        argv[0] += 2;
        } else {
                /* The user didn't specify a command; give them help */
-               printf("usage: %s\n\n", perf_usage_string);
+               printf("\n usage: %s\n\n", perf_usage_string);
                list_common_cmds_help();
-               printf("\n%s\n", perf_more_info_string);
+               printf("\n %s\n\n", perf_more_info_string);
                exit(1);
        }
        cmd = argv[0];
index 551b6bc34e794736bbe0a8ad5ade89da4e178bb4..e4d353395a60f3d5d9da3bd026e45aab6aad20d3 100644 (file)
@@ -385,7 +385,7 @@ int usage_with_options_internal(const char * const *usagestr,
        if (!usagestr)
                return PARSE_OPT_HELP;
 
-       fprintf(stderr, "usage: %s\n", *usagestr++);
+       fprintf(stderr, "\n usage: %s\n", *usagestr++);
        while (*usagestr && **usagestr)
                fprintf(stderr, "   or: %s\n", *usagestr++);
        while (*usagestr) {
index 7a10421fe6b424be7f6691594e3b2854cecb56df..2cad286e437169442f53270c3b92ba8c1447636d 100644 (file)
@@ -14,7 +14,7 @@ static void report(const char *prefix, const char *err, va_list params)
 
 static NORETURN void usage_builtin(const char *err)
 {
-       fprintf(stderr, "usage: %s\n", err);
+       fprintf(stderr, "\n usage: %s\n", err);
        exit(129);
 }