2012-10-06 15:43:20 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
2014-09-29 16:07:28 -04:00
|
|
|
|
2013-11-11 11:28:02 -03:00
|
|
|
|
2012-10-06 15:43:20 -03:00
|
|
|
|
2012-12-06 21:48:05 -08:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-06 15:43:20 -03:00
|
|
|
|
2012-10-06 16:26:02 -03:00
|
|
|
|
2012-10-06 15:43:20 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-01-29 16:14:39 +02:00
|
|
|
|
|
|
|
|
|
2014-07-23 14:23:00 +03:00
|
|
|
|
|
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-31 09:00:45 +03:00
|
|
|
|
2016-05-17 11:56:24 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
perf machine: Protect the machine->threads with a rwlock
In addition to using refcounts for the struct thread lifetime
management, we need to protect access to machine->threads from
concurrent access.
That happens in 'perf top', where a thread processes events, inserting
and deleting entries from that rb_tree while another thread decays
hist_entries, that end up dropping references and ultimately deleting
threads from the rb_tree and releasing its resources when no further
hist_entry (or other data structures, like in 'perf sched') references
it.
So the rule is the same for refcounts + protected trees in the kernel,
get the tree lock, find object, bump the refcount, drop the tree lock,
return, use object, drop the refcount if no more use of it is needed,
keep it if storing it in some other data structure, drop when releasing
that data structure.
I.e. pair "t = machine__find(new)_thread()" with a "thread__put(t)", and
"perf_event__preprocess_sample(&al)" with "addr_location__put(&al)".
The addr_location__put() one is because as we return references to
several data structures, we may end up adding more reference counting
for the other data structures and then we'll drop it at
addr_location__put() time.
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-bs9rt4n0jw3hi9f3zxyy3xln@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-04-06 20:43:22 -03:00
|
|
|
|
2016-05-04 10:09:33 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
2014-07-23 14:23:00 +03:00
|
|
|
|
2015-09-09 12:25:00 -03:00
|
|
|
|
2015-05-28 13:06:42 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
2014-08-15 22:08:39 +03:00
|
|
|
|
2014-07-22 16:17:25 +03:00
|
|
|
|
2014-10-23 13:45:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-30 11:54:04 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-30 11:54:04 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-15 22:08:39 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-14 15:00:03 +01:00
|
|
|
|
|
|
|
|
|
2014-07-31 09:00:45 +03:00
|
|
|
|
|
|
|
|
|
2012-10-06 15:43:20 -03:00
|
|
|
|
2013-09-11 16:18:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-10 15:13:15 -04:00
|
|
|
|
|
|
|
|
|
2015-04-30 17:37:29 +03:00
|
|
|
|
|
|
|
|
|
2015-04-30 17:37:30 +03:00
|
|
|
|
|
|
|
|
|
2016-03-22 13:09:37 -03:00
|
|
|
|
2015-07-21 12:44:03 +03:00
|
|
|
|
2013-09-11 16:18:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-06 16:26:02 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
2012-12-18 19:15:48 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
2012-12-18 19:15:48 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
2012-12-18 19:15:48 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
2012-12-18 19:15:48 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
2014-07-31 09:00:45 +03:00
|
|
|
|
2013-08-08 14:32:20 +03:00
|
|
|
|
2013-09-28 13:13:00 -06:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
2012-12-07 17:39:39 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
2015-04-10 17:35:00 +08:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
2014-01-22 13:15:36 -03:00
|
|
|
|
|
|
|
|
|
2014-01-22 13:05:06 -03:00
|
|
|
|
|
|
|
|
|
2016-04-14 14:48:07 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-23 15:26:17 -03:00
|
|
|
|
2016-04-14 14:48:07 -03:00
|
|
|
|
2014-10-23 15:26:17 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
perf machine: Protect the machine->threads with a rwlock
In addition to using refcounts for the struct thread lifetime
management, we need to protect access to machine->threads from
concurrent access.
That happens in 'perf top', where a thread processes events, inserting
and deleting entries from that rb_tree while another thread decays
hist_entries, that end up dropping references and ultimately deleting
threads from the rb_tree and releasing its resources when no further
hist_entry (or other data structures, like in 'perf sched') references
it.
So the rule is the same for refcounts + protected trees in the kernel,
get the tree lock, find object, bump the refcount, drop the tree lock,
return, use object, drop the refcount if no more use of it is needed,
keep it if storing it in some other data structure, drop when releasing
that data structure.
I.e. pair "t = machine__find(new)_thread()" with a "thread__put(t)", and
"perf_event__preprocess_sample(&al)" with "addr_location__put(&al)".
The addr_location__put() one is because as we return references to
several data structures, we may end up adding more reference counting
for the other data structures and then we'll drop it at
addr_location__put() time.
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-bs9rt4n0jw3hi9f3zxyy3xln@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-04-06 20:43:22 -03:00
|
|
|
|
|
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
2015-05-29 11:31:12 -03:00
|
|
|
|
|
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-01 19:25:52 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
2016-09-01 19:25:52 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
2016-01-25 18:01:57 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-01 19:25:52 -03:00
|
|
|
|
2016-01-25 18:01:57 -03:00
|
|
|
|
2016-09-01 19:25:52 -03:00
|
|
|
|
2016-01-25 18:01:57 -03:00
|
|
|
|
|
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
2016-09-01 19:25:52 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
2016-09-01 19:25:52 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-01 19:25:52 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
2016-09-01 19:25:52 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
perf machine: Fix up some more method names
Calling the function 'machine__new_module' implies a new 'module' will
be allocated, when in fact what is returned is a 'struct map' instance,
that not necessarily will be instantiated, as if one already exists with
the given module name, it will be returned instead.
So be consistent with other "find and if not there, create" like
functions, like machine__findnew_thread, machine__findnew_dso, etc, and
rename it to machine__findnew_module_map(), that in turn will call
machine__findnew_module_dso().
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/n/tip-acv830vd3hwww2ih5vjtbmu3@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-06-01 12:01:02 -03:00
|
|
|
|
|
|
|
|
|
2016-07-21 11:10:51 +08:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
2016-04-19 12:12:49 -03:00
|
|
|
|
2016-09-01 19:25:52 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
2016-09-01 19:25:52 -03:00
|
|
|
|
|
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
2012-12-07 09:53:58 -03:00
|
|
|
|
|
|
|
|
|
2012-12-18 19:15:48 -03:00
|
|
|
|
|
|
|
|
|
2012-12-07 09:53:58 -03:00
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-18 19:15:48 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-09 11:32:52 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-28 13:12:58 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-05-29 16:33:30 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-09-28 13:12:58 -06:00
|
|
|
|
2013-11-11 11:36:12 -03:00
|
|
|
|
2013-11-12 16:46:16 -03:00
|
|
|
|
2015-06-17 09:51:11 -04:00
|
|
|
|
|
|
|
|
|
2013-11-11 11:36:12 -03:00
|
|
|
|
2013-11-12 16:46:16 -03:00
|
|
|
|
2015-06-17 09:51:11 -04:00
|
|
|
|
|
|
|
|
|
2013-11-11 11:36:12 -03:00
|
|
|
|
|
|
|
|
|
2015-06-17 09:51:11 -04:00
|
|
|
|
|
|
|
|
|
2013-11-11 11:36:12 -03:00
|
|
|
|
|
|
|
|
|
2014-07-22 16:17:25 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-22 16:14:29 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-22 16:17:25 +03:00
|
|
|
|
2012-10-06 15:43:20 -03:00
|
|
|
|