Lines Matching +full:rc +full:- +full:map +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0
8 #include "../../../util/synthetic-events.h"
11 #include "../../../util/map.h"
24 static int perf_event__synthesize_extra_kmaps_cb(struct map *map, void *data) in perf_event__synthesize_extra_kmaps_cb() argument
27 union perf_event *event = args->event; in perf_event__synthesize_extra_kmaps_cb()
31 if (!__map__is_extra_kernel_map(map)) in perf_event__synthesize_extra_kmaps_cb()
34 kmap = map__kmap(map); in perf_event__synthesize_extra_kmaps_cb()
36 size = sizeof(event->mmap) - sizeof(event->mmap.filename) + in perf_event__synthesize_extra_kmaps_cb()
37 PERF_ALIGN(strlen(kmap->name) + 1, sizeof(u64)) + in perf_event__synthesize_extra_kmaps_cb()
38 args->machine->id_hdr_size; in perf_event__synthesize_extra_kmaps_cb()
42 event->mmap.header.type = PERF_RECORD_MMAP; in perf_event__synthesize_extra_kmaps_cb()
48 if (machine__is_host(args->machine)) in perf_event__synthesize_extra_kmaps_cb()
49 event->header.misc = PERF_RECORD_MISC_KERNEL; in perf_event__synthesize_extra_kmaps_cb()
51 event->header.misc = PERF_RECORD_MISC_GUEST_KERNEL; in perf_event__synthesize_extra_kmaps_cb()
53 event->mmap.header.size = size; in perf_event__synthesize_extra_kmaps_cb()
55 event->mmap.start = map__start(map); in perf_event__synthesize_extra_kmaps_cb()
56 event->mmap.len = map__size(map); in perf_event__synthesize_extra_kmaps_cb()
57 event->mmap.pgoff = map__pgoff(map); in perf_event__synthesize_extra_kmaps_cb()
58 event->mmap.pid = args->machine->pid; in perf_event__synthesize_extra_kmaps_cb()
60 strlcpy(event->mmap.filename, kmap->name, PATH_MAX); in perf_event__synthesize_extra_kmaps_cb()
62 if (perf_tool__process_synth_event(args->tool, event, args->machine, args->process) != 0) in perf_event__synthesize_extra_kmaps_cb()
63 return -1; in perf_event__synthesize_extra_kmaps_cb()
72 int rc; in perf_event__synthesize_extra_kmaps() local
78 .event = zalloc(sizeof(args.event->mmap) + machine->id_hdr_size), in perf_event__synthesize_extra_kmaps()
84 return -1; in perf_event__synthesize_extra_kmaps()
87 rc = maps__for_each_map(kmaps, perf_event__synthesize_extra_kmaps_cb, &args); in perf_event__synthesize_extra_kmaps()
90 return rc; in perf_event__synthesize_extra_kmaps()
102 data->weight = weight.full; in arch_perf_parse_sample_weight()
104 data->weight = weight.var1_dw; in arch_perf_parse_sample_weight()
105 data->ins_lat = weight.var2_w; in arch_perf_parse_sample_weight()
106 data->retire_lat = weight.var3_w; in arch_perf_parse_sample_weight()
113 *array = data->weight; in arch_perf_synthesize_sample_weight()
117 *array |= ((u64)data->ins_lat << 32); in arch_perf_synthesize_sample_weight()
118 *array |= ((u64)data->retire_lat << 48); in arch_perf_synthesize_sample_weight()