Linux Audio

Check our new training course

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