diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-11-29 06:56:05 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-11-29 06:56:05 +0100 |
commit | e680a41fcaf07ccac8817c589fc4824988b48eac (patch) | |
tree | 8993cdfbd30e3d95162c53bc6af4e410360f99a8 /tools/perf/util/thread.c | |
parent | 405b45376de90b3027aaf8c4de035c6bb721fa7e (diff) | |
parent | 5172672da02e483d9b3c4d814c3482d0c8ffb1a6 (diff) |
Merge tag 'perf-core-for-mingo-5.5-20191128' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
perf script:
Adrian Hunter:
- Fix brstackinsn for AUXTRACE.
- Fix invalid LBR/binary mismatch error.
perf diff:
Arnaldo Carvalho de Melo:
- Use llabs() with 64-bit values, fixing the build in some 32-bit
architectures.
perf pmu:
Andi Kleen:
- Use file system cache to optimize sysfs access.
x86:
Adrian Hunter:
- Add some more Intel instructions to the opcode map and to the perf
test entry:
gf2p8affineinvqb, gf2p8affineqb, gf2p8mulb, v4fmaddps,
v4fmaddss, v4fnmaddps, v4fnmaddss, vaesdec, vaesdeclast, vaesenc,
vaesenclast, vcvtne2ps2bf16, vcvtneps2bf16, vdpbf16ps,
vgf2p8affineinvqb, vgf2p8affineqb, vgf2p8mulb, vp2intersectd,
vp2intersectq, vp4dpwssd, vp4dpwssds, vpclmulqdq, vpcompressb,
vpcompressw, vpdpbusd, vpdpbusds, vpdpwssd, vpdpwssds, vpexpandb,
vpexpandw, vpopcntb, vpopcntd, vpopcntq, vpopcntw, vpshldd, vpshldq,
vpshldvd, vpshldvq, vpshldvw, vpshldw, vpshrdd, vpshrdq, vpshrdvd,
vpshrdvq, vpshrdvw, vpshrdw, vpshufbitqmb.
perf affinity:
Andi Kleen:
- Add infrastructure to save/restore affinity
perf maps:
Arnaldo Carvalho de Melo:
- Merge 'struct maps' with 'struct map_groups', as there is a
1x1 relationship, simplifying code overal.
perf build:
Jiri Olsa:
- Allow to link with libbpf dynamicaly.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/thread.c')
-rw-r--r-- | tools/perf/util/thread.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index 0a277a920970..28b719388028 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c @@ -19,21 +19,21 @@ #include <api/fs/fs.h> -int thread__init_map_groups(struct thread *thread, struct machine *machine) +int thread__init_maps(struct thread *thread, struct machine *machine) { pid_t pid = thread->pid_; if (pid == thread->tid || pid == -1) { - thread->mg = map_groups__new(machine); + thread->maps = maps__new(machine); } else { struct thread *leader = __machine__findnew_thread(machine, pid, pid); if (leader) { - thread->mg = map_groups__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) { - map_groups__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)) + - map_groups__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; - map_groups__fixup_overlappings(thread->mg, map, stderr); - map_groups__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->maps; + 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; } @@ -371,21 +371,19 @@ static int thread__prepare_access(struct thread *thread) return err; } -static int thread__clone_map_groups(struct thread *thread, - struct thread *parent, - bool do_maps_clone) +static int thread__clone_maps(struct thread *thread, struct thread *parent, bool do_maps_clone) { /* This is new thread, we share map groups for process. */ 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 ? map_groups__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) @@ -401,7 +399,7 @@ int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp, bo } thread->ppid = parent->tid; - return thread__clone_map_groups(thread, parent, do_maps_clone); + return thread__clone_maps(thread, parent, do_maps_clone); } void thread__find_cpumode_addr_location(struct thread *thread, u64 addr, |