1cfca06d7SDimitry Andric //===-- ProcessPOSIXLog.cpp -----------------------------------------------===//
2f034231aSEd Maste //
35f29bb8aSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
45f29bb8aSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
55f29bb8aSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6f034231aSEd Maste //
7f034231aSEd Maste //===----------------------------------------------------------------------===//
8f034231aSEd Maste
9f034231aSEd Maste #include "ProcessPOSIXLog.h"
10f034231aSEd Maste
1174a628f7SDimitry Andric #include "llvm/Support/Threading.h"
125e95aa85SEd Maste
13f034231aSEd Maste using namespace lldb_private;
14f034231aSEd Maste
1574a628f7SDimitry Andric static constexpr Log::Category g_categories[] = {
166f8fc217SDimitry Andric {{"break"}, {"log breakpoints"}, POSIXLog::Breakpoints},
176f8fc217SDimitry Andric {{"memory"}, {"log memory reads and writes"}, POSIXLog::Memory},
186f8fc217SDimitry Andric {{"process"}, {"log process events and activities"}, POSIXLog::Process},
196f8fc217SDimitry Andric {{"ptrace"}, {"log all calls to ptrace"}, POSIXLog::Ptrace},
206f8fc217SDimitry Andric {{"registers"}, {"log register read/writes"}, POSIXLog::Registers},
216f8fc217SDimitry Andric {{"thread"}, {"log thread events and activities"}, POSIXLog::Thread},
226f8fc217SDimitry Andric {{"watch"}, {"log watchpoint related activities"}, POSIXLog::Watchpoints},
2374a628f7SDimitry Andric };
24f034231aSEd Maste
256f8fc217SDimitry Andric static Log::Channel g_channel(g_categories, POSIXLog::Process);
266f8fc217SDimitry Andric
LogChannelFor()276f8fc217SDimitry Andric template <> Log::Channel &lldb_private::LogChannelFor<POSIXLog>() {
286f8fc217SDimitry Andric return g_channel;
296f8fc217SDimitry Andric }
305e95aa85SEd Maste
Initialize()3174a628f7SDimitry Andric void ProcessPOSIXLog::Initialize() {
3274a628f7SDimitry Andric static llvm::once_flag g_once_flag;
3374a628f7SDimitry Andric llvm::call_once(g_once_flag, []() { Log::Register("posix", g_channel); });
345e95aa85SEd Maste }
35