1 //===-- memprof_descriptions.h ---------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file is a part of MemProfiler, a memory profiler.
11 // MemProf-private header for memprof_descriptions.cpp.
12 //===----------------------------------------------------------------------===//
13 #ifndef MEMPROF_DESCRIPTIONS_H
14 #define MEMPROF_DESCRIPTIONS_H
16 #include "memprof_allocator.h"
17 #include "memprof_thread.h"
18 #include "sanitizer_common/sanitizer_common.h"
19 #include "sanitizer_common/sanitizer_report_decorator.h"
23 void DescribeThread(MemprofThreadContext
*context
);
24 inline void DescribeThread(MemprofThread
*t
) {
26 DescribeThread(t
->context());
29 class MemprofThreadIdAndName
{
31 explicit MemprofThreadIdAndName(MemprofThreadContext
*t
);
32 explicit MemprofThreadIdAndName(u32 tid
);
34 // Contains "T%tid (%name)" or "T%tid" if the name is empty.
35 const char *c_str() const { return &name
[0]; }
38 void Init(u32 tid
, const char *tname
);
43 } // namespace __memprof
45 #endif // MEMPROF_DESCRIPTIONS_H