1314564Sdim//===-- ProcessPOSIXLog.cpp ---------------------------------------*- C++
2314564Sdim//-*-===//
3254721Semaste//
4353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5353358Sdim// See https://llvm.org/LICENSE.txt for license information.
6353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7254721Semaste//
8254721Semaste//===----------------------------------------------------------------------===//
9254721Semaste
10254721Semaste#include "ProcessPOSIXLog.h"
11254721Semaste
12321369Sdim#include "llvm/Support/Threading.h"
13288943Sdim
14254721Semasteusing namespace lldb_private;
15254721Semaste
16321369Sdimstatic constexpr Log::Category g_categories[] = {
17321369Sdim  {{"break"}, {"log breakpoints"}, POSIX_LOG_BREAKPOINTS},
18321369Sdim  {{"memory"}, {"log memory reads and writes"}, POSIX_LOG_MEMORY},
19321369Sdim  {{"process"}, {"log process events and activities"}, POSIX_LOG_PROCESS},
20321369Sdim  {{"ptrace"}, {"log all calls to ptrace"}, POSIX_LOG_PTRACE},
21321369Sdim  {{"registers"}, {"log register read/writes"}, POSIX_LOG_REGISTERS},
22321369Sdim  {{"thread"}, {"log thread events and activities"}, POSIX_LOG_THREAD},
23321369Sdim  {{"watch"}, {"log watchpoint related activities"}, POSIX_LOG_WATCHPOINTS},
24321369Sdim};
25254721Semaste
26321369SdimLog::Channel ProcessPOSIXLog::g_channel(g_categories, POSIX_LOG_DEFAULT);
27254721Semaste
28321369Sdimvoid ProcessPOSIXLog::Initialize() {
29321369Sdim  static llvm::once_flag g_once_flag;
30321369Sdim  llvm::call_once(g_once_flag, []() { Log::Register("posix", g_channel); });
31288943Sdim}
32