Path: blob/main/contrib/llvm-project/compiler-rt/lib/memprof/memprof_descriptions.h
35236 views
//===-- memprof_descriptions.h ---------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file is a part of MemProfiler, a memory profiler.9//10// MemProf-private header for memprof_descriptions.cpp.11//===----------------------------------------------------------------------===//12#ifndef MEMPROF_DESCRIPTIONS_H13#define MEMPROF_DESCRIPTIONS_H1415#include "memprof_allocator.h"16#include "memprof_thread.h"17#include "sanitizer_common/sanitizer_common.h"18#include "sanitizer_common/sanitizer_report_decorator.h"1920namespace __memprof {2122void DescribeThread(MemprofThreadContext *context);23inline void DescribeThread(MemprofThread *t) {24if (t)25DescribeThread(t->context());26}2728class MemprofThreadIdAndName {29public:30explicit MemprofThreadIdAndName(MemprofThreadContext *t);31explicit MemprofThreadIdAndName(u32 tid);3233// Contains "T%tid (%name)" or "T%tid" if the name is empty.34const char *c_str() const { return &name[0]; }3536private:37void Init(u32 tid, const char *tname);3839char name[128];40};4142} // namespace __memprof4344#endif // MEMPROF_DESCRIPTIONS_H454647