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

Unified Diff: components/browser_watcher/dump_postmortem_minidump_main_win.cc

Issue 2521193003: Postmortem dumper: add support for Activity (Closed)
Patch Set: Clang compile Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_watcher/dump_postmortem_minidump_main_win.cc
diff --git a/components/browser_watcher/dump_postmortem_minidump_main_win.cc b/components/browser_watcher/dump_postmortem_minidump_main_win.cc
index 1b9aabe4d99ff50d14cfe76c05920a225eb880fc..34c5fe8aaf6b6e6a423568282c0f3545d1b334cb 100644
--- a/components/browser_watcher/dump_postmortem_minidump_main_win.cc
+++ b/components/browser_watcher/dump_postmortem_minidump_main_win.cc
@@ -33,12 +33,58 @@ bool ParseCommandLine(const base::CommandLine* cmd,
return true;
}
+void Indent(FILE* out, size_t indent_level) {
+ DCHECK(out);
+ for (size_t i = 0; i < indent_level; ++i)
+ fprintf(out, " ");
+}
+
+void PrintActivity(FILE* out,
+ size_t indent_level,
+ const browser_watcher::Activity& activity) {
+ DCHECK(out);
+ Indent(out, indent_level);
+ fprintf(out, "Activity\n");
+ Indent(out, indent_level + 1);
+ fprintf(out, "type: %d\n", activity.type());
+ Indent(out, indent_level + 1);
+ fprintf(out, "time: %lld\n", activity.time());
+ switch (activity.type()) {
+ case browser_watcher::Activity::NONE:
+ break;
+ case browser_watcher::Activity::ACT_TASK_RUN:
+ Indent(out, indent_level + 1);
+ fprintf(out, "origin_address: %llx\n", activity.origin_address());
+ fprintf(out, "task_sequence_id: %lld\n", activity.task_sequence_id());
+ break;
+ case browser_watcher::Activity::ACT_LOCK_ACQUIRE:
+ Indent(out, indent_level + 1);
+ fprintf(out, "lock_address: %llx\n", activity.lock_address());
+ break;
+ case browser_watcher::Activity::ACT_EVENT_WAIT:
+ Indent(out, indent_level + 1);
+ fprintf(out, "event_address: %llx\n", activity.event_address());
+ break;
+ case browser_watcher::Activity::ACT_THREAD_JOIN:
+ Indent(out, indent_level + 1);
+ fprintf(out, "thread_id: %lld\n", activity.thread_id());
+ break;
+ case browser_watcher::Activity::ACT_PROCESS_WAIT:
+ Indent(out, indent_level + 1);
+ fprintf(out, "process_id: %lld\n", activity.process_id());
+ break;
+ }
+}
+
void PrintProcessState(FILE* out,
const browser_watcher::ProcessState& process) {
- fprintf(out, "%s", "Process:\n");
- for (int i = 0; i < process.threads_size(); ++i) {
- const browser_watcher::ThreadState thread = process.threads(i);
- fprintf(out, "%s\n", thread.thread_name().c_str());
+ fprintf(out, "Process %lld (%d threads)\n", process.process_id(),
+ process.threads_size());
+ for (const browser_watcher::ThreadState& thread : process.threads()) {
+ fprintf(out, "Thread %lld (%s) : %d activities\n", thread.thread_id(),
+ thread.thread_name().c_str(), thread.activity_count());
+ for (const browser_watcher::Activity& activity : thread.activities())
+ PrintActivity(out, 1, activity);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698