return true;
}
- target_ms.maps = ms->maps;
+ target_ms.thread = ms->thread;
target_ms.map = ms->map;
target_ms.sym = dl->ops.target.sym;
annotation__unlock(notes);
case 'k':
if (browser->selection != NULL)
hists_browser__zoom_map(browser,
- maps__machine(browser->selection->maps)->vmlinux_map);
+ maps__machine(thread__maps(browser->selection->thread)
+ )->vmlinux_map);
continue;
case 'V':
verbose = (verbose + 1) % 4;
void addr_location__init(struct addr_location *al)
{
al->thread = NULL;
- al->maps = NULL;
al->map = NULL;
al->sym = NULL;
al->srcline = NULL;
{
map__zput(al->map);
thread__zput(al->thread);
- maps__zput(al->maps);
}
void addr_location__copy(struct addr_location *dst, struct addr_location *src)
{
thread__put(dst->thread);
- maps__put(dst->maps);
map__put(dst->map);
*dst = *src;
dst->thread = thread__get(src->thread);
- dst->maps = maps__get(src->maps);
dst->map = map__get(src->map);
}
struct addr_location {
struct thread *thread;
- struct maps *maps;
struct map *map;
struct symbol *sym;
const char *srcline;
#include "../map.h"
#include "../maps.h"
#include "../symbol.h"
+#include "../thread.h"
static int loongarch_call__parse(const struct arch *arch, struct ins_operands *ops,
struct map_symbol *ms,
.addr = map__objdump_2mem(map, ops->target.addr),
};
- if (maps__find_ams(ms->maps, &target) == 0 &&
+ if (maps__find_ams(thread__maps(ms->thread), &target) == 0 &&
map__rip_2objdump(target.ms.map, map__map_ip(target.ms.map, target.addr)) == ops->target.addr)
ops->target.sym = target.ms.sym;
ops->target.outside = target.addr < start || target.addr > end;
- if (maps__find_ams(ms->maps, &target) == 0 &&
+ if (maps__find_ams(thread__maps(ms->thread), &target) == 0 &&
map__rip_2objdump(target.ms.map, map__map_ip(target.ms.map, target.addr)) == ops->target.addr)
ops->target.sym = target.ms.sym;
#include "../map.h"
#include "../maps.h"
#include "../symbol.h"
+#include "../thread.h"
#include "../annotate.h"
#include "../annotate-data.h"
.addr = map__objdump_2mem(map, ops->target.addr),
};
- if (maps__find_ams(ms->maps, &target) == 0 &&
+ if (maps__find_ams(thread__maps(ms->thread), &target) == 0 &&
map__rip_2objdump(target.ms.map, map__map_ip(target.ms.map, target.addr)) == ops->target.addr)
ops->target.sym = target.ms.sym;
#include "callchain.h"
#include "branch.h"
#include "symbol.h"
+#include "thread.h"
#include "util.h"
#include "../perf.h"
list_for_each_entry_safe(list, next_list, &src->val, list) {
struct map_symbol ms = {
- .maps = maps__get(list->ms.maps),
+ .thread = thread__get(list->ms.thread),
.map = map__get(list->ms.map),
};
callchain_cursor_append(cursor, list->ip, &ms, false, NULL, 0, 0, 0, list->srcline);
int fill_callchain_info(struct addr_location *al, struct callchain_cursor_node *node,
bool hide_unresolved)
{
- struct machine *machine = node->ms.maps ? maps__machine(node->ms.maps) : NULL;
+ struct machine *machine = NULL;
+
+ if (node->ms.thread)
+ machine = maps__machine(thread__maps(node->ms.thread));
- maps__put(al->maps);
- al->maps = maps__get(node->ms.maps);
map__put(al->map);
al->map = map__get(node->ms.map);
al->sym = node->ms.sym;
if (al->map == NULL)
goto out;
}
- if (maps__equal(al->maps, machine__kernel_maps(machine))) {
+ if (maps__equal(thread__maps(al->thread), machine__kernel_maps(machine))) {
if (machine__is_host(machine)) {
al->cpumode = PERF_RECORD_MISC_KERNEL;
al->level = 'k';
!strcmp(args->options->disassembler_style, "att"))
disassembler_style = true;
- if (capstone_init(maps__machine(args->ms->maps), &handle, is_64bit, disassembler_style) < 0)
+ if (capstone_init(maps__machine(thread__maps(args->ms->thread)), &handle, is_64bit,
+ disassembler_style) < 0)
goto err;
needs_cs_close = true;
!strcmp(args->options->disassembler_style, "att"))
disassembler_style = true;
- if (capstone_init(maps__machine(args->ms->maps), &handle, is_64bit, disassembler_style) < 0)
+ if (capstone_init(maps__machine(thread__maps(args->ms->thread)), &handle, is_64bit,
+ disassembler_style) < 0)
goto err;
needs_cs_close = true;
addr_location__init(&al);
al.sym = node->ms.sym;
al.map = map__get(node->ms.map);
- al.maps = maps__get(thread__maps(thread));
al.addr = node->ip;
al.thread = thread__get(thread);
#include "namespaces.h"
#include "srcline.h"
#include "symbol.h"
+#include "thread.h"
#include "util.h"
static regex_t file_lineno;
.addr = map__objdump_2mem(map, ops->target.addr),
};
- if (maps__find_ams(ms->maps, &target) == 0 &&
+ if (maps__find_ams(thread__maps(ms->thread), &target) == 0 &&
map__rip_2objdump(target.ms.map, map__map_ip(target.ms.map, target.addr)) == ops->target.addr)
ops->target.sym = target.ms.sym;
* Actual navigation will come next, with further understanding of how
* the symbol searching and disassembly should be done.
*/
- if (maps__find_ams(ms->maps, &target) == 0 &&
+ if (maps__find_ams(thread__maps(ms->thread), &target) == 0 &&
map__rip_2objdump(target.ms.map, map__map_ip(target.ms.map, target.addr)) == ops->target.addr)
ops->target.sym = target.ms.sym;
.ms = { .map = map__get(map), },
};
- if (!maps__find_ams(args->ms->maps, &target) &&
+ if (!maps__find_ams(thread__maps(args->ms->thread), &target) &&
target.ms.sym->start == target.al_addr)
dl->ops.target.sym = target.ms.sym;
struct machine *machine = maps__machine(maps);
bool load_map = false;
- maps__zput(al->maps);
map__zput(al->map);
thread__zput(al->thread);
al->thread = thread__get(thread);
return NULL;
}
- al->maps = maps__get(maps);
al->map = maps__find(maps, al->addr);
if (al->map != NULL) {
/*
if (h->cgroup) {
const char *cgrp_name = "unknown";
- struct cgroup *cgrp = cgroup__find(maps__machine(h->ms.maps)->env,
+ struct cgroup *cgrp = cgroup__find(maps__machine(thread__maps(h->ms.thread))->env,
h->cgroup);
if (cgrp != NULL)
cgrp_name = cgrp->name;
memset(&he->stat, 0, sizeof(he->stat));
}
- he->ms.maps = maps__get(he->ms.maps);
+ he->ms.thread = thread__get(he->ms.thread);
he->ms.map = map__get(he->ms.map);
if (he->branch_info) {
memcpy(he->branch_info, template->branch_info,
sizeof(*he->branch_info));
- he->branch_info->from.ms.maps = maps__get(he->branch_info->from.ms.maps);
+ he->branch_info->from.ms.thread = thread__get(he->branch_info->from.ms.thread);
he->branch_info->from.ms.map = map__get(he->branch_info->from.ms.map);
- he->branch_info->to.ms.maps = maps__get(he->branch_info->to.ms.maps);
+ he->branch_info->to.ms.thread = thread__get(he->branch_info->to.ms.thread);
he->branch_info->to.ms.map = map__get(he->branch_info->to.ms.map);
}
},
.cgroup = sample->cgroup,
.ms = {
- .maps = al->maps,
+ .thread = al->thread,
.map = al->map,
.sym = al->sym,
},
.block_info = block_info,
.hists = hists,
.ms = {
- .maps = al->maps,
+ .thread = al->thread,
.map = al->map,
.sym = al->sym,
},
if (iter->curr >= iter->total)
return 0;
- maps__put(al->maps);
- al->maps = maps__get(bi[i].to.ms.maps);
+ thread__put(al->thread);
+ al->thread = thread__get(bi[i].to.ms.thread);
map__put(al->map);
al->map = map__get(bi[i].to.ms.map);
al->sym = bi[i].to.ms.sym;
.comm = thread__comm(al->thread),
.ip = al->addr,
.ms = {
- .maps = al->maps,
+ .thread = al->thread,
.map = al->map,
.sym = al->sym,
},
ams->addr = ip;
ams->al_addr = al.addr;
ams->al_level = al.level;
- ams->ms.maps = maps__get(al.maps);
+ ams->ms.thread = thread__get(al.thread);
ams->ms.sym = al.sym;
ams->ms.map = map__get(al.map);
ams->phys_addr = 0;
ams->addr = addr;
ams->al_addr = al.addr;
ams->al_level = al.level;
- ams->ms.maps = maps__get(al.maps);
+ ams->ms.thread = thread__get(al.thread);
ams->ms.sym = al.sym;
ams->ms.map = map__get(al.map);
ams->phys_addr = phys_addr;
}
ilist_ms = (struct map_symbol) {
- .maps = maps__get(ms->maps),
+ .thread = thread__get(ms->thread),
.map = map__get(map),
};
list_for_each_entry(ilist, &inline_node->val, list) {
iter_cycles = iter->cycles;
}
- ms.maps = maps__get(al.maps);
+ ms.thread = thread__get(al.thread);
ms.map = map__get(al.map);
ms.sym = al.sym;
map_symbol__exit(&lbr_stitch->prev_lbr_cursor[idx].ms);
memcpy(&lbr_stitch->prev_lbr_cursor[idx], cursor->curr,
sizeof(struct callchain_cursor_node));
- lbr_stitch->prev_lbr_cursor[idx].ms.maps = maps__get(cursor->curr->ms.maps);
+ lbr_stitch->prev_lbr_cursor[idx].ms.thread = thread__get(cursor->curr->ms.thread);
lbr_stitch->prev_lbr_cursor[idx].ms.map = map__get(cursor->curr->ms.map);
lbr_stitch->prev_lbr_cursor[idx].valid = true;
memcpy(&stitch_node->cursor, &lbr_stitch->prev_lbr_cursor[i],
sizeof(struct callchain_cursor_node));
- stitch_node->cursor.ms.maps = maps__get(lbr_stitch->prev_lbr_cursor[i].ms.maps);
+ stitch_node->cursor.ms.thread =
+ thread__get(lbr_stitch->prev_lbr_cursor[i].ms.thread);
stitch_node->cursor.ms.map = map__get(lbr_stitch->prev_lbr_cursor[i].ms.map);
if (callee)
#include "map_symbol.h"
#include "maps.h"
#include "map.h"
+#include "thread.h"
void map_symbol__exit(struct map_symbol *ms)
{
- maps__zput(ms->maps);
+ thread__zput(ms->thread);
map__zput(ms->map);
}
void map_symbol__copy(struct map_symbol *dst, struct map_symbol *src)
{
- dst->maps = maps__get(src->maps);
+ dst->thread = thread__get(src->thread);
dst->map = map__get(src->map);
dst->sym = src->sym;
}
#include <linux/types.h>
+struct thread;
struct maps;
struct map;
struct symbol;
struct map_symbol {
- struct maps *maps;
+ struct thread *thread;
struct map *map;
struct symbol *sym;
};
const char *cgrp_name = "N/A";
if (he->cgroup) {
- struct cgroup *cgrp = cgroup__find(maps__machine(he->ms.maps)->env,
+ struct cgroup *cgrp = cgroup__find(maps__machine(thread__maps(he->ms.thread))->env,
he->cgroup);
if (cgrp != NULL)
cgrp_name = cgrp->name;
}
e->ip = ip;
- e->ms.maps = maps__get(al.maps);
+ e->ms.thread = thread__get(al.thread);
e->ms.map = map__get(al.map);
e->ms.sym = al.sym;
e.ms.sym = thread__find_symbol(thread, PERF_RECORD_MISC_USER, ip, &al);
e.ip = ip;
e.ms.map = al.map;
- e.ms.maps = al.maps;
+ e.ms.thread = thread__get(al.thread);
pr_debug("unwind: %s:ip = 0x%" PRIx64 " (0x%" PRIx64 ")\n",
al.sym ? al.sym->name : "''",