Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit edb7c60e authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf options: Type check all the remaining OPT_ variants



OPT_SET_INT was renamed to OPT_SET_UINT since the only use in these
tools is to set something that has an enum type, that is builtin
compatible with unsigned int.

Several string constifications were done to make OPT_STRING require a
const char * type.

Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 8035458f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ static void dump_suites(int subsys_index)
	return;
}

static char *bench_format_str;
static const char *bench_format_str;
int bench_format = BENCH_FORMAT_DEFAULT;

static const struct option bench_options[] = {
@@ -126,7 +126,7 @@ static void print_usage(void)
	printf("\n");
}

static int bench_str2int(char *str)
static int bench_str2int(const char *str)
{
	if (!str)
		return BENCH_FORMAT_DEFAULT;
+3 −3
Original line number Diff line number Diff line
@@ -33,10 +33,10 @@ static bool show_all = false;
static enum help_format help_format = HELP_FORMAT_MAN;
static struct option builtin_help_options[] = {
	OPT_BOOLEAN('a', "all", &show_all, "print all available commands"),
	OPT_SET_INT('m', "man", &help_format, "show man page", HELP_FORMAT_MAN),
	OPT_SET_INT('w', "web", &help_format, "show manual in web browser",
	OPT_SET_UINT('m', "man", &help_format, "show man page", HELP_FORMAT_MAN),
	OPT_SET_UINT('w', "web", &help_format, "show manual in web browser",
			HELP_FORMAT_WEB),
	OPT_SET_INT('i', "info", &help_format, "show info page",
	OPT_SET_UINT('i', "info", &help_format, "show info page",
			HELP_FORMAT_INFO),
	OPT_END(),
};
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
#include <pthread.h>
#include <math.h>

static char			*file_name;
static const char		*file_name;
static char			name_buffer[256];

bool				perf_host = 1;
+2 −2
Original line number Diff line number Diff line
@@ -39,8 +39,8 @@ static bool dont_use_callchains;
static bool		show_threads;
static struct perf_read_values	show_threads_values;

static char		default_pretty_printing_style[] = "normal";
static char		*pretty_printing_style = default_pretty_printing_style;
static const char	default_pretty_printing_style[] = "normal";
static const char	*pretty_printing_style = default_pretty_printing_style;

static char		callchain_default_opt[] = "fractal,0.5";

+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
static char			const *input_name = "perf.data";

static char			default_sort_order[] = "avg, max, switch, runtime";
static char			*sort_order = default_sort_order;
static const char		*sort_order = default_sort_order;

static int			profile_cpu = -1;

Loading