ProcessPOSIXLog.cpp revision 353358
11556Srgrimes//===-- ProcessPOSIXLog.cpp ---------------------------------------*- C++ 21556Srgrimes//-*-===// 31556Srgrimes// 41556Srgrimes// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 51556Srgrimes// See https://llvm.org/LICENSE.txt for license information. 61556Srgrimes// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 71556Srgrimes// 81556Srgrimes//===----------------------------------------------------------------------===// 91556Srgrimes 101556Srgrimes#include "ProcessPOSIXLog.h" 111556Srgrimes 121556Srgrimes#include "llvm/Support/Threading.h" 131556Srgrimes 141556Srgrimesusing namespace lldb_private; 151556Srgrimes 161556Srgrimesstatic constexpr Log::Category g_categories[] = { 171556Srgrimes {{"break"}, {"log breakpoints"}, POSIX_LOG_BREAKPOINTS}, 181556Srgrimes {{"memory"}, {"log memory reads and writes"}, POSIX_LOG_MEMORY}, 191556Srgrimes {{"process"}, {"log process events and activities"}, POSIX_LOG_PROCESS}, 201556Srgrimes {{"ptrace"}, {"log all calls to ptrace"}, POSIX_LOG_PTRACE}, 211556Srgrimes {{"registers"}, {"log register read/writes"}, POSIX_LOG_REGISTERS}, 221556Srgrimes {{"thread"}, {"log thread events and activities"}, POSIX_LOG_THREAD}, 231556Srgrimes {{"watch"}, {"log watchpoint related activities"}, POSIX_LOG_WATCHPOINTS}, 241556Srgrimes}; 251556Srgrimes 261556SrgrimesLog::Channel ProcessPOSIXLog::g_channel(g_categories, POSIX_LOG_DEFAULT); 271556Srgrimes 281556Srgrimesvoid ProcessPOSIXLog::Initialize() { 291556Srgrimes static llvm::once_flag g_once_flag; 301556Srgrimes llvm::call_once(g_once_flag, []() { Log::Register("posix", g_channel); }); 311556Srgrimes} 321556Srgrimes