1 //===-- ProcessPOSIXLog.cpp -----------------------------------------------===//
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 #include "ProcessPOSIXLog.h"
11 #include "llvm/Support/Threading.h"
13 using namespace lldb_private
;
15 static constexpr Log::Category g_categories
[] = {
16 {{"break"}, {"log breakpoints"}, POSIXLog::Breakpoints
},
17 {{"memory"}, {"log memory reads and writes"}, POSIXLog::Memory
},
18 {{"process"}, {"log process events and activities"}, POSIXLog::Process
},
19 {{"ptrace"}, {"log all calls to ptrace"}, POSIXLog::Ptrace
},
20 {{"registers"}, {"log register read/writes"}, POSIXLog::Registers
},
21 {{"thread"}, {"log thread events and activities"}, POSIXLog::Thread
},
22 {{"watch"}, {"log watchpoint related activities"}, POSIXLog::Watchpoints
},
25 static Log::Channel
g_channel(g_categories
, POSIXLog::Process
);
27 template <> Log::Channel
&lldb_private::LogChannelFor
<POSIXLog
>() {
31 void ProcessPOSIXLog::Initialize() {
32 static llvm::once_flag g_once_flag
;
33 llvm::call_once(g_once_flag
, []() { Log::Register("posix", g_channel
); });