Skip to content

Commit

Permalink
ProfileViewer: Interpret addresses >= 0xc0000000 as kernel frames
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Jan 2, 2020
1 parent 32ec1e5 commit efbdaaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion DevTools/ProfileViewer/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Profile::Profile(const JsonArray& json)
if (frames_array.size() < 2)
continue;

sample.in_kernel = frames_array.at(1).as_object().get("address").to_number<u32>() < (8 * MB);
u32 innermost_frame_address = frames_array.at(1).as_object().get("address").to_number<u32>();
sample.in_kernel = innermost_frame_address >= 0xc0000000 || innermost_frame_address < (8 * MB);

for (int i = frames_array.size() - 1; i >= 1; --i) {
auto& frame_value = frames_array.at(i);
Expand Down
2 changes: 1 addition & 1 deletion DevTools/ProfileViewer/ProfileModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ GVariant ProfileModel::data(const GModelIndex& index, Role role) const
auto* node = static_cast<ProfileNode*>(index.internal_data());
if (role == Role::Icon) {
if (index.column() == Column::StackFrame) {
if (node->address() < (8 * MB))
if (node->address() < (8 * MB) || node->address() >= 0xc0000000)
return m_kernel_frame_icon;
return m_user_frame_icon;
}
Expand Down

0 comments on commit efbdaaa

Please sign in to comment.