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

perf tools: Rename 'perf_record_opts' to 'record_opts

Reduce typing, functions use class__method convention, so unlikely to
clash with other libraries.

This actually was discussed in the "Link:" referenced message below.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/20131112113427.GA4053@ghostprotocols.net


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 8c6f45a7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ struct exit_reasons_table {

struct perf_kvm_stat {
	struct perf_tool    tool;
	struct perf_record_opts opts;
	struct record_opts  opts;
	struct perf_evlist  *evlist;
	struct perf_session *session;

+9 −9
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ static void __handle_on_exit_funcs(void)

struct record {
	struct perf_tool	tool;
	struct perf_record_opts	opts;
	struct record_opts	opts;
	u64			bytes_written;
	struct perf_data_file	file;
	struct perf_evlist	*evlist;
@@ -178,7 +178,7 @@ static int record__open(struct record *rec)
	struct perf_evsel *pos;
	struct perf_evlist *evlist = rec->evlist;
	struct perf_session *session = rec->session;
	struct perf_record_opts *opts = &rec->opts;
	struct record_opts *opts = &rec->opts;
	int rc = 0;

	perf_evlist__config(evlist, opts);
@@ -348,7 +348,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
	const bool forks = argc > 0;
	struct machine *machine;
	struct perf_tool *tool = &rec->tool;
	struct perf_record_opts *opts = &rec->opts;
	struct record_opts *opts = &rec->opts;
	struct perf_evlist *evsel_list = rec->evlist;
	struct perf_data_file *file = &rec->file;
	struct perf_session *session;
@@ -657,7 +657,7 @@ static int get_stack_size(char *str, unsigned long *_size)
}
#endif /* HAVE_LIBUNWIND_SUPPORT */

int record_parse_callchain(const char *arg, struct perf_record_opts *opts)
int record_parse_callchain(const char *arg, struct record_opts *opts)
{
	char *tok, *name, *saveptr = NULL;
	char *buf;
@@ -713,7 +713,7 @@ int record_parse_callchain(const char *arg, struct perf_record_opts *opts)
	return ret;
}

static void callchain_debug(struct perf_record_opts *opts)
static void callchain_debug(struct record_opts *opts)
{
	pr_debug("callchain: type %d\n", opts->call_graph);

@@ -726,7 +726,7 @@ int record_parse_callchain_opt(const struct option *opt,
			       const char *arg,
			       int unset)
{
	struct perf_record_opts *opts = opt->value;
	struct record_opts *opts = opt->value;
	int ret;

	/* --no-call-graph */
@@ -747,7 +747,7 @@ int record_callchain_opt(const struct option *opt,
			 const char *arg __maybe_unused,
			 int unset __maybe_unused)
{
	struct perf_record_opts *opts = opt->value;
	struct record_opts *opts = opt->value;

	if (opts->call_graph == CALLCHAIN_NONE)
		opts->call_graph = CALLCHAIN_FP;
@@ -796,7 +796,7 @@ const char record_callchain_help[] = CALLCHAIN_HELP "fp";
/*
 * XXX Will stay a global variable till we fix builtin-script.c to stop messing
 * with it and switch to use the library functions in perf_evlist that came
 * from builtin-record.c, i.e. use perf_record_opts,
 * from builtin-record.c, i.e. use record_opts,
 * perf_evlist__prepare_workload, etc instead of fork+exec'in 'perf record',
 * using pipes, etc.
 */
@@ -944,7 +944,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
	if (perf_evlist__create_maps(evsel_list, &rec->opts.target) < 0)
		usage_with_options(record_usage, record_options);

	if (perf_record_opts__config(&rec->opts)) {
	if (record_opts__config(&rec->opts)) {
		err = -EINVAL;
		goto out_free_fd;
	}
+4 −4
Original line number Diff line number Diff line
@@ -854,7 +854,7 @@ static int perf_top__start_counters(struct perf_top *top)
	char msg[512];
	struct perf_evsel *counter;
	struct perf_evlist *evlist = top->evlist;
	struct perf_record_opts *opts = &top->record_opts;
	struct record_opts *opts = &top->record_opts;

	perf_evlist__config(evlist, opts);

@@ -906,7 +906,7 @@ static int perf_top__setup_sample_type(struct perf_top *top __maybe_unused)

static int __cmd_top(struct perf_top *top)
{
	struct perf_record_opts *opts = &top->record_opts;
	struct record_opts *opts = &top->record_opts;
	pthread_t thread;
	int ret;

@@ -1028,7 +1028,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
		.max_stack	     = PERF_MAX_STACK_DEPTH,
		.sym_pcnt_filter     = 5,
	};
	struct perf_record_opts *opts = &top.record_opts;
	struct record_opts *opts = &top.record_opts;
	struct target *target = &opts->target;
	const struct option options[] = {
	OPT_CALLBACK('e', "event", &top.evlist, "event",
@@ -1179,7 +1179,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
	if (top.delay_secs < 1)
		top.delay_secs = 1;

	if (perf_record_opts__config(opts)) {
	if (record_opts__config(opts)) {
		status = -EINVAL;
		goto out_delete_maps;
	}
+1 −1
Original line number Diff line number Diff line
@@ -1159,7 +1159,7 @@ struct trace {
		int		max;
		struct syscall  *table;
	} syscalls;
	struct perf_record_opts opts;
	struct record_opts	opts;
	struct machine		*host;
	u64			base_time;
	bool			full_time;
+1 −1
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ enum perf_call_graph_mode {
	CALLCHAIN_DWARF
};

struct perf_record_opts {
struct record_opts {
	struct target target;
	int	     call_graph;
	bool	     group;
Loading