diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-11-25 22:07:43 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-11-26 11:07:46 -0300 |
commit | fe87797dea79b59e97a4ea67441bf91f2905bf23 (patch) | |
tree | de95e3e69803f88c99d56f8a9476af9902c7e324 /tools/perf/util/thread.c | |
parent | 79b6bb73f888933cbcd20b0ef3976cde67951b72 (diff) |
perf thread: Rename thread->mg to thread->maps
One more step on the merge of 'struct maps' with 'struct map_groups'.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-69vcr8pubpym90skxhmbwhiw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/thread.c')
-rw-r--r-- | tools/perf/util/thread.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index b672a2a73b6b..28b719388028 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c @@ -24,16 +24,16 @@ int thread__init_maps(struct thread *thread, struct machine *machine) pid_t pid = thread->pid_; if (pid == thread->tid || pid == -1) { - thread->mg = maps__new(machine); + thread->maps = maps__new(machine); } else { struct thread *leader = __machine__findnew_thread(machine, pid, pid); if (leader) { - thread->mg = maps__get(leader->mg); + thread->maps = maps__get(leader->maps); thread__put(leader); } } - return thread->mg ? 0 : -1; + return thread->maps ? 0 : -1; } struct thread *thread__new(pid_t pid, pid_t tid) @@ -86,9 +86,9 @@ void thread__delete(struct thread *thread) thread_stack__free(thread); - if (thread->mg) { - maps__put(thread->mg); - thread->mg = NULL; + if (thread->maps) { + maps__put(thread->maps); + thread->maps = NULL; } down_write(&thread->namespaces_lock); list_for_each_entry_safe(namespaces, tmp_namespaces, @@ -251,7 +251,7 @@ static int ____thread__set_comm(struct thread *thread, const char *str, list_add(&new->list, &thread->comm_list); if (exec) - unwind__flush_access(thread->mg); + unwind__flush_access(thread->maps); } thread->comm_set = true; @@ -324,19 +324,19 @@ int thread__comm_len(struct thread *thread) size_t thread__fprintf(struct thread *thread, FILE *fp) { return fprintf(fp, "Thread %d %s\n", thread->tid, thread__comm_str(thread)) + - maps__fprintf(thread->mg, fp); + maps__fprintf(thread->maps, fp); } int thread__insert_map(struct thread *thread, struct map *map) { int ret; - ret = unwind__prepare_access(thread->mg, map, NULL); + ret = unwind__prepare_access(thread->maps, map, NULL); if (ret) return ret; - maps__fixup_overlappings(thread->mg, map, stderr); - maps__insert(thread->mg, map); + maps__fixup_overlappings(thread->maps, map, stderr); + maps__insert(thread->maps, map); return 0; } @@ -345,13 +345,13 @@ static int __thread__prepare_access(struct thread *thread) { bool initialized = false; int err = 0; - struct maps *maps = thread->mg; + struct maps *maps = thread->maps; struct map *map; down_read(&maps->lock); maps__for_each_entry(maps, map) { - err = unwind__prepare_access(thread->mg, map, &initialized); + err = unwind__prepare_access(thread->maps, map, &initialized); if (err || initialized) break; } @@ -377,13 +377,13 @@ static int thread__clone_maps(struct thread *thread, struct thread *parent, bool if (thread->pid_ == parent->pid_) return thread__prepare_access(thread); - if (thread->mg == parent->mg) { + if (thread->maps == parent->maps) { pr_debug("broken map groups on thread %d/%d parent %d/%d\n", thread->pid_, thread->tid, parent->pid_, parent->tid); return 0; } /* But this one is new process, copy maps. */ - return do_maps_clone ? maps__clone(thread, parent->mg) : 0; + return do_maps_clone ? maps__clone(thread, parent->maps) : 0; } int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp, bool do_maps_clone) |