| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/trace_event/process_memory_maps_dump_provider.h" | 5 #include "base/trace_event/process_memory_maps_dump_provider.h" |
| 6 | 6 |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/trace_event/process_memory_dump.h" | 8 #include "base/trace_event/process_memory_dump.h" |
| 9 #include "base/trace_event/process_memory_maps.h" | 9 #include "base/trace_event/process_memory_maps.h" |
| 10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 namespace trace_event { | 14 namespace trace_event { |
| 15 | 15 |
| 16 #if defined(OS_LINUX) || defined(OS_ANDROID) | |
| 17 namespace { | 16 namespace { |
| 18 const char kTestSmaps1[] = | 17 const char kTestSmaps1[] = |
| 19 "00400000-004be000 r-xp 00000000 fc:01 1234 /file/1\n" | 18 "00400000-004be000 r-xp 00000000 fc:01 1234 /file/1\n" |
| 20 "Size: 760 kB\n" | 19 "Size: 760 kB\n" |
| 21 "Rss: 296 kB\n" | 20 "Rss: 296 kB\n" |
| 22 "Pss: 162 kB\n" | 21 "Pss: 162 kB\n" |
| 23 "Shared_Clean: 228 kB\n" | 22 "Shared_Clean: 228 kB\n" |
| 24 "Shared_Dirty: 0 kB\n" | 23 "Shared_Dirty: 0 kB\n" |
| 25 "Private_Clean: 0 kB\n" | 24 "Private_Clean: 0 kB\n" |
| 26 "Private_Dirty: 68 kB\n" | 25 "Private_Dirty: 68 kB\n" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 EXPECT_EQ(0x7fe7ce7a8000UL - 0x7fe7ce79c000UL, regions_2[0].size_in_bytes); | 176 EXPECT_EQ(0x7fe7ce7a8000UL - 0x7fe7ce79c000UL, regions_2[0].size_in_bytes); |
| 178 EXPECT_EQ(0U, regions_2[0].protection_flags); | 177 EXPECT_EQ(0U, regions_2[0].protection_flags); |
| 179 EXPECT_EQ("", regions_2[0].mapped_file); | 178 EXPECT_EQ("", regions_2[0].mapped_file); |
| 180 EXPECT_EQ(32 * 1024UL, regions_2[0].byte_stats_proportional_resident); | 179 EXPECT_EQ(32 * 1024UL, regions_2[0].byte_stats_proportional_resident); |
| 181 EXPECT_EQ(16 * 1024UL, regions_2[0].byte_stats_shared_clean_resident); | 180 EXPECT_EQ(16 * 1024UL, regions_2[0].byte_stats_shared_clean_resident); |
| 182 EXPECT_EQ(12 * 1024UL, regions_2[0].byte_stats_shared_dirty_resident); | 181 EXPECT_EQ(12 * 1024UL, regions_2[0].byte_stats_shared_dirty_resident); |
| 183 EXPECT_EQ(8 * 1024UL, regions_2[0].byte_stats_private_clean_resident); | 182 EXPECT_EQ(8 * 1024UL, regions_2[0].byte_stats_private_clean_resident); |
| 184 EXPECT_EQ(4 * 1024UL, regions_2[0].byte_stats_private_dirty_resident); | 183 EXPECT_EQ(4 * 1024UL, regions_2[0].byte_stats_private_dirty_resident); |
| 185 EXPECT_EQ(0 * 1024UL, regions_2[0].byte_stats_swapped); | 184 EXPECT_EQ(0 * 1024UL, regions_2[0].byte_stats_swapped); |
| 186 } | 185 } |
| 187 #endif // defined(OS_LINUX) || defined(OS_ANDROID) | |
| 188 | 186 |
| 189 } // namespace trace_event | 187 } // namespace trace_event |
| 190 } // namespace base | 188 } // namespace base |
| OLD | NEW |