1 // SPDX-License-Identifier: GPL-2.0 << 2 /* 1 /* 3 * usage.c 2 * usage.c 4 * 3 * 5 * Various reporting routines. 4 * Various reporting routines. 6 * Originally copied from GIT source. 5 * Originally copied from GIT source. 7 * 6 * 8 * Copyright (C) Linus Torvalds, 2005 7 * Copyright (C) Linus Torvalds, 2005 9 */ 8 */ 10 #include "util.h" 9 #include "util.h" 11 #include <stdio.h> !! 10 #include "debug.h" 12 #include <stdlib.h> << 13 #include <linux/compiler.h> << 14 << 15 const char perf_usage_string[] = << 16 "perf [--version] [--help] [OPTIONS] C << 17 << 18 const char perf_more_info_string[] = << 19 "See 'perf help COMMAND' for more info << 20 11 21 static __noreturn void usage_builtin(const cha 12 static __noreturn void usage_builtin(const char *err) 22 { 13 { 23 fprintf(stderr, "\n Usage: %s\n", err) 14 fprintf(stderr, "\n Usage: %s\n", err); 24 exit(129); 15 exit(129); 25 } 16 } 26 17 27 /* If we are in a dlopen()ed .so write to a gl 18 /* If we are in a dlopen()ed .so write to a global variable would segfault 28 * (ugh), so keep things static. */ 19 * (ugh), so keep things static. */ 29 static void (*usage_routine)(const char *err) 20 static void (*usage_routine)(const char *err) __noreturn = usage_builtin; 30 21 31 void usage(const char *err) 22 void usage(const char *err) 32 { 23 { 33 usage_routine(err); 24 usage_routine(err); 34 } 25 } 35 26
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.