Age | Commit message (Collapse) | Author |
|
We already do this in most places, so the style should be consistent.
Also, Clang does not like it, as this could cause an unexpected compile
error if some statements are added to the default label or a new label
is added above it.
|
|
While structs being forward declared as classes is not strictly an
issue, Clang complains as this is not portable code, since some ABIs
treat classes declared as `class` and `struct` differently.
It's easier to fix these than to reason about explicitly disabling
another warning.
|
|
This implements StringUtils::find_any_of() and uses it in
String::find_any_of() and StringView::find_any_of(). All uses of
find_{first,last}_of have been replaced with find_any_of(), find() or
find_last(). find_{first,last}_of have subsequently been removed.
|
|
The LexicalPath instance methods dirname(), basename(), title() and
extension() will be changed to return StringView const& in a further
commit. Due to this, users creating temporary LexicalPath objects just
to call one of those getters will recieve a StringView const& pointing
to a possible freed buffer.
To avoid this, static methods for those APIs have been added, which will
return a String by value to avoid those problems. All cases where
temporary LexicalPath objects have been used as described above haven
been changed to use the static APIs.
|
|
There was an aggressive amount of work happening on every paint. :^)
|
|
When constructing values of the InstructionData type we assume that
the event_count field is a size_t while it actually is a u32. On x86_64
this fails because those are different types.
|
|
This adds component declarations so that users can select to not build
certain parts of the OS.
|
|
|
|
This isn't used anymore so let's remove it entirely.
|
|
Previously Profiler was using timestamps to distinguish processes.
However it is possible that separate processes with the same PID exist
at the exact same timestamp (e.g. for execve). This changes Profiler
to use unique serial numbers for each event instead.
|
|
The profiler tried to be clever when handling process_exit events by
subtracting one from the timestamp. This was supposed to ensure that
events after a process' death would be attributed to the new process
in case the old process used execve(). However, if there was another
event (e.g. a CPU sample) at the exact same time the process_exit
event was recorded the profile would fail to load because we
didn't find the process anymore.
This changes introduces a new problem where samples would be attributed
to the incorrect process if a CPU sample for the old process, a
process_exit as well as a process_create event plus another CPU sample
event for the new process happened at the exact same time. I think
it's a reasonable compromise though.
|
|
Previously Profiler (e.g. when started via the context menu in
SystemMonitor) would request logging _all_ event types. While this
might be useful at a later point in time the lack of event type
filtering in the profile viewer makes this less useful because
showing different event types in the same timeline shows an inaccurate
picture of what was really going on.
Some event types (like kmalloc) happen more frequently than others
(e.g. CPU samples) and while they don't carry the same weight they
would still dominate the samples graph.
This changes the Profiler app to just do CPU sampling for now.
|
|
This fixes a null dereference when toggling the "top functions" mode
while a top-level process node was selected.
|
|
Since the introduction of multi-select, we have had both `on_selection`
and `on_selection_change`, the latter of which was only invoked when a
change in selection came in through the model.
This removes `AbstractView::on_selection` and replaces it usage with
the more explicit `on_selection_change` everywhere.
|
|
|
|
The HashMap API was overkill and made using this less ergonomic than
it should be.
|
|
|
|
We were not taking the width of the process headers into account when
computing the scrollable content size of the timeline.
Fix this by passing the header width to AbstractScrollableWidget's
set_size_occupied_by_fixed_elements().
|
|
|
|
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 patch adds an additional level of hierarchy to the call tree:
Every process gets its own top-level node. :^)
Before this, selecting multiple processes would get quite confusing
as all the call stacks from different processes were combined together
into one big tree.
|
|
Problem:
- Default destructors (and constructors) are in `.cpp` files. This
prevents the compiler's optimizer from inlining them when it thinks
inlining is appropriate (unless LTO is used).
- Forward declarations can prevent some optimizations, such as
inlining of constructors and destructors.
Solution:
- Remove them or set them to `= default` and let the compiler handle
the generation of them.
- Remove unneeded forward declarations.
|
|
Hiding those frames doesn't really make sense. They're a major
contributor to a process' spent CPU time and show up in a lot of
profiles. That however is because those processes really do spend
quite a bit of time in the scheduler by doing lots of context
switches, like WindowServer when responding to IPC calls.
Instead of hiding these for aesthetic reasons we should instead
improve the scheduler.
|
|
This adds the -t command-line argument for the profile tool. Using this
argument you can filter which event types you want in your profile.
|
|
This removes the ability to click on the column headers to resort.
Resorting didn't do anything anyway.
|
|
Use JsonObject::get_ptr() to access array values without copying them.
|
|
Use sv literal suffix to construct StringViews at compile time,
and make sure to reference array items by const reference.
|
|
We can lose profiling timer events for a few reasons, for example
disabled interrupts or system slowness. This accounts for lost
time between CPU samples by adding a field lost_samples to each
profiling event which tracks how many samples were lost immediately
preceding the event.
|
|
Now that the profiling timer is independent from the scheduler the
user will get quite a few CPU samples from "within" the scheduler.
These events are less useful when just profiling a user-mode process
rather than the whole system. This patch adds an option to Profiler to
hide these events.
|
|
Previously Profiler would use the stack depth to draw the timeline
graphs. This is not an accurate representation of whether a thread
is "busy" or not. Instead this updates the timelines to use the
sample count.
|
|
...and make it an enum class so people don't omit "OpenMode".
|
|
When resizing the timeline view the timelines should scroll to the
bottom when the resize operation reveals space that is beyond the
view.
|
|
|
|
This change allows for continuous mouse events when hovering the
layout spaces between tracks.
|
|
Just after launching the app, when hovering the timeline, it would
start at Time: 2000ms. It fixes itself after scrolling.
|
|
This just moves the timeline and the tab widget into
a horizontal splitter to make them resizable.
|
|
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.
|
|
|
|
|
|
|
|
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. :^)
|
|
|
|
|
|
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.
|
|
Use a thinner frame, and ColorRole::Base for the background.
|
|
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.
|
|
|
|
|
|
|
|
|