This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
Copy pathdiagnosticserver.h
55 lines (42 loc) · 1.58 KB
/
diagnosticserver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#ifndef __DIAGNOSTIC_SERVER_H__
#define __DIAGNOSTIC_SERVER_H__
#ifdef FEATURE_PERFTRACING // This macro should change to something more generic than performance.
#include "diagnosticsipc.h"
enum class DiagnosticMessageType : uint32_t
{
///////////////////////////////////////////////////////////////////////////
// Debug = 0
GenerateCoreDump = 1, // Initiates core dump generation
///////////////////////////////////////////////////////////////////////////
// EventPipe = 1024
StartEventPipeTracing = 1024, // To file
StopEventPipeTracing,
CollectEventPipeTracing, // To IPC
///////////////////////////////////////////////////////////////////////////
// Profiler = 2048
AttachProfiler = 2048,
};
struct MessageHeader
{
DiagnosticMessageType RequestType;
uint32_t Pid;
};
//! Defines an implementation of a IPC handler that dispatches messages to the runtime.
class DiagnosticServer final
{
public:
//! Initialize the event pipe (Creates the EventPipe IPC server).
static bool Initialize();
//! Shutdown the event pipe.
static bool Shutdown();
//! Diagnostics server thread.
static DWORD WINAPI DiagnosticsServerThread(LPVOID lpThreadParameter);
private:
static IpcStream::DiagnosticsIpc *s_pIpc;
static Volatile<bool> s_shuttingDown;
};
#endif // FEATURE_PERFTRACING
#endif // __DIAGNOSTIC_SERVER_H__