summaryrefslogtreecommitdiff
path: root/Userland/DevTools/Profiler
AgeCommit message (Collapse)Author
2021-07-08Everywhere: Add break after the last case label before `default`Daniel Bertalan
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.
2021-07-08Everywhere: Forward declare structs as structsDaniel Bertalan
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.
2021-07-02AK: Implement String::find_any_of() and StringView::find_any_of()Max Wipfli
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.
2021-06-30AK+Everywhere: Add and use static APIs for LexicalPathMax Wipfli
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.
2021-06-27Profiler: Cache the timeline histograms instead of recomputing on paintAndreas Kling
There was an aggressive amount of work happening on every paint. :^)
2021-06-24Profiler: Use u32 when constructing InstructionDataGunnar Beutner
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.
2021-06-17Everywhere: Add component declarationsGunnar Beutner
This adds component declarations so that users can select to not build certain parts of the OS.
2021-06-04Profiler: Show the duration of the time interval chosenDhruvMaroo
2021-06-03Profiler: Remove m_deepest_stack_depthGunnar Beutner
This isn't used anymore so let's remove it entirely.
2021-06-03Profiler: Use sequential serial numbers for profiling eventsGunnar Beutner
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.
2021-06-02Profiler: Fix loading profiles which previously would crash the profilerGunnar Beutner
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.
2021-05-28Profiler: Use a more reasonable default event maskGunnar Beutner
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.
2021-05-27Profiler: Don't try to create a DisassemblyModel for invalid indicesAndreas Kling
This fixes a null dereference when toggling the "top functions" mode while a top-level process node was selected.
2021-05-26LibGUI/AbstractView: Remove `on_selection`Jelle Raaijmakers
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.
2021-05-25Profiler: Hide timeline scrollbars if we don't need them :^)Andreas Kling
2021-05-23LibCore: Make ProcessStatisticsReader return results in a VectorAndreas Kling
The HashMap API was overkill and made using this less ergonomic than it should be.
2021-05-22Profiler: Allow scaling the timeline with Ctrl+MouseWheel :^)Andreas Kling
2021-05-22Profiler: Allow scrolling through full range of profile timelineAndreas Kling
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().
2021-05-22Profiler: Add a "Show Disassembly" action (and hide it by default)Andreas Kling
2021-05-22Profiler: Add some helpful debug output if a process is missingAndreas Kling
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.
2021-05-22Profiler: Split the call tree into one subtree per processAndreas Kling
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.
2021-05-21DevTools: Remove redundant default destructor and forward declarationsLenny Maiorani
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.
2021-05-19Profiler: Remove ability to filter Kernel::Scheduler::yield() framesGunnar Beutner
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.
2021-05-19Kernel+LibC: Add support for filtering profiling eventsGunnar Beutner
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.
2021-05-14Profiler: Mark model columns as non-sortableAndreas Kling
This removes the ability to click on the column headers to resort. Resorting didn't do anything anyway.
2021-05-14Profiler: Avoid JsonArray copying during perfcore parsingAndreas Kling
Use JsonObject::get_ptr() to access array values without copying them.
2021-05-14Profiler: Avoid copies / String construction when parsing profile (#7096)Brian Gianforcaro
Use sv literal suffix to construct StringViews at compile time, and make sure to reference array items by const reference.
2021-05-14Kernel+Profiler: Track lost time between profiler timer ticksGunnar Beutner
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.
2021-05-14Profiler: Let the user ignore context switchesGunnar Beutner
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.
2021-05-14Profiler: Add histogram for sample countsGunnar Beutner
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.
2021-05-12LibCore+Everywhere: Move OpenMode out of IODeviceAli Mohammad Pur
...and make it an enum class so people don't omit "OpenMode".
2021-05-08Profiler: Fix scrolling behaviorGunnar Beutner
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-08Profiler: Let the user select more than one processGunnar Beutner
2021-05-08Profiler: Migrate mouse events to TimelineViewCarlos César Neves Enumo
This change allows for continuous mouse events when hovering the layout spaces between tracks.
2021-05-08Profiler: Fix timeline wrong initial horizontal positionCarlos César Neves Enumo
Just after launching the app, when hovering the timeline, it would start at Time: 2000ms. It fixes itself after scrolling.
2021-05-08Profiler: Make the timeline resizableGunnar Beutner
This just moves the timeline and the tab widget into a horizontal splitter to make them resizable.
2021-05-07Profiler: Don't iterate all events when filtering timeline viewBrian Gianforcaro
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-07Profiler: Make processes selectable in the timeline viewGunnar Beutner
2021-05-07Profiler: Remove the old process selection widgetGunnar Beutner
2021-05-07Profiler: Move filter checks into their own functionGunnar Beutner
2021-05-06Profiler: Add fixed track headers to the timeline viewAndreas Kling
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-06Profiler: Add a statusbar and show the timeline selection info in it :^)Andreas Kling
2021-05-06Profiler: Rename ProfileTimelineWidget => TimelineTrackAndreas Kling
2021-05-06Profiler: Add TimelineView widget and make the timeline cursor globalAndreas Kling
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-06Profiler: Tweak timeline widget appearanceAndreas Kling
Use a thinner frame, and ColorRole::Base for the background.
2021-05-06Profiler: Show one timeline per process :^)Andreas Kling
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-04Profiler: Move everything into the "Profiler" namespaceAndreas Kling
2021-05-04Profiler: Don't link against LibCoreDumpAndreas Kling
2021-05-04Profiler: Print addresses in debug log in hex.Brian Gianforcaro
2021-05-01Everywhere: Rename app_menu to file_menu or game_menuAndreas Kling