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

Commit 38051234 authored by Adrian Hunter's avatar Adrian Hunter Committed by Arnaldo Carvalho de Melo
Browse files

perf tools: struct thread has a tid not a pid



As evident from 'machine__process_fork_event()' and
'machine__process_exit_event()' the 'pid' member of struct thread is
actually the tid.

Rename 'pid' to 'tid' in struct thread accordingly.

Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1372944040-32690-13-git-send-email-adrian.hunter@intel.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 27389d78
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused,
		return -1;
	}

	dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
	dump_printf(" ... thread: %s:%d\n", thread->comm, thread->tid);

	if (evsel->handler.func != NULL) {
		tracepoint_handler f = evsel->handler.func;
+6 −6
Original line number Diff line number Diff line
@@ -1075,7 +1075,7 @@ static int latency_migrate_task_event(struct perf_sched *sched,
	if (!atoms) {
		if (thread_atoms_insert(sched, migrant))
			return -1;
		register_pid(sched, migrant->pid, migrant->comm);
		register_pid(sched, migrant->tid, migrant->comm);
		atoms = thread_atoms_search(&sched->atom_root, migrant, &sched->cmp_pid);
		if (!atoms) {
			pr_err("migration-event: Internal tree error");
@@ -1115,7 +1115,7 @@ static void output_lat_thread(struct perf_sched *sched, struct work_atoms *work_
	sched->all_runtime += work_list->total_runtime;
	sched->all_count   += work_list->nb_atoms;

	ret = printf("  %s:%d ", work_list->thread->comm, work_list->thread->pid);
	ret = printf("  %s:%d ", work_list->thread->comm, work_list->thread->tid);

	for (i = 0; i < 24 - ret; i++)
		printf(" ");
@@ -1131,9 +1131,9 @@ static void output_lat_thread(struct perf_sched *sched, struct work_atoms *work_

static int pid_cmp(struct work_atoms *l, struct work_atoms *r)
{
	if (l->thread->pid < r->thread->pid)
	if (l->thread->tid < r->thread->tid)
		return -1;
	if (l->thread->pid > r->thread->pid)
	if (l->thread->tid > r->thread->tid)
		return 1;

	return 0;
@@ -1321,7 +1321,7 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel,
			printf("*");

		if (sched->curr_thread[cpu]) {
			if (sched->curr_thread[cpu]->pid)
			if (sched->curr_thread[cpu]->tid)
				printf("%2s ", sched->curr_thread[cpu]->shortname);
			else
				printf(".  ");
@@ -1332,7 +1332,7 @@ static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel,
	printf("  %12.6f secs ", (double)timestamp/1e9);
	if (new_shortname) {
		printf("%s => %s:%d\n",
			sched_in->shortname, sched_in->comm, sched_in->pid);
			sched_in->shortname, sched_in->comm, sched_in->tid);
	} else {
		printf("\n");
	}
+2 −2
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thre
	printed += fprintf_duration(duration, fp);

	if (trace->multiple_threads)
		printed += fprintf(fp, "%d ", thread->pid);
		printed += fprintf(fp, "%d ", thread->tid);

	return printed;
}
@@ -593,7 +593,7 @@ static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp)
			color = PERF_COLOR_YELLOW;

		printed += color_fprintf(fp, color, "%20s", thread->comm);
		printed += fprintf(fp, " - %-5d :%11lu   [", thread->pid, ttrace->nr_events);
		printed += fprintf(fp, " - %-5d :%11lu   [", thread->tid, ttrace->nr_events);
		printed += color_fprintf(fp, color, "%5.1f%%", ratio);
		printed += fprintf(fp, " ] %10.3f ms\n", ttrace->runtime_ms);
	}
+3 −3
Original line number Diff line number Diff line
@@ -1256,7 +1256,7 @@ static int hists__browser_title(struct hists *hists, char *bf, size_t size,
		printed += scnprintf(bf + printed, size - printed,
				    ", Thread: %s(%d)",
				    (thread->comm_set ? thread->comm : ""),
				    thread->pid);
				    thread->tid);
	if (dso)
		printed += scnprintf(bf + printed, size - printed,
				    ", DSO: %s", dso->short_name);
@@ -1579,7 +1579,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
		    asprintf(&options[nr_options], "Zoom %s %s(%d) thread",
			     (browser->hists->thread_filter ? "out of" : "into"),
			     (thread->comm_set ? thread->comm : ""),
			     thread->pid) > 0)
			     thread->tid) > 0)
			zoom_thread = nr_options++;

		if (dso != NULL &&
@@ -1702,7 +1702,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
			} else {
				ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s(%d) thread\"",
						   thread->comm_set ? thread->comm : "",
						   thread->pid);
						   thread->tid);
				browser->hists->thread_filter = thread;
				sort_thread.elide = true;
				pstack__push(fstack, &browser->hists->thread_filter);
+1 −1
Original line number Diff line number Diff line
@@ -686,7 +686,7 @@ int perf_event__preprocess_sample(const union perf_event *event,
	    !strlist__has_entry(symbol_conf.comm_list, thread->comm))
		goto out_filtered;

	dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
	dump_printf(" ... thread: %s:%d\n", thread->comm, thread->tid);
	/*
	 * Have we already created the kernel maps for this machine?
	 *
Loading