summaryrefslogtreecommitdiff
path: root/src/vm/diagnosticserver.h
blob: 76ad3eff230404bb9e206b4714f18c34821e5c2a (plain)
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
// 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 <stdint.h>
#include "diagnosticsipc.h"

//! TODO: Temp class.
enum class DiagnosticMessageType : uint32_t
{
    ///////////////////////////////////////////////////////////////////////////
    // Debug = 0

    ///////////////////////////////////////////////////////////////////////////
    // EventPipe
    EnableEventPipe = 1024,
    DisableEventPipe,
    StreamEventPipe,
    AttachEventPipe,
    DetachEventPipe,

    ///////////////////////////////////////////////////////////////////////////
    // Profiler = 2048
};

//! TODO: Temp class.
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();

private:
    static IpcStream::DiagnosticsIpc *s_pIpc;
};

#endif // FEATURE_PERFTRACING

#endif // __DIAGNOSTIC_SERVER_H__