summaryrefslogtreecommitdiff
path: root/src/vm/eventpipesessionprovider.h
blob: 7b500e4412d2354da203e724610dc39979b50c20 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef __EVENTPIPE_SESSION_PROVIDER_SESSION_H__
#define __EVENTPIPE_SESSION_PROVIDER_SESSION_H__

#ifdef FEATURE_PERFTRACING

enum class EventPipeEventLevel;
class EventPipeProvider;

class EventPipeSessionProvider
{
public:
    EventPipeSessionProvider(
        LPCWSTR providerName,
        UINT64 keywords,
        EventPipeEventLevel loggingLevel,
        LPCWSTR filterData);
    ~EventPipeSessionProvider();

    LPCWSTR GetProviderName() const
    {
        return m_pProviderName;
    }

    UINT64 GetKeywords() const
    {
        return m_keywords;
    }

    EventPipeEventLevel GetLevel() const
    {
        return m_loggingLevel;
    }

    LPCWSTR GetFilterData() const
    {
        return m_pFilterData;
    }

private:
    WCHAR *m_pProviderName;
    UINT64 m_keywords;
    EventPipeEventLevel m_loggingLevel;
    WCHAR *m_pFilterData;
};

class EventPipeSessionProviderList
{
public:

    // Create a new list based on the input.
    EventPipeSessionProviderList(
        const EventPipeProviderConfiguration *pConfigs,
        uint32_t numConfigs);
    ~EventPipeSessionProviderList();

    // Add a new session provider to the list.
    void AddSessionProvider(EventPipeSessionProvider *pProvider);

    // Get the session provider for the specified provider.
    // Return NULL if one doesn't exist.
    EventPipeSessionProvider* GetSessionProvider(EventPipeProvider *pProvider);

    // Returns true if the list is empty.
    bool IsEmpty() const;

    EventPipeSessionProviderList() = delete;
    EventPipeSessionProviderList(const EventPipeSessionProviderList &other) = delete;
    EventPipeSessionProviderList(EventPipeSessionProviderList &&other) = delete;
    EventPipeSessionProviderList &operator=(const EventPipeSessionProviderList &rhs) = delete;
    EventPipeSessionProviderList &&operator=(EventPipeSessionProviderList &&rhs) = delete;

private:
    SList<SListElem<EventPipeSessionProvider*>> *m_pProviders = nullptr;

    // A catch-all provider used when tracing is enabled for all events.
    EventPipeSessionProvider *m_pCatchAllProvider = nullptr;
};

#endif // FEATURE_PERFTRACING

#endif // __EVENTPIPE_SESSION_PROVIDER_SESSION_H__