/kernel/linux/linux-6.6/tools/perf/util/ |
H A D | sideband_evlist.c | 6 #include "util/mmap.h" 8 #include <perf/mmap.h> 59 struct mmap *map = &evlist->mmap[i]; in perf_evlist__poll_thread()
|
/third_party/ltp/testcases/kernel/mem/mmapstress/ |
H A D | mmapstress03.c | 27 * it into two segments (i.e. |---brk---|-mmap-|--more brk--|). Next it 35 * for a huge mmap which is refused. 143 /* Ask for a ridiculously large mmap region at a high address */ in main() 144 if (mmap((void*) (((uintptr_t)1) << ((sizeof(void*)<<3) - 1)) - pagesize, in main() 149 ERROR("really large mmap didn't fail"); in main() 153 ERROR("really large mmap didn't set errno = ENOMEM nor EINVAL"); in main() 167 if (mmap((void*) ((long)brk_max - 3 * pagesize), (2 * pagesize), in do_test() 171 ERROR("mmap failed"); in do_test() 174 /* extend mmap */ in do_test() 175 if (mmap((voi in do_test() [all...] |
H A D | mmapstress05.c | 26 * original mmap. It then mmaps the preceding portion of the file behind 27 * the original mmap. None of the mmaps can be concatenated. 179 if (mmap(mmapaddr + pagesize, pagesize, PROT_READ, in main() 183 CERROR("first mmap (of third page) failed"); in main() 186 if (mmap(mmapaddr, pagesize, PROT_READ, in main() 190 CERROR("second mmap (of fifth page) failed"); in main() 193 if (mmap(mmapaddr + 2 * pagesize, pagesize, PROT_READ, in main() 195 CERROR("third mmap (of first page) failed"); in main()
|
/third_party/ltp/testcases/kernel/mem/hugetlb/hugemmap/ |
H A D | hugemmap02.c | 60 addr = mmap(0, 256 * 1024 * 1024, PROT_READ, in test_hugemmap() 71 /* mmap using normal pages and a low memory address */ in test_hugemmap() 72 addr = mmap((void *)low_addr, page_sz, PROT_READ, in test_hugemmap() 75 tst_brk(TBROK | TERRNO, "mmap failed on nfildes"); in test_hugemmap() 83 /* Attempt to mmap a huge page into a low memory address */ in test_hugemmap() 84 addr2 = mmap((void *)low_addr2, map_sz, PROT_READ | PROT_WRITE, in test_hugemmap() 88 tst_res(TFAIL | TERRNO, "huge mmap failed unexpectedly" in test_hugemmap() 91 tst_res(TPASS, "huge mmap succeeded (64-bit)"); in test_hugemmap() 95 tst_res(TFAIL | TERRNO, "huge mmap failed unexpectedly" in test_hugemmap() 99 "huge mmap faile in test_hugemmap() [all...] |
H A D | hugemmap14.c | 46 p = mmap((void *)lowaddr, hpage_size, PROT_READ|PROT_WRITE, in run_test() 55 "mmap() failed expected"); in run_test() 58 tst_res(TFAIL|TERRNO, "mmap() huge failed unexpected"); in run_test() 70 q = mmap((void *)highaddr, page_size, PROT_READ|PROT_WRITE, in run_test() 78 "mmap() failed expected"); in run_test() 81 tst_res(TFAIL|TERRNO, "mmap() normal 1 failed unexpected"); in run_test() 98 r = mmap((void *)highaddr, page_size, PROT_READ|PROT_WRITE, in run_test() 106 "mmap() failed unexpected"); in run_test() 109 tst_res(TFAIL|TERRNO, "mmap() normal 2 failed unexpected"); in run_test()
|
/third_party/ltp/testcases/kernel/mem/vma/ |
H A D | vma01.c | 96 t = mmap(p, 3 * ps, PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); in check_vma() 98 tst_brkm(TBROK | TERRNO, cleanup, "mmap"); in check_vma() 106 u = mmap(t + 3 * ps, 3 * ps, PROT_WRITE, in check_vma() 109 perror("mmap"); in check_vma() 153 t = mmap(NULL, 9 * ps, PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); in create_bighole() 155 tst_brkm(TBROK | TERRNO, cleanup, "mmap"); in create_bighole()
|
/kernel/linux/linux-5.10/tools/lib/perf/ |
H A D | evlist.c | 11 #include <internal/mmap.h> 361 * Each PERF_EVENT_IOC_SET_OUTPUT points to this mmap and in perf_evlist__alloc_mmap() 384 maps = overwrite ? evlist->mmap_ovw : evlist->mmap; in perf_evlist__mmap_cb_get() 394 evlist->mmap = maps; in perf_evlist__mmap_cb_get() 471 if (ops->mmap(map, mp, *output, evlist_cpu) < 0) in mmap_per_evsel() 575 if (!ops || !ops->get || !ops->mmap) in perf_evlist__mmap_ops() 603 .mmap = perf_evlist__mmap_cb_mmap, in perf_evlist__mmap() 615 if (evlist->mmap) { in perf_evlist__munmap() 617 perf_mmap__munmap(&evlist->mmap[i]); in perf_evlist__munmap() 625 zfree(&evlist->mmap); in perf_evlist__munmap() [all...] |
/kernel/linux/linux-6.6/tools/lib/perf/ |
H A D | evlist.c | 11 #include <internal/mmap.h> 391 * Each PERF_EVENT_IOC_SET_OUTPUT points to this mmap and in perf_evlist__alloc_mmap() 414 maps = overwrite ? evlist->mmap_ovw : evlist->mmap; in perf_evlist__mmap_cb_get() 424 evlist->mmap = maps; in perf_evlist__mmap_cb_get() 507 if (ops->mmap(map, mp, *output, evlist_cpu) < 0) in mmap_per_evsel() 639 if (!ops || !ops->get || !ops->mmap) in perf_evlist__mmap_ops() 667 .mmap = perf_evlist__mmap_cb_mmap, in perf_evlist__mmap() 679 if (evlist->mmap) { in perf_evlist__munmap() 681 perf_mmap__munmap(&evlist->mmap[i]); in perf_evlist__munmap() 689 zfree(&evlist->mmap); in perf_evlist__munmap() [all...] |
/third_party/musl/libc-test/src/functionalext/relro/ |
H A D | dlopen_ext_relro_test.c | 418 void *map = mmap(NULL, map_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in dlopen_ext_relro_1600() 455 void *map = mmap(NULL, map_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in dlopen_ext_relro_1700() 492 void *map = mmap(NULL, map_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in dlopen_ext_relro_1800() 529 void *map = mmap(NULL, map_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in dlopen_ext_relro_1900() 564 void *map = mmap(NULL, map_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in dlopen_ext_relro_2000() 601 void *map = mmap(NULL, map_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in dlopen_ext_relro_2100() 639 void *map = mmap(NULL, map_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in dlopen_ext_relro_2200() 678 void *map = mmap(NULL, map_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in dlopen_ext_relro_2300() 716 void *map = mmap(NULL, map_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); in dlopen_ext_relro_2400()
|
/kernel/linux/linux-5.10/tools/perf/tests/ |
H A D | perf-record.c | 9 #include <perf/mmap.h> 15 #include "util/mmap.h" 97 * on all the fds) and then mmap them. in test__PERF_RECORD() 144 * mmap the first fd on a given CPU and ask for events for the other in test__PERF_RECORD() 145 * fds in the same CPU to be injected in the same mmap ring buffer in test__PERF_RECORD() 171 struct mmap *md; in test__PERF_RECORD() 173 md = &evlist->mmap[i]; in test__PERF_RECORD() 252 mmap_filename = event->mmap.filename; in test__PERF_RECORD()
|
/kernel/linux/linux-6.6/drivers/accel/habanalabs/common/ |
H A D | memory_mgr.c | 193 * hl_mmap_mem_buf_vm_close - handle mmap close 195 * @vma: the vma object for which mmap was closed. 212 atomic_set(&buf->mmap, 0); in hl_mmap_mem_buf_vm_close() 225 * @vma: the vma object for which mmap was closed. 226 * @args: additional args passed to behavior->mmap 239 * it before doing the mmap itself 248 "Memory mmap failed, no match to handle %#llx\n", handle); 256 "%s: Memory mmap failed, mmap VM size 0x%llx != 0x%llx allocated physical mem size\n", 276 if (atomic_cmpxchg(&buf->mmap, [all...] |
/kernel/linux/linux-6.6/tools/perf/tests/ |
H A D | perf-record.c | 7 #include <perf/mmap.h> 14 #include "util/mmap.h" 97 * on all the fds) and then mmap them. in test__PERF_RECORD() 144 * mmap the first fd on a given CPU and ask for events for the other in test__PERF_RECORD() 145 * fds in the same CPU to be injected in the same mmap ring buffer in test__PERF_RECORD() 171 struct mmap *md; in test__PERF_RECORD() 173 md = &evlist->mmap[i]; in test__PERF_RECORD() 252 mmap_filename = event->mmap.filename; in test__PERF_RECORD()
|
H A D | perf-time-to-tsc.c | 12 #include <perf/mmap.h> 21 #include "mmap.h" 90 struct mmap *md; in test__perf_time_to_tsc() 126 pc = evlist->mmap[0].core.base; in test__perf_time_to_tsc() 149 md = &evlist->mmap[i]; in test__perf_time_to_tsc()
|
/third_party/ltp/testcases/kernel/controllers/cpuset/cpuset_memory_test/ |
H A D | cpuset_memory_test.c | 73 {"mmap-anon", 0, NULL, MMAP_ANON}, 74 {"mmap-file", 0, NULL, MMAP_FILE}, 75 {"mmap-lock1", 0, NULL, MMAP_LOCK1}, 76 {"mmap-lock2", 0, NULL, MMAP_LOCK2}, 161 p = mmap(NULL, memsize, PROT_WRITE | PROT_READ, in mmap_anon() 164 err(1, "mmap(anonymous) failed"); in mmap_anon() 190 p = mmap(NULL, memsize, PROT_WRITE | PROT_READ, in mmap_file() 195 err(1, "mmap(file) failed"); in mmap_file() 214 p = mmap(NULL, memsize, PROT_WRITE | PROT_READ, in mmap_lock1() 217 err(1, "mmap(loc in mmap_lock1() [all...] |
/third_party/ltp/testcases/kernel/controllers/memcg/functional/ |
H A D | memcg_process.c | 49 {"mmap-anon", 0, NULL, MMAP_ANON}, 50 {"mmap-file", 0, NULL, MMAP_FILE}, 51 {"mmap-lock1", 0, NULL, MMAP_LOCK1}, 52 {"mmap-lock2", 0, NULL, MMAP_LOCK2}, 120 p = mmap(NULL, memsize, PROT_WRITE | PROT_READ, in mmap_anon() 123 err(1, "mmap(anonymous) failed"); in mmap_anon() 147 p = mmap(NULL, memsize, PROT_WRITE | PROT_READ, in mmap_file() 152 err(1, "mmap(file) failed"); in mmap_file() 171 p = mmap(NULL, memsize, PROT_WRITE | PROT_READ, in mmap_lock1() 174 err(1, "mmap(loc in mmap_lock1() [all...] |
/kernel/linux/linux-5.10/tools/perf/util/ |
H A D | synthetic-events.c | 448 event->mmap2.len -= event->mmap.start; in perf_event__synthesize_mmap_events() 600 union perf_event *event = zalloc((sizeof(event->mmap) + in perf_event__synthesize_modules() 603 pr_debug("Not enough memory synthesizing mmap event " in perf_event__synthesize_modules() 626 event->mmap.header.type = PERF_RECORD_MMAP; in perf_event__synthesize_modules() 627 event->mmap.header.size = (sizeof(event->mmap) - in perf_event__synthesize_modules() 628 (sizeof(event->mmap.filename) - size)); in perf_event__synthesize_modules() 629 memset(event->mmap.filename + size, 0, machine->id_hdr_size); in perf_event__synthesize_modules() 630 event->mmap.header.size += machine->id_hdr_size; in perf_event__synthesize_modules() 631 event->mmap in perf_event__synthesize_modules() [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/mincore/ |
H A D | mincore_selftest.c | 51 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST() 54 TH_LOG("mmap error: %s", strerror(errno)); in TEST() 95 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST() 98 TH_LOG("mmap error: %s", strerror(errno)); in TEST() 150 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST() 157 TH_LOG("mmap error: %s", strerror(errno)); in TEST() 232 addr = mmap(NULL, FILE_SIZE, PROT_READ | PROT_WRITE, in TEST() 235 TH_LOG("mmap error: %s", strerror(errno)); in TEST() 331 addr = mmap(NULL, FILE_SIZE, PROT_READ | PROT_WRITE, in TEST() 334 TH_LOG("mmap erro in TEST() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/mincore/ |
H A D | mincore_selftest.c | 50 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST() 53 TH_LOG("mmap error: %s", strerror(errno)); in TEST() 94 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST() 97 TH_LOG("mmap error: %s", strerror(errno)); in TEST() 149 addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, in TEST() 156 TH_LOG("mmap error: %s", strerror(errno)); in TEST() 231 addr = mmap(NULL, FILE_SIZE, PROT_READ | PROT_WRITE, in TEST() 234 TH_LOG("mmap error: %s", strerror(errno)); in TEST() 330 addr = mmap(NULL, FILE_SIZE, PROT_READ | PROT_WRITE, in TEST() 333 TH_LOG("mmap erro in TEST() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/sgx/ |
H A D | load.c | 63 bin = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0); in encl_map_bin() 65 perror("enclave executable mmap()"); in encl_map_bin() 204 ptr = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, 0); in encl_load() 206 perror("mmap for read"); in encl_load() 212 "mmap() succeeded for PROT_READ, but failed for PROT_EXEC.\n" \ in encl_load() 217 ptr = mmap(NULL, PAGE_SIZE, PROT_EXEC, MAP_SHARED, fd, 0); in encl_load() 295 seg->src = mmap(NULL, heap_size, PROT_READ | PROT_WRITE, in encl_load() 323 area = mmap(NULL, encl_size * 2, PROT_NONE, in encl_map_area() 326 perror("reservation mmap()"); in encl_map_area()
|
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/prog_tests/ |
H A D | ringbuf.c | 107 mmap_ptr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, rb_fd, 0); in ringbuf_subtest() 116 mmap_ptr = mmap(NULL, page_size, PROT_WRITE, MAP_SHARED, rb_fd, page_size); in ringbuf_subtest() 122 mmap_ptr = mmap(NULL, page_size, PROT_WRITE, MAP_SHARED, rb_fd, 2 * page_size); in ringbuf_subtest() 126 mmap_ptr = mmap(NULL, page_size, PROT_WRITE, MAP_SHARED, rb_fd, 3 * page_size); in ringbuf_subtest() 128 mmap_ptr = mmap(NULL, 2 * page_size, PROT_WRITE, MAP_SHARED, rb_fd, 2 * page_size); in ringbuf_subtest() 132 mmap_ptr = mmap(NULL, 4 * page_size, PROT_READ, MAP_SHARED, rb_fd, 0); in ringbuf_subtest() 142 mmap_ptr = mmap(NULL, page_size, PROT_READ, MAP_SHARED, rb_fd, page_size); in ringbuf_subtest()
|
/third_party/python/Lib/multiprocessing/ |
H A D | shared_memory.py | 12 import mmap namespace 115 self._mmap = mmap.mmap(self._fd, size) 130 # until it can be attached to by mmap. 151 self._mmap = mmap.mmap(-1, size, tagname=temp_name) 160 # block's size which is likely a multiple of mmap.PAGESIZE. 180 self._mmap = mmap.mmap(-1, size, tagname=name)
|
/third_party/elfutils/tests/ |
H A D | run-copyadd-sections.sh | 24 out_file_mmap="${out_file}.mmap" 44 testrun ${abs_builddir}/elfcopy --mmap ${in_file} ${out_file_mmap} 50 testrun ${abs_builddir}/addsections --mmap 1 ${out_file_mmap}
|
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/mmap/ |
H A D | 9-1.c | 10 * mmap() may return MAP_FAILED and set errno to [EINVAL]. 18 * 2. Call mmap() and get EINVAL; 66 pa = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in main() 79 pa = mmap(illegal_addr, size, PROT_READ | PROT_WRITE, MAP_FIXED, fd, 0); in main() 91 printf("Test FAILED, mmap with MAP_FIXED did not get EINVAL" in main()
|
H A D | 7-2.c | 19 * 1. mmap a file into memory. Set flag as MAP_PRIVATE. 22 * 4. mmap the same file again into memory. 65 pa = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); in main() 67 printf("Error at mmap(): %s\n", strerror(errno)); in main() 82 pa = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); in main() 84 printf("Error at 2nd mmap(): %s\n", strerror(errno)); in main()
|
/third_party/ltp/testcases/open_posix_testsuite/conformance/interfaces/shm_open/ |
H A D | 1-1.c | 51 buf = mmap(NULL, BUF_SIZE, PROT_WRITE, MAP_SHARED, fd, 0); in main() 53 perror("An error occurs when calling mmap()"); in main() 67 buf = mmap(NULL, BUF_SIZE, PROT_READ, MAP_SHARED, fd, 0); in main() 69 perror("An error occurs when calling mmap()"); in main()
|