Commit graph

45 commits

Author SHA1 Message Date
Gunnar Beutner
eed6ce8b8b Profiler: Fix scrolling behavior
When resizing the timeline view the timelines should scroll to the
bottom when the resize operation reveals space that is beyond the
view.
2021-05-08 09:55:24 +02:00
Gunnar Beutner
210d2d270d Profiler: Let the user select more than one process 2021-05-08 09:53:53 +02:00
Carlos César Neves Enumo
325d9445fd Profiler: Migrate mouse events to TimelineView
This change allows for continuous mouse events when hovering the
layout spaces between tracks.
2021-05-08 09:53:06 +02:00
Carlos César Neves Enumo
99f141522a Profiler: Fix timeline wrong initial horizontal position
Just after launching the app, when hovering the timeline, it would
start at Time: 2000ms. It fixes itself after scrolling.
2021-05-08 09:53:06 +02:00
Gunnar Beutner
b25eba10d2 Profiler: Make the timeline resizable
This just moves the timeline and the tab widget into
a horizontal splitter to make them resizable.
2021-05-08 00:30:38 +01:00
Brian Gianforcaro
e3ee539fea Profiler: Don't iterate all events when filtering timeline view
There is no need to iterate through all events in a profile when
loading the timeline view, as soon as we see one event we can
move on to the next process.
2021-05-07 15:35:23 +02:00
Gunnar Beutner
43b3fd748a Profiler: Make processes selectable in the timeline view 2021-05-07 15:26:51 +02:00
Gunnar Beutner
7b9cabb5a3 Profiler: Remove the old process selection widget 2021-05-07 15:26:51 +02:00
Gunnar Beutner
2d6091be10 Profiler: Move filter checks into their own function 2021-05-07 15:26:51 +02:00
Andreas Kling
fb6d236ba2 Profiler: Add fixed track headers to the timeline view
The architecture here is a little bit convoluted. I ended up making a
new container widget (TimelineContainer) that works similarly to
GUI::ScrollableContainerWidget but has two subwidgets (a fixed header
that only scrolls vertically, and the timeline view that scrolls on
both axes.)

It would be nice to generalize this mechanism eventually and move it
back into LibGUI, but for now let's go with a special widget for
Profiler so we can continue iterating on the GUI. :^)
2021-05-06 22:18:45 +02:00
Andreas Kling
59da118f2e Profiler: Add a statusbar and show the timeline selection info in it :^) 2021-05-06 22:18:45 +02:00
Andreas Kling
814200f8da Profiler: Rename ProfileTimelineWidget => TimelineTrack 2021-05-06 22:18:45 +02:00
Andreas Kling
abc3ad01b2 Profiler: Add TimelineView widget and make the timeline cursor global
There's no longer a cursor in each process timeline, instead the parent
widget keeps track of it (along with the selection) and it all moves
in sync.
2021-05-06 22:18:45 +02:00
Andreas Kling
84c4c2d884 Profiler: Tweak timeline widget appearance
Use a thinner frame, and ColorRole::Base for the background.
2021-05-06 22:18:45 +02:00
Andreas Kling
9273054b2b Profiler: Show one timeline per process :^)
Instead of smashing together all the samples into a single timeline,
make one per process and put them all in a ScrollableContainerWidget.

This makes it much easier to see which processes were active and when.
No timeline is displayed for processes with zero samples in the profile.
2021-05-06 22:18:45 +02:00
Andreas Kling
dbbc6096a9 Profiler: Move everything into the "Profiler" namespace 2021-05-04 20:59:32 +02:00
Andreas Kling
19bef3877a Profiler: Don't link against LibCoreDump 2021-05-04 14:38:43 +02:00
Brian Gianforcaro
cc94495a29 Profiler: Print addresses in debug log in hex. 2021-05-04 10:57:55 +02:00
Andreas Kling
4b0098e52f Everywhere: Rename app_menu to file_menu or game_menu 2021-05-01 17:40:54 +02:00
Andreas Kling
3d4afe7614 Everywhere: "indexes" => "indices"
I've wasted a silly amount of time in the past fretting over which
of these words to use. Let's just choose one and use it everywhere. :^)
2021-04-29 22:23:52 +02:00
Gunnar Beutner
ba9a285d56 Profiler: Use NonnullOwnPtr for libraries 2021-04-26 17:13:55 +02:00
Gunnar Beutner
eb798d5538 Kernel+Profiler: Improve profiling subsystem
This turns the perfcore format into more a log than it was before,
which lets us properly log process, thread and region
creation/destruction. This also makes it unnecessary to dump the
process' regions every time it is scheduled like we did before.

Incidentally this also fixes 'profile -c' because we previously ended
up incorrectly dumping the parent's region map into the profile data.

Log-based mmap support enables profiling shared libraries which
are loaded at runtime, e.g. via dlopen().

This enables profiling both the parent and child process for
programs which use execve(). Previously we'd discard the profiling
data for the old process.

The Profiler tool has been updated to not treat thread IDs as
process IDs anymore. This enables support for processes with more
than one thread. Also, there's a new widget to filter which
process should be displayed.
2021-04-26 17:13:55 +02:00
Andreas Kling
b91c49364d AK: Rename adopt() to adopt_ref()
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
2021-04-23 16:46:57 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Nicholas-Baron
73dd293ec4 Everywhere: Add -Wdouble-promotion warning
This warning informs of float-to-double conversions. The best solution
seems to be to do math *either* in 32-bit *or* in 64-bit, and only to
cross over when absolutely necessary.
2021-04-16 19:01:54 +02:00
Andreas Kling
a2baab38fd Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"
I hereby declare these to be full nouns that we don't split,
neither by space, nor by underscore:

- Breadcrumbbar
- Coolbar
- Menubar
- Progressbar
- Scrollbar
- Statusbar
- Taskbar
- Toolbar

This patch makes everything consistent by replacing every other variant
of these with the proper one. :^)
2021-04-13 16:58:15 +02:00
Andreas Kling
3bca395190 Profiler: Alt shortcuts and book title capitalization in menus 2021-04-10 15:55:34 +02:00
Andreas Kling
ff52a0f90b Profiler: Don't change window title based on last enabled option
This behavior was bizarre and only highlighted whichever setting
was the last one to be activated.
2021-04-10 15:54:12 +02:00
Andreas Kling
78b12e1521 Userland: Turn all application menus into window menus :^) 2021-03-25 22:14:09 +01:00
Andreas Kling
e0f32626bc LibGfx: Rename 32-bit BitmapFormats to BGRA8888 and BGRx888x
The previous names (RGBA32 and RGB32) were misleading since that's not
the actual byte order in memory. The new names reflect exactly how the
color values get laid out in bitmap data.
2021-03-16 11:50:03 +01:00
Linus Groh
50ea0c3500 Profiler: Get perfcore file from ArgsParser
Fixes #5641.
2021-03-05 09:52:22 +01:00
Andreas Kling
1208fc7d37 AK: Simplify Bitmap and implement in terms of BitmapView
Add Bitmap::view() and forward most of the calls to BitmapView since
the code was identical.

Bitmap is now primarily concerned with its dynamically allocated
backing store and BitmapView deals with the rest.
2021-03-04 11:25:45 +01:00
Andreas Kling
373a595c56 Profiler: Symbolicate addresses in non-PIE ELF objects
This is a little bit messy, but basically if an ELF object is non-PIE,
we have to account for the executable mapping being at a hard-coded
offset and subtract that when doing symbolication.

There's probably a nicer way to solve this, I just hacked this together
so we can see "cc1plus" and friends in profiles. :^)
2021-03-03 23:13:26 +01:00
Andreas Kling
0fc3983c8d Profiler: Cache and reuse mapped ELF objects
In multi-process profiles, the same ELF objects tend to occur many
times (everyone has libc.so for example) so we will quickly run out
of VM if we map each object once per process that uses it.

Fix this by adding a "mapped object cache" that maps the path of
an ELF object to a cached memory mapping and wrapping ELF::Image.
2021-03-03 22:57:45 +01:00
Andreas Kling
5e7abea31e Kernel+Profiler: Capture metadata about all profiled processes
The perfcore file format was previously limited to a single process
since the pid/executable/regions data was top-level in the JSON.

This patch moves the process-specific data into a top-level array
named "processes" and we now add entries for each process that has
been sampled during the profile run.

This makes it possible to see samples from multiple threads when
viewing a perfcore file with Profiler. This is extremely cool! :^)
2021-03-02 22:38:06 +01:00
Brian Gianforcaro
007b6edce4 Profiler: Print addresses as pointers in new Samples view
The previous formatting was missing the "0x" prefix.
2021-03-01 11:12:53 +01:00
thislooksfun
225baa3cb7 Profiler: remove unimplemented Profile::LibraryMetadata::symbolicate() definition
The implementation of Profile::LibraryMetadata::symbolicate() was
removed in 340180ba05, but the
corresponding public declaration was not.
2021-02-28 15:28:08 +01:00
Andreas Kling
1fb1279cfd Profiler: Add a new "Samples" view to the main UI
You can now view the individual samples in a profile one by one with
the new "Samples" view. The "old" main view moves into a "Call Tree"
tab (but it remains the default view.)

When you select a sample in the samples view, we show you the full
symbolicated backtrace in a separate view on the right hand side. :^)
2021-02-27 18:34:21 +01:00
Andreas Kling
340180ba05 Profiler: Move ELF object name to its own profile graph column
This way you don't have to look at all the library names if you don't
want to. Since we're pretty good about namespacing our things, the
library names are slightly redundant information.
2021-02-27 17:45:41 +01:00
Andreas Kling
2f0ea9ae33 Profiler: Unbreak DisassemblyModel after shared library introduction
This was failing to take the library base address into account when
tallying up the samples at each instruction.
2021-02-27 17:26:57 +01:00
Brendan Coles
0ffc06b795 Profiler: Add help documentation 2021-02-24 20:40:00 +01:00
Sahan Fernando
bf68939bcc Profiler: Make sure rendered timestamps don't overflow
If you drag-select a slice of the profile off of the side of the
Profiler window, the profiler will try to render a negative start time,
which will overflow. This commit fixes that bug by clamping timestamps
to the start/end of the profile before rendering.
2021-02-24 12:19:01 +01:00
Andreas Kling
5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00
Sahan Fernando
7e9122950e Profiler: Display timing information in ProfileTimelineWidget
Currently, there is no way to know when in a profile's duration a
sample was taken. This commit adds a basic timestamp to the timeline
widget, and a black bar to show where the cursor is hovering over.
2021-02-06 08:55:34 +01:00
Andreas Kling
4055b03291 DevTools: Move to Userland/DevTools/ 2021-01-12 12:18:55 +01:00