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