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

Commit 186fbb74 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo
Browse files

perf tools: Add reference counting for thread_map object



Adding reference counting for thread_map object, so it could be easily
shared among other objects.

Using thread_map__put instead thread_map__delete and making
thread_map__delete static.

Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1435012588-9007-5-git-send-email-jolsa@kernel.org


[ Adjustments to move it ahead of the "comm" patches ]
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent f30a79b0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -546,7 +546,7 @@ static int do_test_code_reading(bool try_kcore)
		perf_evlist__delete(evlist);
	} else {
		cpu_map__put(cpus);
		thread_map__delete(threads);
		thread_map__put(threads);
	}
	machines__destroy_kernel_maps(&machines);
	machine__delete_threads(machine);
+1 −1
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ int test__keep_tracking(void)
		perf_evlist__delete(evlist);
	} else {
		cpu_map__put(cpus);
		thread_map__delete(threads);
		thread_map__put(threads);
	}

	return err;
+1 −1
Original line number Diff line number Diff line
@@ -142,6 +142,6 @@ int test__basic_mmap(void)
out_free_cpus:
	cpu_map__put(cpus);
out_free_threads:
	thread_map__delete(threads);
	thread_map__put(threads);
	return err;
}
+1 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ static int synth_process(struct machine *machine)
						perf_event__process,
						machine, 0, 500);

	thread_map__delete(map);
	thread_map__put(map);
	return err;
}

+1 −1
Original line number Diff line number Diff line
@@ -111,6 +111,6 @@ int test__openat_syscall_event_on_all_cpus(void)
out_evsel_delete:
	perf_evsel__delete(evsel);
out_thread_map_delete:
	thread_map__delete(threads);
	thread_map__put(threads);
	return err;
}
Loading