memprof_mibmap.h 737 B

123456789101112131415161718192021222324252627
  1. #ifndef MEMPROF_MIBMAP_H_
  2. #define MEMPROF_MIBMAP_H_
  3. #include <stdint.h>
  4. #include "profile/MemProfData.inc"
  5. #include "sanitizer_common/sanitizer_addrhashmap.h"
  6. #include "sanitizer_common/sanitizer_mutex.h"
  7. namespace __memprof {
  8. struct LockedMemInfoBlock {
  9. __sanitizer::StaticSpinMutex mutex;
  10. ::llvm::memprof::MemInfoBlock mib;
  11. };
  12. // The MIB map stores a mapping from stack ids to MemInfoBlocks.
  13. typedef __sanitizer::AddrHashMap<LockedMemInfoBlock *, 200003> MIBMapTy;
  14. // Insert a new MemInfoBlock or merge with an existing block identified by the
  15. // stack id.
  16. void InsertOrMerge(const uptr Id, const ::llvm::memprof::MemInfoBlock &Block,
  17. MIBMapTy &Map);
  18. } // namespace __memprof
  19. #endif // MEMPROF_MIBMAP_H_