1 //===-- ProcessPOSIXLog.cpp ---------------------------------------*- C++
4 // The LLVM Compiler Infrastructure
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #include "ProcessPOSIXLog.h"
13 #include "llvm/Support/Threading.h"
15 using namespace lldb_private;
17 static constexpr Log::Category g_categories[] = {
18 {{"break"}, {"log breakpoints"}, POSIX_LOG_BREAKPOINTS},
19 {{"memory"}, {"log memory reads and writes"}, POSIX_LOG_MEMORY},
20 {{"process"}, {"log process events and activities"}, POSIX_LOG_PROCESS},
21 {{"ptrace"}, {"log all calls to ptrace"}, POSIX_LOG_PTRACE},
22 {{"registers"}, {"log register read/writes"}, POSIX_LOG_REGISTERS},
23 {{"thread"}, {"log thread events and activities"}, POSIX_LOG_THREAD},
24 {{"watch"}, {"log watchpoint related activities"}, POSIX_LOG_WATCHPOINTS},
27 Log::Channel ProcessPOSIXLog::g_channel(g_categories, POSIX_LOG_DEFAULT);
29 void ProcessPOSIXLog::Initialize() {
30 static llvm::once_flag g_once_flag;
31 llvm::call_once(g_once_flag, []() { Log::Register("posix", g_channel); });