Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding instrumentation for AcrylicBrush.TintLuminosityOpacity propert… #149

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions dev/Materials/Acrylic/AcrylicBrush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ void AcrylicBrush::OnPropertyChanged(const winrt::DependencyPropertyChangedEvent
m_brush.StartAnimation(LuminosityColorColor, MakeColorAnimation(newLuminosityColor, TintTransitionDuration(), m_brush.Compositor()));
}
}

if (property == s_TintLuminosityOpacityProperty)
{
// Logging usage telemetry
__RP_Marker_ClassMemberById(RuntimeProfiler::ProfId_Acrylic, RuntimeProfiler::ProfMemberId_Acrylic_TintLuminosityOpacity_Changed);
}
}
else if (property == s_AlwaysUseFallbackProperty)
{
Expand Down
2 changes: 1 addition & 1 deletion dev/Telemetry/RuntimeProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ namespace RuntimeProfiler {

// Yes, we're declaring this as a global, the ctor/dtor are implemented
// very carefully and this will not create issues with DllMain().
DEFINE_PROFILEGROUP(gGroupClasses, PG_Class, ProfId_Size);
DEFINE_PROFILEGROUP(gGroupClasses, PG_Class, ProfId_Size + ProfMemberId_Size);

struct ProfileGroupInfo
{
Expand Down
17 changes: 17 additions & 0 deletions dev/Telemetry/RuntimeProfiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ namespace RuntimeProfiler
ProfId_Size
} ProfilerClassId;

// Ditto above...
typedef enum
{
ProfMemberId_Acrylic_TintLuminosityOpacity_Changed = 0,
ProfMemberId_Size
} ProfilerMemberId;

void FireEvent(bool Suspend) noexcept;
void RegisterMethod(ProfileGroup group, UINT16 TypeIndex, UINT16 MethodIndex, volatile LONG *Count) noexcept;
}
Expand All @@ -51,4 +58,14 @@ namespace RuntimeProfiler
} \
}

#define __RP_Marker_ClassMemberById(typeindex, memberindex) \
{ \
__pragma (warning ( suppress : 28112)) \
static volatile LONG __RuntimeProfiler_Counter = -1; \
if (0 == ::InterlockedIncrement(&__RuntimeProfiler_Counter)) \
{ \
RuntimeProfiler::RegisterMethod(RuntimeProfiler::PG_Class, (UINT16)typeindex, (UINT16)memberindex, &__RuntimeProfiler_Counter); \
} \
}