The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / src / gen / node_perfctr_provider.h @ 841b7f53

History | View | Annotate | Download (2.85 KB)

1
/* This file was auto-generated from src\res\node_perfctr_provider.man by ctrpp.exe */
2

    
3
#pragma once
4

    
5

    
6
EXTERN_C DECLSPEC_SELECTANY GUID NodeCounterProviderGuid = { 0x1e2e15d7, 0x3760, 0x470e, 0x86, 0x99, 0xb9, 0xdb, 0x52, 0x48, 0xed, 0xd5 };
7

    
8
EXTERN_C DECLSPEC_SELECTANY GUID NodeCounterSetGuid = { 0x3a22a8ec, 0x297c, 0x48ac, 0xab, 0x15, 0x33, 0xec, 0x93, 0x3, 0x3f, 0xd8 };
9

    
10

    
11
EXTERN_C DECLSPEC_SELECTANY HANDLE NodeCounterProvider = NULL;
12

    
13
EXTERN_C DECLSPEC_SELECTANY struct {
14
    PERF_COUNTERSET_INFO CounterSet;
15
    PERF_COUNTER_INFO Counter0;
16
    PERF_COUNTER_INFO Counter1;
17
    PERF_COUNTER_INFO Counter2;
18
    PERF_COUNTER_INFO Counter3;
19
    PERF_COUNTER_INFO Counter4;
20
    PERF_COUNTER_INFO Counter5;
21
    PERF_COUNTER_INFO Counter6;
22
    PERF_COUNTER_INFO Counter7;
23
    PERF_COUNTER_INFO Counter8;
24
    PERF_COUNTER_INFO Counter9;
25
} NodeCounterSetInfo = {
26
    { { 0x3a22a8ec, 0x297c, 0x48ac, 0xab, 0x15, 0x33, 0xec, 0x93, 0x3, 0x3f, 0xd8 }, { 0x1e2e15d7, 0x3760, 0x470e, 0x86, 0x99, 0xb9, 0xdb, 0x52, 0x48, 0xed, 0xd5 }, 10, PERF_COUNTERSET_MULTI_INSTANCES },
27
    { 1, PERF_COUNTER_COUNTER, 0, sizeof(ULONG), PERF_DETAIL_NOVICE, 0, 0 },
28
    { 2, PERF_COUNTER_COUNTER, 0, sizeof(ULONG), PERF_DETAIL_NOVICE, 0, 0 },
29
    { 3, PERF_COUNTER_COUNTER, 0, sizeof(ULONG), PERF_DETAIL_NOVICE, 0, 0 },
30
    { 4, PERF_COUNTER_COUNTER, 0, sizeof(ULONG), PERF_DETAIL_NOVICE, 0, 0 },
31
    { 5, PERF_COUNTER_RAWCOUNT, 0, sizeof(ULONG), PERF_DETAIL_NOVICE, 0, 0 },
32
    { 6, PERF_COUNTER_BULK_COUNT, 0, sizeof(ULONGLONG), PERF_DETAIL_NOVICE, 4294967293, 0 },
33
    { 7, PERF_COUNTER_BULK_COUNT, 0, sizeof(ULONGLONG), PERF_DETAIL_NOVICE, 4294967293, 0 },
34
    { 8, PERF_COUNTER_RAWCOUNT, 0, sizeof(ULONG), PERF_DETAIL_NOVICE, 0, 0 },
35
    { 9, PERF_COUNTER_BULK_COUNT, 0, sizeof(ULONGLONG), PERF_DETAIL_NOVICE, 4294967293, 0 },
36
    { 10, PERF_COUNTER_BULK_COUNT, 0, sizeof(ULONGLONG), PERF_DETAIL_NOVICE, 4294967293, 0 },
37
};
38

    
39
EXTERN_C FORCEINLINE
40
VOID
41
CounterCleanup(
42
    VOID
43
    )
44
{
45
    if (NodeCounterProvider != NULL) {
46
        PerfStopProvider(NodeCounterProvider);
47
        NodeCounterProvider = NULL;
48
    }
49
}
50

    
51
EXTERN_C FORCEINLINE
52
ULONG
53
CounterInitialize(
54
    VOID
55
    )
56
{
57
    ULONG Status;
58
    PERF_PROVIDER_CONTEXT ProviderContext;
59

    
60
    ZeroMemory(&ProviderContext, sizeof(PERF_PROVIDER_CONTEXT));
61
    ProviderContext.ContextSize = sizeof(PERF_PROVIDER_CONTEXT);
62

    
63
    Status = PerfStartProviderEx(&NodeCounterProviderGuid,
64
                                 &ProviderContext,
65
                                 &NodeCounterProvider);
66
    if (Status != ERROR_SUCCESS) {
67
        NodeCounterProvider = NULL;
68
        return Status;
69
    }
70

    
71
    Status = PerfSetCounterSetInfo(NodeCounterProvider,
72
                                   &NodeCounterSetInfo.CounterSet,
73
                                   sizeof NodeCounterSetInfo);
74
    if (Status != ERROR_SUCCESS) {
75
        CounterCleanup();
76
        return Status;
77
    }
78
    return ERROR_SUCCESS;
79
}