Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf maps: Rename 'mg' variables to 'maps'

Continuing 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-z8d14wrw393a0fbvmnk1bqd9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+135 -140
+9 -9
tools/perf/tests/map_groups.c
··· 35 35 36 36 int test__map_groups__merge_in(struct test *t __maybe_unused, int subtest __maybe_unused) 37 37 { 38 - struct maps mg; 38 + struct maps maps; 39 39 unsigned int i; 40 40 struct map_def bpf_progs[] = { 41 41 { "bpf_prog_1", 200, 300 }, ··· 64 64 struct map *map_kcore1, *map_kcore2, *map_kcore3; 65 65 int ret; 66 66 67 - maps__init(&mg, NULL); 67 + maps__init(&maps, NULL); 68 68 69 69 for (i = 0; i < ARRAY_SIZE(bpf_progs); i++) { 70 70 struct map *map; ··· 74 74 75 75 map->start = bpf_progs[i].start; 76 76 map->end = bpf_progs[i].end; 77 - maps__insert(&mg, map); 77 + maps__insert(&maps, map); 78 78 map__put(map); 79 79 } 80 80 ··· 99 99 map_kcore3->start = 880; 100 100 map_kcore3->end = 1100; 101 101 102 - ret = maps__merge_in(&mg, map_kcore1); 102 + ret = maps__merge_in(&maps, map_kcore1); 103 103 TEST_ASSERT_VAL("failed to merge map", !ret); 104 104 105 - ret = check_maps(merged12, ARRAY_SIZE(merged12), &mg); 105 + ret = check_maps(merged12, ARRAY_SIZE(merged12), &maps); 106 106 TEST_ASSERT_VAL("merge check failed", !ret); 107 107 108 - ret = maps__merge_in(&mg, map_kcore2); 108 + ret = maps__merge_in(&maps, map_kcore2); 109 109 TEST_ASSERT_VAL("failed to merge map", !ret); 110 110 111 - ret = check_maps(merged12, ARRAY_SIZE(merged12), &mg); 111 + ret = check_maps(merged12, ARRAY_SIZE(merged12), &maps); 112 112 TEST_ASSERT_VAL("merge check failed", !ret); 113 113 114 - ret = maps__merge_in(&mg, map_kcore3); 114 + ret = maps__merge_in(&maps, map_kcore3); 115 115 TEST_ASSERT_VAL("failed to merge map", !ret); 116 116 117 - ret = check_maps(merged3, ARRAY_SIZE(merged3), &mg); 117 + ret = check_maps(merged3, ARRAY_SIZE(merged3), &maps); 118 118 TEST_ASSERT_VAL("merge check failed", !ret); 119 119 return TEST_OK; 120 120 }
+9 -9
tools/perf/tests/thread-mg-share.c
··· 12 12 /* thread group */ 13 13 struct thread *leader; 14 14 struct thread *t1, *t2, *t3; 15 - struct maps *mg; 15 + struct maps *maps; 16 16 17 17 /* other process */ 18 18 struct thread *other, *other_leader; ··· 42 42 TEST_ASSERT_VAL("failed to create threads", 43 43 leader && t1 && t2 && t3 && other); 44 44 45 - mg = leader->maps; 46 - TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&mg->refcnt), 4); 45 + maps = leader->maps; 46 + TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&maps->refcnt), 4); 47 47 48 48 /* test the map groups pointer is shared */ 49 - TEST_ASSERT_VAL("map groups don't match", mg == t1->maps); 50 - TEST_ASSERT_VAL("map groups don't match", mg == t2->maps); 51 - TEST_ASSERT_VAL("map groups don't match", mg == t3->maps); 49 + TEST_ASSERT_VAL("map groups don't match", maps == t1->maps); 50 + TEST_ASSERT_VAL("map groups don't match", maps == t2->maps); 51 + TEST_ASSERT_VAL("map groups don't match", maps == t3->maps); 52 52 53 53 /* 54 54 * Verify the other leader was created by previous call. ··· 77 77 78 78 /* release thread group */ 79 79 thread__put(leader); 80 - TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&mg->refcnt), 3); 80 + TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&maps->refcnt), 3); 81 81 82 82 thread__put(t1); 83 - TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&mg->refcnt), 2); 83 + TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&maps->refcnt), 2); 84 84 85 85 thread__put(t2); 86 - TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&mg->refcnt), 1); 86 + TEST_ASSERT_EQUAL("wrong refcnt", refcount_read(&maps->refcnt), 1); 87 87 88 88 thread__put(t3); 89 89
+6 -6
tools/perf/util/event.c
··· 457 457 struct map *thread__find_map(struct thread *thread, u8 cpumode, u64 addr, 458 458 struct addr_location *al) 459 459 { 460 - struct maps *mg = thread->maps; 461 - struct machine *machine = mg->machine; 460 + struct maps *maps = thread->maps; 461 + struct machine *machine = maps->machine; 462 462 bool load_map = false; 463 463 464 - al->maps = mg; 464 + al->maps = maps; 465 465 al->thread = thread; 466 466 al->addr = addr; 467 467 al->cpumode = cpumode; ··· 474 474 475 475 if (cpumode == PERF_RECORD_MISC_KERNEL && perf_host) { 476 476 al->level = 'k'; 477 - al->maps = mg = &machine->kmaps; 477 + al->maps = maps = &machine->kmaps; 478 478 load_map = true; 479 479 } else if (cpumode == PERF_RECORD_MISC_USER && perf_host) { 480 480 al->level = '.'; 481 481 } else if (cpumode == PERF_RECORD_MISC_GUEST_KERNEL && perf_guest) { 482 482 al->level = 'g'; 483 - al->maps = mg = &machine->kmaps; 483 + al->maps = maps = &machine->kmaps; 484 484 load_map = true; 485 485 } else if (cpumode == PERF_RECORD_MISC_GUEST_USER && perf_guest) { 486 486 al->level = 'u'; ··· 500 500 return NULL; 501 501 } 502 502 503 - al->map = maps__find(mg, al->addr); 503 + al->map = maps__find(maps, al->addr); 504 504 if (al->map != NULL) { 505 505 /* 506 506 * Kernel maps might be changed when loading symbols so loading
+5 -5
tools/perf/util/machine.c
··· 1259 1259 dso->symtab_type == DSO_BINARY_TYPE__GUEST_KMODULE; 1260 1260 } 1261 1261 1262 - static int maps__set_module_path(struct maps *mg, const char *path, struct kmod_path *m) 1262 + static int maps__set_module_path(struct maps *maps, const char *path, struct kmod_path *m) 1263 1263 { 1264 1264 char *long_name; 1265 - struct map *map = maps__find_by_name(mg, m->name); 1265 + struct map *map = maps__find_by_name(maps, m->name); 1266 1266 1267 1267 if (map == NULL) 1268 1268 return 0; ··· 1286 1286 return 0; 1287 1287 } 1288 1288 1289 - static int maps__set_modules_path_dir(struct maps *mg, const char *dir_name, int depth) 1289 + static int maps__set_modules_path_dir(struct maps *maps, const char *dir_name, int depth) 1290 1290 { 1291 1291 struct dirent *dent; 1292 1292 DIR *dir = opendir(dir_name); ··· 1318 1318 continue; 1319 1319 } 1320 1320 1321 - ret = maps__set_modules_path_dir(mg, path, depth + 1); 1321 + ret = maps__set_modules_path_dir(maps, path, depth + 1); 1322 1322 if (ret < 0) 1323 1323 goto out; 1324 1324 } else { ··· 1329 1329 goto out; 1330 1330 1331 1331 if (m.kmod) 1332 - ret = maps__set_module_path(mg, path, &m); 1332 + ret = maps__set_module_path(maps, path, &m); 1333 1333 1334 1334 zfree(&m.name); 1335 1335
+43 -46
tools/perf/util/map.c
··· 512 512 return ip + map->reloc; 513 513 } 514 514 515 - void maps__init(struct maps *mg, struct machine *machine) 515 + void maps__init(struct maps *maps, struct machine *machine) 516 516 { 517 - mg->entries = RB_ROOT; 518 - init_rwsem(&mg->lock); 519 - mg->machine = machine; 520 - mg->last_search_by_name = NULL; 521 - mg->nr_maps = 0; 522 - mg->maps_by_name = NULL; 523 - refcount_set(&mg->refcnt, 1); 517 + maps->entries = RB_ROOT; 518 + init_rwsem(&maps->lock); 519 + maps->machine = machine; 520 + maps->last_search_by_name = NULL; 521 + maps->nr_maps = 0; 522 + maps->maps_by_name = NULL; 523 + refcount_set(&maps->refcnt, 1); 524 524 } 525 525 526 - static void __maps__free_maps_by_name(struct maps *mg) 526 + static void __maps__free_maps_by_name(struct maps *maps) 527 527 { 528 528 /* 529 529 * Free everything to try to do it from the rbtree in the next search 530 530 */ 531 - zfree(&mg->maps_by_name); 532 - mg->nr_maps_allocated = 0; 531 + zfree(&maps->maps_by_name); 532 + maps->nr_maps_allocated = 0; 533 533 } 534 534 535 - void maps__insert(struct maps *mg, struct map *map) 535 + void maps__insert(struct maps *maps, struct map *map) 536 536 { 537 - struct maps *maps = mg; 538 - 539 537 down_write(&maps->lock); 540 538 __maps__insert(maps, map); 541 - ++mg->nr_maps; 539 + ++maps->nr_maps; 542 540 543 541 /* 544 542 * If we already performed some search by name, then we need to add the just 545 543 * inserted map and resort. 546 544 */ 547 - if (mg->maps_by_name) { 548 - if (mg->nr_maps > mg->nr_maps_allocated) { 549 - int nr_allocate = mg->nr_maps * 2; 550 - struct map **maps_by_name = realloc(mg->maps_by_name, nr_allocate * sizeof(map)); 545 + if (maps->maps_by_name) { 546 + if (maps->nr_maps > maps->nr_maps_allocated) { 547 + int nr_allocate = maps->nr_maps * 2; 548 + struct map **maps_by_name = realloc(maps->maps_by_name, nr_allocate * sizeof(map)); 551 549 552 550 if (maps_by_name == NULL) { 553 551 __maps__free_maps_by_name(maps); 554 552 return; 555 553 } 556 554 557 - mg->maps_by_name = maps_by_name; 558 - mg->nr_maps_allocated = nr_allocate; 555 + maps->maps_by_name = maps_by_name; 556 + maps->nr_maps_allocated = nr_allocate; 559 557 } 560 - mg->maps_by_name[mg->nr_maps - 1] = map; 558 + maps->maps_by_name[maps->nr_maps - 1] = map; 561 559 __maps__sort_by_name(maps); 562 560 } 563 561 up_write(&maps->lock); ··· 567 569 map__put(map); 568 570 } 569 571 570 - void maps__remove(struct maps *mg, struct map *map) 572 + void maps__remove(struct maps *maps, struct map *map) 571 573 { 572 - struct maps *maps = mg; 573 574 down_write(&maps->lock); 574 - if (mg->last_search_by_name == map) 575 - mg->last_search_by_name = NULL; 575 + if (maps->last_search_by_name == map) 576 + maps->last_search_by_name = NULL; 576 577 577 578 __maps__remove(maps, map); 578 - --mg->nr_maps; 579 - if (mg->maps_by_name) 579 + --maps->nr_maps; 580 + if (maps->maps_by_name) 580 581 __maps__free_maps_by_name(maps); 581 582 up_write(&maps->lock); 582 583 } ··· 604 607 605 608 struct maps *maps__new(struct machine *machine) 606 609 { 607 - struct maps *mg = zalloc(sizeof(*mg)), *maps = mg; 610 + struct maps *maps = zalloc(sizeof(*maps)); 608 611 609 - if (mg != NULL) 612 + if (maps != NULL) 610 613 maps__init(maps, machine); 611 614 612 - return mg; 615 + return maps; 613 616 } 614 617 615 - void maps__delete(struct maps *mg) 618 + void maps__delete(struct maps *maps) 616 619 { 617 - maps__exit(mg); 618 - unwind__finish_access(mg); 619 - free(mg); 620 + maps__exit(maps); 621 + unwind__finish_access(maps); 622 + free(maps); 620 623 } 621 624 622 - void maps__put(struct maps *mg) 625 + void maps__put(struct maps *maps) 623 626 { 624 - if (mg && refcount_dec_and_test(&mg->refcnt)) 625 - maps__delete(mg); 627 + if (maps && refcount_dec_and_test(&maps->refcnt)) 628 + maps__delete(maps); 626 629 } 627 630 628 - struct symbol *maps__find_symbol(struct maps *mg, u64 addr, struct map **mapp) 631 + struct symbol *maps__find_symbol(struct maps *maps, u64 addr, struct map **mapp) 629 632 { 630 - struct map *map = maps__find(mg, addr); 633 + struct map *map = maps__find(maps, addr); 631 634 632 635 /* Ensure map is loaded before using map->map_ip */ 633 636 if (map != NULL && map__load(map) >= 0) { ··· 673 676 return sym; 674 677 } 675 678 676 - int maps__find_ams(struct maps *mg, struct addr_map_symbol *ams) 679 + int maps__find_ams(struct maps *maps, struct addr_map_symbol *ams) 677 680 { 678 681 if (ams->addr < ams->ms.map->start || ams->addr >= ams->ms.map->end) { 679 - if (mg == NULL) 682 + if (maps == NULL) 680 683 return -1; 681 - ams->ms.map = maps__find(mg, ams->addr); 684 + ams->ms.map = maps__find(maps, ams->addr); 682 685 if (ams->ms.map == NULL) 683 686 return -1; 684 687 } ··· 816 819 */ 817 820 int maps__clone(struct thread *thread, struct maps *parent) 818 821 { 819 - struct maps *mg = thread->maps; 822 + struct maps *maps = thread->maps; 820 823 int err = -ENOMEM; 821 824 struct map *map; 822 825 ··· 827 830 if (new == NULL) 828 831 goto out_unlock; 829 832 830 - err = unwind__prepare_access(mg, new, NULL); 833 + err = unwind__prepare_access(maps, new, NULL); 831 834 if (err) 832 835 goto out_unlock; 833 836 834 - maps__insert(mg, new); 837 + maps__insert(maps, new); 835 838 map__put(new); 836 839 } 837 840
+18 -18
tools/perf/util/map_groups.h
··· 49 49 }; 50 50 51 51 struct maps *maps__new(struct machine *machine); 52 - void maps__delete(struct maps *mg); 53 - bool maps__empty(struct maps *mg); 52 + void maps__delete(struct maps *maps); 53 + bool maps__empty(struct maps *maps); 54 54 55 - static inline struct maps *maps__get(struct maps *mg) 55 + static inline struct maps *maps__get(struct maps *maps) 56 56 { 57 - if (mg) 58 - refcount_inc(&mg->refcnt); 59 - return mg; 57 + if (maps) 58 + refcount_inc(&maps->refcnt); 59 + return maps; 60 60 } 61 61 62 - void maps__put(struct maps *mg); 63 - void maps__init(struct maps *mg, struct machine *machine); 64 - void maps__exit(struct maps *mg); 62 + void maps__put(struct maps *maps); 63 + void maps__init(struct maps *maps, struct machine *machine); 64 + void maps__exit(struct maps *maps); 65 65 int maps__clone(struct thread *thread, struct maps *parent); 66 - size_t maps__fprintf(struct maps *mg, FILE *fp); 66 + size_t maps__fprintf(struct maps *maps, FILE *fp); 67 67 68 - void maps__insert(struct maps *mg, struct map *map); 68 + void maps__insert(struct maps *maps, struct map *map); 69 69 70 - void maps__remove(struct maps *mg, struct map *map); 70 + void maps__remove(struct maps *maps, struct map *map); 71 71 72 - struct symbol *maps__find_symbol(struct maps *mg, u64 addr, struct map **mapp); 73 - struct symbol *maps__find_symbol_by_name(struct maps *mg, const char *name, struct map **mapp); 72 + struct symbol *maps__find_symbol(struct maps *maps, u64 addr, struct map **mapp); 73 + struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name, struct map **mapp); 74 74 75 75 struct addr_map_symbol; 76 76 77 - int maps__find_ams(struct maps *mg, struct addr_map_symbol *ams); 77 + int maps__find_ams(struct maps *maps, struct addr_map_symbol *ams); 78 78 79 - int maps__fixup_overlappings(struct maps *mg, struct map *map, FILE *fp); 79 + int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp); 80 80 81 - struct map *maps__find_by_name(struct maps *mg, const char *name); 81 + struct map *maps__find_by_name(struct maps *maps, const char *name); 82 82 83 83 int maps__merge_in(struct maps *kmaps, struct map *new_map); 84 84 85 - void __maps__sort_by_name(struct maps *mg); 85 + void __maps__sort_by_name(struct maps *maps); 86 86 87 87 #endif // __PERF_MAP_GROUPS_H
+21 -23
tools/perf/util/symbol.c
··· 239 239 curr->end = roundup(curr->start, 4096) + 4096; 240 240 } 241 241 242 - void maps__fixup_end(struct maps *mg) 242 + void maps__fixup_end(struct maps *maps) 243 243 { 244 - struct maps *maps = mg; 245 244 struct map *prev = NULL, *curr; 246 245 247 246 down_write(&maps->lock); ··· 1770 1771 return strcmp(name, map->dso->short_name); 1771 1772 } 1772 1773 1773 - void __maps__sort_by_name(struct maps *mg) 1774 + void __maps__sort_by_name(struct maps *maps) 1774 1775 { 1775 - qsort(mg->maps_by_name, mg->nr_maps, sizeof(struct map *), map__strcmp); 1776 + qsort(maps->maps_by_name, maps->nr_maps, sizeof(struct map *), map__strcmp); 1776 1777 } 1777 1778 1778 - static int map__groups__sort_by_name_from_rbtree(struct maps *mg) 1779 + static int map__groups__sort_by_name_from_rbtree(struct maps *maps) 1779 1780 { 1780 1781 struct map *map; 1781 - struct map **maps_by_name = realloc(mg->maps_by_name, mg->nr_maps * sizeof(map)); 1782 + struct map **maps_by_name = realloc(maps->maps_by_name, maps->nr_maps * sizeof(map)); 1782 1783 int i = 0; 1783 1784 1784 1785 if (maps_by_name == NULL) 1785 1786 return -1; 1786 1787 1787 - mg->maps_by_name = maps_by_name; 1788 - mg->nr_maps_allocated = mg->nr_maps; 1788 + maps->maps_by_name = maps_by_name; 1789 + maps->nr_maps_allocated = maps->nr_maps; 1789 1790 1790 - maps__for_each_entry(mg, map) 1791 + maps__for_each_entry(maps, map) 1791 1792 maps_by_name[i++] = map; 1792 1793 1793 - __maps__sort_by_name(mg); 1794 + __maps__sort_by_name(maps); 1794 1795 return 0; 1795 1796 } 1796 1797 1797 - static struct map *__maps__find_by_name(struct maps *mg, const char *name) 1798 + static struct map *__maps__find_by_name(struct maps *maps, const char *name) 1798 1799 { 1799 1800 struct map **mapp; 1800 1801 1801 - if (mg->maps_by_name == NULL && 1802 - map__groups__sort_by_name_from_rbtree(mg)) 1802 + if (maps->maps_by_name == NULL && 1803 + map__groups__sort_by_name_from_rbtree(maps)) 1803 1804 return NULL; 1804 1805 1805 - mapp = bsearch(name, mg->maps_by_name, mg->nr_maps, sizeof(*mapp), map__strcmp_name); 1806 + mapp = bsearch(name, maps->maps_by_name, maps->nr_maps, sizeof(*mapp), map__strcmp_name); 1806 1807 if (mapp) 1807 1808 return *mapp; 1808 1809 return NULL; 1809 1810 } 1810 1811 1811 - struct map *maps__find_by_name(struct maps *mg, const char *name) 1812 + struct map *maps__find_by_name(struct maps *maps, const char *name) 1812 1813 { 1813 - struct maps *maps = mg; 1814 1814 struct map *map; 1815 1815 1816 1816 down_read(&maps->lock); 1817 1817 1818 - if (mg->last_search_by_name && strcmp(mg->last_search_by_name->dso->short_name, name) == 0) { 1819 - map = mg->last_search_by_name; 1818 + if (maps->last_search_by_name && strcmp(maps->last_search_by_name->dso->short_name, name) == 0) { 1819 + map = maps->last_search_by_name; 1820 1820 goto out_unlock; 1821 1821 } 1822 1822 /* 1823 - * If we have mg->maps_by_name, then the name isn't in the rbtree, 1824 - * as mg->maps_by_name mirrors the rbtree when lookups by name are 1823 + * If we have maps->maps_by_name, then the name isn't in the rbtree, 1824 + * as maps->maps_by_name mirrors the rbtree when lookups by name are 1825 1825 * made. 1826 1826 */ 1827 - map = __maps__find_by_name(mg, name); 1828 - if (map || mg->maps_by_name != NULL) 1827 + map = __maps__find_by_name(maps, name); 1828 + if (map || maps->maps_by_name != NULL) 1829 1829 goto out_unlock; 1830 1830 1831 1831 /* Fallback to traversing the rbtree... */ 1832 1832 maps__for_each_entry(maps, map) 1833 1833 if (strcmp(map->dso->short_name, name) == 0) { 1834 - mg->last_search_by_name = map; 1834 + maps->last_search_by_name = map; 1835 1835 goto out_unlock; 1836 1836 } 1837 1837
+1 -1
tools/perf/util/symbol.h
··· 186 186 void symbols__insert(struct rb_root_cached *symbols, struct symbol *sym); 187 187 void symbols__fixup_duplicate(struct rb_root_cached *symbols); 188 188 void symbols__fixup_end(struct rb_root_cached *symbols); 189 - void maps__fixup_end(struct maps *mg); 189 + void maps__fixup_end(struct maps *maps); 190 190 191 191 typedef int (*mapfn_t)(u64 start, u64 len, u64 pgoff, void *data); 192 192 int file__read_maps(int fd, bool exe, mapfn_t mapfn, void *data,
+8 -8
tools/perf/util/unwind-libunwind-local.c
··· 616 616 .get_proc_name = get_proc_name, 617 617 }; 618 618 619 - static int _unwind__prepare_access(struct maps *mg) 619 + static int _unwind__prepare_access(struct maps *maps) 620 620 { 621 - mg->addr_space = unw_create_addr_space(&accessors, 0); 622 - if (!mg->addr_space) { 621 + maps->addr_space = unw_create_addr_space(&accessors, 0); 622 + if (!maps->addr_space) { 623 623 pr_err("unwind: Can't create unwind address space.\n"); 624 624 return -ENOMEM; 625 625 } 626 626 627 - unw_set_caching_policy(mg->addr_space, UNW_CACHE_GLOBAL); 627 + unw_set_caching_policy(maps->addr_space, UNW_CACHE_GLOBAL); 628 628 return 0; 629 629 } 630 630 631 - static void _unwind__flush_access(struct maps *mg) 631 + static void _unwind__flush_access(struct maps *maps) 632 632 { 633 - unw_flush_cache(mg->addr_space, 0, 0); 633 + unw_flush_cache(maps->addr_space, 0, 0); 634 634 } 635 635 636 - static void _unwind__finish_access(struct maps *mg) 636 + static void _unwind__finish_access(struct maps *maps) 637 637 { 638 - unw_destroy_addr_space(mg->addr_space); 638 + unw_destroy_addr_space(maps->addr_space); 639 639 } 640 640 641 641 static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb,
+15 -15
tools/perf/util/unwind-libunwind.c
··· 12 12 struct unwind_libunwind_ops __weak *x86_32_unwind_libunwind_ops; 13 13 struct unwind_libunwind_ops __weak *arm64_unwind_libunwind_ops; 14 14 15 - static void unwind__register_ops(struct maps *mg, struct unwind_libunwind_ops *ops) 15 + static void unwind__register_ops(struct maps *maps, struct unwind_libunwind_ops *ops) 16 16 { 17 - mg->unwind_libunwind_ops = ops; 17 + maps->unwind_libunwind_ops = ops; 18 18 } 19 19 20 - int unwind__prepare_access(struct maps *mg, struct map *map, bool *initialized) 20 + int unwind__prepare_access(struct maps *maps, struct map *map, bool *initialized) 21 21 { 22 22 const char *arch; 23 23 enum dso_type dso_type; ··· 27 27 if (!dwarf_callchain_users) 28 28 return 0; 29 29 30 - if (mg->addr_space) { 30 + if (maps->addr_space) { 31 31 pr_debug("unwind: thread map already set, dso=%s\n", 32 32 map->dso->name); 33 33 if (initialized) ··· 36 36 } 37 37 38 38 /* env->arch is NULL for live-mode (i.e. perf top) */ 39 - if (!mg->machine->env || !mg->machine->env->arch) 39 + if (!maps->machine->env || !maps->machine->env->arch) 40 40 goto out_register; 41 41 42 - dso_type = dso__type(map->dso, mg->machine); 42 + dso_type = dso__type(map->dso, maps->machine); 43 43 if (dso_type == DSO__TYPE_UNKNOWN) 44 44 return 0; 45 45 46 - arch = perf_env__arch(mg->machine->env); 46 + arch = perf_env__arch(maps->machine->env); 47 47 48 48 if (!strcmp(arch, "x86")) { 49 49 if (dso_type != DSO__TYPE_64BIT) ··· 58 58 return 0; 59 59 } 60 60 out_register: 61 - unwind__register_ops(mg, ops); 61 + unwind__register_ops(maps, ops); 62 62 63 - err = mg->unwind_libunwind_ops->prepare_access(mg); 63 + err = maps->unwind_libunwind_ops->prepare_access(maps); 64 64 if (initialized) 65 65 *initialized = err ? false : true; 66 66 return err; 67 67 } 68 68 69 - void unwind__flush_access(struct maps *mg) 69 + void unwind__flush_access(struct maps *maps) 70 70 { 71 - if (mg->unwind_libunwind_ops) 72 - mg->unwind_libunwind_ops->flush_access(mg); 71 + if (maps->unwind_libunwind_ops) 72 + maps->unwind_libunwind_ops->flush_access(maps); 73 73 } 74 74 75 - void unwind__finish_access(struct maps *mg) 75 + void unwind__finish_access(struct maps *maps) 76 76 { 77 - if (mg->unwind_libunwind_ops) 78 - mg->unwind_libunwind_ops->finish_access(mg); 77 + if (maps->unwind_libunwind_ops) 78 + maps->unwind_libunwind_ops->finish_access(maps); 79 79 } 80 80 81 81 int unwind__get_entries(unwind_entry_cb_t cb, void *arg,