MCPcopy Create free account
hub / github.com/beefytech/Beef / prof_dump_open_maps_impl

Function prof_dump_open_maps_impl

BeefRT/JEMalloc/src/prof_sys.c:449–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447#endif
448
449static int
450prof_dump_open_maps_impl() {
451 int mfd;
452
453 cassert(config_prof);
454#if defined(__FreeBSD__) || defined(__DragonFly__)
455 mfd = prof_open_maps_internal("/proc/curproc/map");
456#elif defined(_WIN32)
457 mfd = -1; // Not implemented
458#else
459 int pid = prof_getpid();
460
461 mfd = prof_open_maps_internal("/proc/%d/task/%d/maps", pid, pid);
462 if (mfd == -1) {
463 mfd = prof_open_maps_internal("/proc/%d/maps", pid);
464 }
465#endif
466 return mfd;
467}
468prof_dump_open_maps_t *JET_MUTABLE prof_dump_open_maps =
469 prof_dump_open_maps_impl;
470

Callers

nothing calls this directly

Calls 2

prof_open_maps_internalFunction · 0.85
prof_getpidFunction · 0.85

Tested by

no test coverage detected