summaryrefslogtreecommitdiff
path: root/src/vm/eventpipeprotocolhelper.h
blob: 883252116515e3c584dafd40de2dda07e2ad5fa6 (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
// 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 __EVENTPIPE_PROTOCOL_HELPER_H__
#define __EVENTPIPE_PROTOCOL_HELPER_H__

#ifdef FEATURE_PERFTRACING

#include "common.h"
#include "eventpipe.h"

class IpcStream;

class EventPipeProtocolHelper
{
public:
    // IPC event handlers.
    static void StopTracing(IpcStream *pStream);
    static void CollectTracing(IpcStream *pStream); // `dotnet-trace collect`

private:
    const static uint32_t DefaultCircularBufferMB = 1024; // 1 GB
    const static uint32_t DefaultProfilerSamplingRateInNanoseconds = 1000000; // 1 msec.
    const static uint32_t IpcStreamReadBufferSize = 8192;

    static bool TryParseProviderConfiguration(uint8_t *&bufferCursor, uint32_t &bufferLen, CQuickArray<EventPipeProviderConfiguration> &result);
};

#endif // FEATURE_PERFTRACING

#endif // __EVENTPIPE_PROTOCOL_HELPER_H__