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

Side by Side Diff: chrome/browser/task_profiler/task_profiler_data_serializer.cc

Issue 2386123003: Add heap allocator usage to task profiler. (Closed)
Patch Set: Address Eric's comment. Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/task_profiler/task_profiler_data_serializer.h" 5 #include "chrome/browser/task_profiler/task_profiler_data_serializer.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // Re-serializes the |death_data| into |dictionary|. 57 // Re-serializes the |death_data| into |dictionary|.
58 void DeathDataSnapshotToValue(const DeathDataSnapshot& death_data, 58 void DeathDataSnapshotToValue(const DeathDataSnapshot& death_data,
59 base::DictionaryValue* dictionary) { 59 base::DictionaryValue* dictionary) {
60 dictionary->SetInteger("count", death_data.count); 60 dictionary->SetInteger("count", death_data.count);
61 dictionary->SetInteger("run_ms", death_data.run_duration_sum); 61 dictionary->SetInteger("run_ms", death_data.run_duration_sum);
62 dictionary->SetInteger("run_ms_max", death_data.run_duration_max); 62 dictionary->SetInteger("run_ms_max", death_data.run_duration_max);
63 dictionary->SetInteger("run_ms_sample", death_data.run_duration_sample); 63 dictionary->SetInteger("run_ms_sample", death_data.run_duration_sample);
64 dictionary->SetInteger("queue_ms", death_data.queue_duration_sum); 64 dictionary->SetInteger("queue_ms", death_data.queue_duration_sum);
65 dictionary->SetInteger("queue_ms_max", death_data.queue_duration_max); 65 dictionary->SetInteger("queue_ms_max", death_data.queue_duration_max);
66 dictionary->SetInteger("queue_ms_sample", death_data.queue_duration_sample); 66 dictionary->SetInteger("queue_ms_sample", death_data.queue_duration_sample);
67
68 dictionary->SetInteger("alloc_ops", death_data.alloc_ops);
69 dictionary->SetInteger("free_ops", death_data.free_ops);
70 dictionary->SetInteger("allocated_bytes", death_data.allocated_bytes);
71 dictionary->SetInteger("freed_bytes", death_data.freed_bytes);
72 dictionary->SetInteger("alloc_overhead_bytes",
73 death_data.alloc_overhead_bytes);
74 dictionary->SetInteger("max_allocated_bytes", death_data.max_allocated_bytes);
67 } 75 }
68 76
69 // Re-serializes the |snapshot| into |dictionary|. 77 // Re-serializes the |snapshot| into |dictionary|.
70 void TaskSnapshotToValue(const TaskSnapshot& snapshot, 78 void TaskSnapshotToValue(const TaskSnapshot& snapshot,
71 base::DictionaryValue* dictionary) { 79 base::DictionaryValue* dictionary) {
72 BirthOnThreadSnapshotToValue(snapshot.birth, "birth", dictionary); 80 BirthOnThreadSnapshotToValue(snapshot.birth, "birth", dictionary);
73 81
74 std::unique_ptr<base::DictionaryValue> death_data(new base::DictionaryValue); 82 std::unique_ptr<base::DictionaryValue> death_data(new base::DictionaryValue);
75 DeathDataSnapshotToValue(snapshot.death_data, death_data.get()); 83 DeathDataSnapshotToValue(snapshot.death_data, death_data.get());
76 dictionary->Set("death_data", death_data.release()); 84 dictionary->Set("death_data", death_data.release());
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 tasks_list->Append(std::move(snapshot)); 138 tasks_list->Append(std::move(snapshot));
131 } 139 }
132 dictionary->Set("list", tasks_list.release()); 140 dictionary->Set("list", tasks_list.release());
133 141
134 dictionary->SetInteger("process_id", process_id); 142 dictionary->SetInteger("process_id", process_id);
135 dictionary->SetString("process_type", content::GetProcessTypeNameInEnglish( 143 dictionary->SetString("process_type", content::GetProcessTypeNameInEnglish(
136 AsChromeProcessType(process_type))); 144 AsChromeProcessType(process_type)));
137 } 145 }
138 146
139 } // namespace task_profiler 147 } // namespace task_profiler
OLDNEW
« no previous file with comments | « chrome/browser/resources/profiler/profiler.js ('k') | chrome/browser/task_profiler/task_profiler_data_serializer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698