Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: components/metrics/call_stack_profile_metrics_provider_unittest.cc

Issue 1319973011: Stack sampling profiler uses uintptr_t instead of void*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@UMA2_refactor
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/profiler/stack_sampling_profiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/call_stack_profile_metrics_provider_unittest.cc
diff --git a/components/metrics/call_stack_profile_metrics_provider_unittest.cc b/components/metrics/call_stack_profile_metrics_provider_unittest.cc
index a974b2d39770b1a4a98a2c4d08ad2b14e8599ded..d5b5ac2b44a72745981c823c7a06c193477ac61a 100644
--- a/components/metrics/call_stack_profile_metrics_provider_unittest.cc
+++ b/components/metrics/call_stack_profile_metrics_provider_unittest.cc
@@ -66,7 +66,7 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) {
const Module profile_modules[][2] = {
{
Module(
- reinterpret_cast<const void*>(module1_base_address),
+ (module1_base_address),
"ABCD",
#if defined(OS_WIN)
base::FilePath(L"c:\\some\\path\\to\\chrome.exe")
@@ -75,7 +75,7 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) {
#endif
),
Module(
- reinterpret_cast<const void*>(module2_base_address),
+ (module2_base_address),
"EFGH",
#if defined(OS_WIN)
base::FilePath(L"c:\\some\\path\\to\\third_party.dll")
@@ -86,7 +86,7 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) {
},
{
Module(
- reinterpret_cast<const void*>(module3_base_address),
+ (module3_base_address),
"MNOP",
#if defined(OS_WIN)
base::FilePath(L"c:\\some\\path\\to\\third_party2.dll")
@@ -95,7 +95,7 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) {
#endif
),
Module( // Repeated from the first profile.
- reinterpret_cast<const void*>(module1_base_address),
+ (module1_base_address),
"ABCD",
#if defined(OS_WIN)
base::FilePath(L"c:\\some\\path\\to\\chrome.exe")
@@ -148,26 +148,26 @@ TEST_F(CallStackProfileMetricsProviderTest, MultipleProfiles) {
const Frame profile_sample_frames[][2][3] = {
{
{
- Frame(reinterpret_cast<const void*>(module1_base_address + 0x10), 0),
- Frame(reinterpret_cast<const void*>(module2_base_address + 0x20), 1),
- Frame(reinterpret_cast<const void*>(module1_base_address + 0x30), 0)
+ Frame((module1_base_address + 0x10), 0),
+ Frame((module2_base_address + 0x20), 1),
+ Frame((module1_base_address + 0x30), 0)
},
{
- Frame(reinterpret_cast<const void*>(module2_base_address + 0x10), 1),
- Frame(reinterpret_cast<const void*>(module1_base_address + 0x20), 0),
- Frame(reinterpret_cast<const void*>(module2_base_address + 0x30), 1)
+ Frame((module2_base_address + 0x10), 1),
+ Frame((module1_base_address + 0x20), 0),
+ Frame((module2_base_address + 0x30), 1)
}
},
{
{
- Frame(reinterpret_cast<const void*>(module3_base_address + 0x10), 0),
- Frame(reinterpret_cast<const void*>(module1_base_address + 0x20), 1),
- Frame(reinterpret_cast<const void*>(module3_base_address + 0x30), 0)
+ Frame((module3_base_address + 0x10), 0),
+ Frame((module1_base_address + 0x20), 1),
+ Frame((module3_base_address + 0x30), 0)
},
{
- Frame(reinterpret_cast<const void*>(module1_base_address + 0x10), 1),
- Frame(reinterpret_cast<const void*>(module3_base_address + 0x20), 0),
- Frame(reinterpret_cast<const void*>(module1_base_address + 0x30), 1)
+ Frame((module1_base_address + 0x10), 1),
+ Frame((module3_base_address + 0x20), 0),
+ Frame((module1_base_address + 0x30), 1)
}
}
};
@@ -276,7 +276,7 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksUnordered) {
const Module modules[] = {
Module(
- reinterpret_cast<const void*>(module_base_address),
+ (module_base_address),
"ABCD",
#if defined(OS_WIN)
base::FilePath(L"c:\\some\\path\\to\\chrome.exe")
@@ -288,10 +288,10 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksUnordered) {
// Duplicate samples in slots 0, 2, and 3.
const Frame sample_frames[][1] = {
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0), },
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x20), 0), },
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0), },
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0) }
+ { Frame((module_base_address + 0x10), 0), },
+ { Frame((module_base_address + 0x20), 0), },
+ { Frame((module_base_address + 0x10), 0), },
+ { Frame((module_base_address + 0x10), 0) }
};
Profile profile;
@@ -354,7 +354,7 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksOrdered) {
const Module modules[] = {
Module(
- reinterpret_cast<const void*>(module_base_address),
+ (module_base_address),
"ABCD",
#if defined(OS_WIN)
base::FilePath(L"c:\\some\\path\\to\\chrome.exe")
@@ -366,10 +366,10 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksOrdered) {
// Duplicate samples in slots 0, 2, and 3.
const Frame sample_frames[][1] = {
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0), },
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x20), 0), },
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0), },
- { Frame(reinterpret_cast<const void*>(module_base_address + 0x10), 0) }
+ { Frame((module_base_address + 0x10), 0), },
+ { Frame((module_base_address + 0x20), 0), },
+ { Frame((module_base_address + 0x10), 0), },
+ { Frame((module_base_address + 0x10), 0) }
};
Profile profile;
@@ -427,7 +427,7 @@ TEST_F(CallStackProfileMetricsProviderTest, RepeatedStacksOrdered) {
// Checks that unknown modules produce an empty Entry.
TEST_F(CallStackProfileMetricsProviderTest, UnknownModule) {
- const Frame frame(reinterpret_cast<const void*>(0x1000),
+ const Frame frame((0x1000),
Frame::kUnknownModuleIndex);
Profile profile;
@@ -468,7 +468,7 @@ TEST_F(CallStackProfileMetricsProviderTest, ProfilesProvidedOnlyOnce) {
for (int i = 0; i < 2; ++i) {
Profile profile;
profile.samples.push_back(Sample(1, Frame(
- reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex)));
+ (0x1000), Frame::kUnknownModuleIndex)));
profile.profile_duration = base::TimeDelta::FromMilliseconds(100);
// Use the sampling period to distinguish the two profiles.
@@ -496,7 +496,7 @@ TEST_F(CallStackProfileMetricsProviderTest,
ProfilesProvidedWhenCollectedBeforeInstantiation) {
Profile profile;
profile.samples.push_back(Sample(1, Frame(
- reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex)));
+ (0x1000), Frame::kUnknownModuleIndex)));
profile.profile_duration = base::TimeDelta::FromMilliseconds(100);
profile.sampling_period = base::TimeDelta::FromMilliseconds(10);
@@ -517,7 +517,7 @@ TEST_F(CallStackProfileMetricsProviderTest,
TEST_F(CallStackProfileMetricsProviderTest, ProfilesNotProvidedWhileDisabled) {
Profile profile;
profile.samples.push_back(Sample(1, Frame(
- reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex)));
+ (0x1000), Frame::kUnknownModuleIndex)));
profile.profile_duration = base::TimeDelta::FromMilliseconds(100);
profile.sampling_period = base::TimeDelta::FromMilliseconds(10);
@@ -538,7 +538,7 @@ TEST_F(CallStackProfileMetricsProviderTest,
ProfilesNotProvidedAfterChangeToDisabled) {
Profile profile;
profile.samples.push_back(Sample(1, Frame(
- reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex)));
+ (0x1000), Frame::kUnknownModuleIndex)));
profile.profile_duration = base::TimeDelta::FromMilliseconds(100);
profile.sampling_period = base::TimeDelta::FromMilliseconds(10);
@@ -563,7 +563,7 @@ TEST_F(CallStackProfileMetricsProviderTest,
ProfilesNotProvidedAfterChangeToDisabledThenEnabled) {
Profile profile;
profile.samples.push_back(Sample(1, Frame(
- reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex)));
+ (0x1000), Frame::kUnknownModuleIndex)));
profile.profile_duration = base::TimeDelta::FromMilliseconds(100);
profile.sampling_period = base::TimeDelta::FromMilliseconds(10);
@@ -589,7 +589,7 @@ TEST_F(CallStackProfileMetricsProviderTest,
ProfilesNotProvidedAfterChangeFromDisabled) {
Profile profile;
profile.samples.push_back(Sample(1, Frame(
- reinterpret_cast<const void*>(0x1000), Frame::kUnknownModuleIndex)));
+ (0x1000), Frame::kUnknownModuleIndex)));
profile.profile_duration = base::TimeDelta::FromMilliseconds(100);
profile.sampling_period = base::TimeDelta::FromMilliseconds(10);
« no previous file with comments | « base/profiler/stack_sampling_profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698