Skip to content

Commit

Permalink
Add binary version to telemetry event (#2061)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankJWong authored Mar 4, 2020
1 parent f9db2fa commit 6b40323
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dev/Telemetry/RuntimeProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#define DEFINE_PROFILEGROUP(name, group, size) \
CMethodProfileGroup<size> name(group)

// defined in dllmain.cpp with values from version.h
extern const char *g_BinaryVersion;

namespace RuntimeProfiler {

void UninitializeRuntimeProfiler();
Expand Down Expand Up @@ -161,7 +164,8 @@ namespace RuntimeProfiler {
TraceLoggingWrite(
g_hTelemetryProvider,
"RuntimeProfiler",
TraceLoggingDescription("XAML methods that have been called."),
TraceLoggingDescription("XAML methods that have been called."),
TraceLoggingString(g_BinaryVersion, "BinaryVersion"),
TraceLoggingWideString(OutputBuffer, "ApiCounts"),
TraceLoggingUInt32(((UINT32)m_group), "ProfileGroupId"),
TraceLoggingUInt32(((UINT32)cMethods),"TotalCount"),
Expand Down
4 changes: 4 additions & 0 deletions dev/dll/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
#include "pch.h"
#include "common.h"
#include "TraceLogging.h"
#include "version.h"

HINSTANCE g_hInstance = nullptr;

// Version string to send on telemetry events, this is the version string that is used in the version resource
const char *g_BinaryVersion = (const char *)(VER_FILE_VERSION_STR);

STDAPI_(void) SendTelemetryOnSuspend();

STDAPI_(BOOL) DllMain(_In_ HINSTANCE hInstance, _In_ DWORD reason, _In_opt_ void *)
Expand Down

0 comments on commit 6b40323

Please sign in to comment.