Lines Matching refs:dso
137 static int dso__inject_build_id(struct dso *dso, struct perf_tool *tool,
404 static struct dso *findnew_dso(int pid, int tid, const char *filename, in findnew_dso()
410 struct dso *dso; in findnew_dso() local
433 dso = machine__findnew_vdso(machine, thread); in findnew_dso()
435 dso = machine__findnew_dso_id(machine, filename, id); in findnew_dso()
438 if (dso) { in findnew_dso()
439 mutex_lock(&dso->lock); in findnew_dso()
440 nsinfo__put(dso->nsinfo); in findnew_dso()
441 dso->nsinfo = nsi; in findnew_dso()
442 mutex_unlock(&dso->lock); in findnew_dso()
447 return dso; in findnew_dso()
455 struct dso *dso; in perf_event__repipe_buildid_mmap() local
457 dso = findnew_dso(event->mmap.pid, event->mmap.tid, in perf_event__repipe_buildid_mmap()
460 if (dso && !dso->hit) { in perf_event__repipe_buildid_mmap()
461 dso->hit = 1; in perf_event__repipe_buildid_mmap()
462 dso__inject_build_id(dso, tool, machine, sample->cpumode, 0); in perf_event__repipe_buildid_mmap()
464 dso__put(dso); in perf_event__repipe_buildid_mmap()
480 struct dso *dso; in perf_event__repipe_mmap2() local
482 dso = findnew_dso(event->mmap2.pid, event->mmap2.tid, in perf_event__repipe_mmap2()
484 if (dso) { in perf_event__repipe_mmap2()
486 dso->hit = 1; in perf_event__repipe_mmap2()
488 dso__put(dso); in perf_event__repipe_mmap2()
530 struct dso *dso; in perf_event__repipe_buildid_mmap2() local
534 dso = findnew_dso(event->mmap2.pid, event->mmap2.tid, in perf_event__repipe_buildid_mmap2()
536 if (dso) { in perf_event__repipe_buildid_mmap2()
538 dso->hit = 1; in perf_event__repipe_buildid_mmap2()
540 dso__put(dso); in perf_event__repipe_buildid_mmap2()
544 dso = findnew_dso(event->mmap2.pid, event->mmap2.tid, in perf_event__repipe_buildid_mmap2()
547 if (dso && !dso->hit) { in perf_event__repipe_buildid_mmap2()
548 dso->hit = 1; in perf_event__repipe_buildid_mmap2()
549 dso__inject_build_id(dso, tool, machine, sample->cpumode, in perf_event__repipe_buildid_mmap2()
552 dso__put(dso); in perf_event__repipe_buildid_mmap2()
618 static int dso__read_build_id(struct dso *dso) in dso__read_build_id() argument
622 if (dso->has_build_id) in dso__read_build_id()
625 mutex_lock(&dso->lock); in dso__read_build_id()
626 nsinfo__mountns_enter(dso->nsinfo, &nsc); in dso__read_build_id()
627 if (filename__read_build_id(dso->long_name, &dso->bid) > 0) in dso__read_build_id()
628 dso->has_build_id = true; in dso__read_build_id()
629 else if (dso->nsinfo) { in dso__read_build_id()
632 new_name = filename_with_chroot(dso->nsinfo->pid, in dso__read_build_id()
633 dso->long_name); in dso__read_build_id()
634 if (new_name && filename__read_build_id(new_name, &dso->bid) > 0) in dso__read_build_id()
635 dso->has_build_id = true; in dso__read_build_id()
639 mutex_unlock(&dso->lock); in dso__read_build_id()
641 return dso->has_build_id ? 0 : -1; in dso__read_build_id()
681 struct dso *dso) in perf_inject__lookup_known_build_id() argument
693 if (strcmp(dso->long_name, dso_name)) in perf_inject__lookup_known_build_id()
696 dso->bid.data[ix] = (hex(build_id[2 * ix]) << 4 | in perf_inject__lookup_known_build_id()
699 dso->bid.size = bid_len / 2; in perf_inject__lookup_known_build_id()
700 dso->has_build_id = 1; in perf_inject__lookup_known_build_id()
706 static int dso__inject_build_id(struct dso *dso, struct perf_tool *tool, in dso__inject_build_id() argument
713 if (is_anon_memory(dso->long_name) || flags & MAP_HUGETLB) in dso__inject_build_id()
715 if (is_no_dso_memory(dso->long_name)) in dso__inject_build_id()
719 perf_inject__lookup_known_build_id(inject, dso)) in dso__inject_build_id()
722 if (dso__read_build_id(dso) < 0) { in dso__inject_build_id()
723 pr_debug("no build_id found for %s\n", dso->long_name); in dso__inject_build_id()
727 err = perf_event__synthesize_build_id(tool, dso, cpumode, in dso__inject_build_id()
730 pr_err("Can't synthesize build_id event for %s\n", dso->long_name); in dso__inject_build_id()
753 if (!al.map->dso->hit) { in perf_event__inject_buildid()
754 al.map->dso->hit = 1; in perf_event__inject_buildid()
755 dso__inject_build_id(al.map->dso, tool, machine, in perf_event__inject_buildid()
1127 static bool dso__is_in_kernel_space(struct dso *dso) in dso__is_in_kernel_space() argument
1129 if (dso__is_vdso(dso)) in dso__is_in_kernel_space()
1132 return dso__is_kcore(dso) || in dso__is_in_kernel_space()
1133 dso->kernel || in dso__is_in_kernel_space()
1134 is_kernel_module(dso->long_name, PERF_RECORD_MISC_CPUMODE_UNKNOWN); in dso__is_in_kernel_space()
1158 static int synthesize_build_id(struct perf_inject *inject, struct dso *dso, pid_t machine_pid) in synthesize_build_id() argument
1161 u8 cpumode = dso__is_in_kernel_space(dso) ? in synthesize_build_id()
1168 dso->hit = 1; in synthesize_build_id()
1170 return perf_event__synthesize_build_id(&inject->tool, dso, cpumode, in synthesize_build_id()
1178 struct dso *dso; in guest_session__add_build_ids() local
1184 dsos__for_each_with_build_id(dso, &machine->dsos.head) { in guest_session__add_build_ids()
1185 ret = synthesize_build_id(inject, dso, gs->machine_pid); in guest_session__add_build_ids()