mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +00:00
Profiler: Add some helpful debug output if a process is missing
I've had a couple of instances where a profile was missing process creation events for a PID. I don't know how to reproduce it yet, so this patch merely adds a helpful debug message so you know why Profiler is failing to load the file.
This commit is contained in:
parent
cefb321da4
commit
863ac3af97
1 changed files with 7 additions and 3 deletions
|
@ -62,12 +62,16 @@ void Profile::rebuild_tree()
|
||||||
Vector<NonnullRefPtr<ProfileNode>> roots;
|
Vector<NonnullRefPtr<ProfileNode>> roots;
|
||||||
|
|
||||||
auto find_or_create_process_node = [this, &roots](pid_t pid, u64 timestamp) -> ProfileNode& {
|
auto find_or_create_process_node = [this, &roots](pid_t pid, u64 timestamp) -> ProfileNode& {
|
||||||
auto& process = *find_process(pid, timestamp);
|
auto* process = find_process(pid, timestamp);
|
||||||
|
if (!process) {
|
||||||
|
dbgln("Profile contains event for unknown process with pid={}, timestamp={}", pid, timestamp);
|
||||||
|
VERIFY_NOT_REACHED();
|
||||||
|
}
|
||||||
for (auto root : roots) {
|
for (auto root : roots) {
|
||||||
if (&root->process() == &process)
|
if (&root->process() == process)
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
auto new_root = ProfileNode::create_process_node(process);
|
auto new_root = ProfileNode::create_process_node(*process);
|
||||||
roots.append(new_root);
|
roots.append(new_root);
|
||||||
return new_root;
|
return new_root;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue