MCPcopy Create free account
hub / github.com/F-Stack/f-stack / prof_dump_file

Function prof_dump_file

app/redis-6.2.6/deps/jemalloc/src/prof.c:1593–1632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1591}
1592
1593static bool
1594prof_dump_file(tsd_t *tsd, bool propagate_err, const char *filename,
1595 bool leakcheck, prof_tdata_t *tdata,
1596 struct prof_tdata_merge_iter_arg_s *prof_tdata_merge_iter_arg,
1597 struct prof_gctx_merge_iter_arg_s *prof_gctx_merge_iter_arg,
1598 struct prof_gctx_dump_iter_arg_s *prof_gctx_dump_iter_arg,
1599 prof_gctx_tree_t *gctxs) {
1600 /* Create dump file. */
1601 if ((prof_dump_fd = prof_dump_open(propagate_err, filename)) == -1) {
1602 return true;
1603 }
1604
1605 /* Dump profile header. */
1606 if (prof_dump_header(tsd_tsdn(tsd), propagate_err,
1607 &prof_tdata_merge_iter_arg->cnt_all)) {
1608 goto label_write_error;
1609 }
1610
1611 /* Dump per gctx profile stats. */
1612 prof_gctx_dump_iter_arg->tsdn = tsd_tsdn(tsd);
1613 prof_gctx_dump_iter_arg->propagate_err = propagate_err;
1614 if (gctx_tree_iter(gctxs, NULL, prof_gctx_dump_iter,
1615 (void *)prof_gctx_dump_iter_arg) != NULL) {
1616 goto label_write_error;
1617 }
1618
1619 /* Dump /proc/<pid>/maps if possible. */
1620 if (prof_dump_maps(propagate_err)) {
1621 goto label_write_error;
1622 }
1623
1624 if (prof_dump_close(propagate_err)) {
1625 return true;
1626 }
1627
1628 return false;
1629label_write_error:
1630 prof_dump_close(propagate_err);
1631 return true;
1632}
1633
1634static bool
1635prof_dump(tsd_t *tsd, bool propagate_err, const char *filename,

Callers 1

prof_dumpFunction · 0.85

Calls 3

tsd_tsdnFunction · 0.85
prof_dump_mapsFunction · 0.85
prof_dump_closeFunction · 0.85

Tested by

no test coverage detected