MCPcopy Create free account
hub / github.com/apple/foundationdb / debugFileSetup

Function debugFileSetup

fdbrpc/TraceFileIO.cpp:34–46  ·  view source on GitHub ↗

Setup memory data structures for file debugging. TO RUN: setup debugFileRegions map with the regions of the file you wish to track. Keys of the map are offsets in the file, and values are the lengths of the region

Source from the content-addressed store, hash-verified

32// TO RUN: setup debugFileRegions map with the regions of the file you wish to track. Keys of the map are offsets in
33// the file, and values are the lengths of the region
34void debugFileSetup() {
35 debugFileRegions[0] = 1e8;
36 for (auto itr = debugFileRegions.begin(); itr != debugFileRegions.end(); ++itr) {
37 debugFileData[itr->first] = (uint8_t*)malloc(itr->second);
38 memset(debugFileData[itr->first], 0, itr->second);
39
40 debugFileMask[itr->first] = (uint8_t*)malloc(itr->second);
41 memset(debugFileMask[itr->first], 0, itr->second);
42 }
43
44 debugFileSetPage = (uint8_t*)malloc(4096);
45 memset(debugFileSetPage, 1, 4096);
46}
47
48// Trim a file path to the file name
49std::string debugFileTrim(std::string filename) {

Callers 3

debugFileCheckFunction · 0.85
debugFileSetFunction · 0.85
debugFileTruncateFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected