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

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

perf tools: A thread's machine can be found via thread->mg->machine

So stop passing both machine and thread to several thread methods,
reducing function signature length.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jean Pihet <jean.pihet@linaro.org>
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/n/tip-ckcy19dcp1jfkmdihdjcqdn1@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 11246c70
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -232,8 +232,7 @@ static int check_return_addr(struct dso *dso, Dwarf_Addr pc)
 *	index:	of callchain entry that needs to be ignored (if any)
 *	index:	of callchain entry that needs to be ignored (if any)
 *	-1	if no entry needs to be ignored or in case of errors
 *	-1	if no entry needs to be ignored or in case of errors
 */
 */
int arch_skip_callchain_idx(struct machine *machine, struct thread *thread,
int arch_skip_callchain_idx(struct thread *thread, struct ip_callchain *chain)
				struct ip_callchain *chain)
{
{
	struct addr_location al;
	struct addr_location al;
	struct dso *dso = NULL;
	struct dso *dso = NULL;
@@ -246,7 +245,7 @@ int arch_skip_callchain_idx(struct machine *machine, struct thread *thread,


	ip = chain->ips[2];
	ip = chain->ips[2];


	thread__find_addr_location(thread, machine, PERF_RECORD_MISC_USER,
	thread__find_addr_location(thread, PERF_RECORD_MISC_USER,
			MAP__FUNCTION, ip, &al);
			MAP__FUNCTION, ip, &al);


	if (al.map)
	if (al.map)
+1 −2
Original line number Original line Diff line number Diff line
@@ -217,8 +217,7 @@ static int perf_event__inject_buildid(struct perf_tool *tool,
		goto repipe;
		goto repipe;
	}
	}


	thread__find_addr_map(thread, machine, cpumode, MAP__FUNCTION,
	thread__find_addr_map(thread, cpumode, MAP__FUNCTION, sample->ip, &al);
			      sample->ip, &al);


	if (al.map != NULL) {
	if (al.map != NULL) {
		if (!al.map->dso->hit) {
		if (!al.map->dso->hit) {
+3 −4
Original line number Original line Diff line number Diff line
@@ -379,7 +379,6 @@ static void print_sample_start(struct perf_sample *sample,


static void print_sample_addr(union perf_event *event,
static void print_sample_addr(union perf_event *event,
			  struct perf_sample *sample,
			  struct perf_sample *sample,
			  struct machine *machine,
			  struct thread *thread,
			  struct thread *thread,
			  struct perf_event_attr *attr)
			  struct perf_event_attr *attr)
{
{
@@ -390,7 +389,7 @@ static void print_sample_addr(union perf_event *event,
	if (!sample_addr_correlates_sym(attr))
	if (!sample_addr_correlates_sym(attr))
		return;
		return;


	perf_event__preprocess_sample_addr(event, sample, machine, thread, &al);
	perf_event__preprocess_sample_addr(event, sample, thread, &al);


	if (PRINT_FIELD(SYM)) {
	if (PRINT_FIELD(SYM)) {
		printf(" ");
		printf(" ");
@@ -438,7 +437,7 @@ static void print_sample_bts(union perf_event *event,
	    ((evsel->attr.sample_type & PERF_SAMPLE_ADDR) &&
	    ((evsel->attr.sample_type & PERF_SAMPLE_ADDR) &&
	     !output[attr->type].user_set)) {
	     !output[attr->type].user_set)) {
		printf(" => ");
		printf(" => ");
		print_sample_addr(event, sample, al->machine, thread, attr);
		print_sample_addr(event, sample, thread, attr);
	}
	}


	if (print_srcline_last)
	if (print_srcline_last)
@@ -475,7 +474,7 @@ static void process_event(union perf_event *event, struct perf_sample *sample,
		event_format__print(evsel->tp_format, sample->cpu,
		event_format__print(evsel->tp_format, sample->cpu,
				    sample->raw_data, sample->raw_size);
				    sample->raw_data, sample->raw_size);
	if (PRINT_FIELD(ADDR))
	if (PRINT_FIELD(ADDR))
		print_sample_addr(event, sample, al->machine, thread, attr);
		print_sample_addr(event, sample, thread, attr);


	if (PRINT_FIELD(IP)) {
	if (PRINT_FIELD(IP)) {
		if (!symbol_conf.use_callchain)
		if (!symbol_conf.use_callchain)
+1 −1
Original line number Original line Diff line number Diff line
@@ -528,7 +528,7 @@ static const char *cat_backtrace(union perf_event *event,
		}
		}


		tal.filtered = 0;
		tal.filtered = 0;
		thread__find_addr_location(al.thread, machine, cpumode,
		thread__find_addr_location(al.thread, cpumode,
					   MAP__FUNCTION, ip, &tal);
					   MAP__FUNCTION, ip, &tal);


		if (tal.sym)
		if (tal.sym)
+3 −3
Original line number Original line Diff line number Diff line
@@ -1846,7 +1846,7 @@ static int trace__pgfault(struct trace *trace,
	if (trace->summary_only)
	if (trace->summary_only)
		return 0;
		return 0;


	thread__find_addr_location(thread, trace->host, cpumode, MAP__FUNCTION,
	thread__find_addr_location(thread, cpumode, MAP__FUNCTION,
			      sample->ip, &al);
			      sample->ip, &al);


	trace__fprintf_entry_head(trace, thread, 0, sample->time, trace->output);
	trace__fprintf_entry_head(trace, thread, 0, sample->time, trace->output);
@@ -1859,11 +1859,11 @@ static int trace__pgfault(struct trace *trace,


	fprintf(trace->output, "] => ");
	fprintf(trace->output, "] => ");


	thread__find_addr_location(thread, trace->host, cpumode, MAP__VARIABLE,
	thread__find_addr_location(thread, cpumode, MAP__VARIABLE,
				   sample->addr, &al);
				   sample->addr, &al);


	if (!al.map) {
	if (!al.map) {
		thread__find_addr_location(thread, trace->host, cpumode,
		thread__find_addr_location(thread, cpumode,
					   MAP__FUNCTION, sample->addr, &al);
					   MAP__FUNCTION, sample->addr, &al);


		if (al.map)
		if (al.map)
Loading