summaryrefslogtreecommitdiff
path: root/Userland/DevTools/Profiler/Profile.h
AgeCommit message (Collapse)Author
2022-02-14Profiler: Add ability to process read syscallsJakub Berkop
Profiler can now process and display read events.
2022-02-11AK: Make Bitmap construction OOM-fallibleIdan Horowitz
2021-12-28Profiler: Make everything east-const :^)Stephan Unverwerth
2021-12-28Profiler: Add source code viewStephan Unverwerth
This adds a new view mode to profiler which displays source lines and samples that occured at those lines. This view can be opened via the menu or by pressing CTRL-S. It does this by mapping file names from DWARF to "/usr/src/serenity/..." i.e. source code should be copied to /usr/src/serenity/Userland and /usr/src/serenity/Kernel to be visible in this mode. Currently *all* files contributing to the selected function are loaded completely which could be a lot of data when dealing with lots of inlined code.
2021-12-23Profiler: Always use FlyString const&'s in ProfileNode constructionHendiadyoin1
No need to copy and move them around, just to pass them as a `String const&` to the constructor. We still end up copying it to a normal String in the end though...
2021-12-23Profiler: Add some implied auto qualifiersHendiadyoin1
2021-11-23LibCore+AK: Move MappedFile from AK to LibCoreAndreas Kling
MappedFile is strictly a userspace thing, so it doesn't belong in AK (which is supposed to be user/kernel agnostic.)
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-11-08Profiler: Replace Result<T, E> use with ErrorOr<T>Andreas Kling
2021-10-31Profiler: Cache parsed DWARF debug information in disassembly viewDaniel Bertalan
This changes browsing through disassembled functions in Profiler from a painfully sluggish experience into quite a swift one. It's especially true for profiling the kernel, as it has more than 10 megabytes of DWARF data to churn through.
2021-10-31Profiler: Share the mapped kernel between Profile and DisassemblyModelDaniel Bertalan
There is no point in keeping around a separate MappedFile object for /boot/Kernel.debug for each DisassemblyModel we create and re-parsing the kernel image multiple times. This will significantly speed up browsing through profile entries from the kernel in disassembly view.
2021-08-14Profiler: Add a "Signposts" tab next to the "Samples" tabAndreas Kling
This tab provides a filtered listing of all the signpost events in the currently selected time range.
2021-08-14Profiler: Store signposts in the main event streamAndreas Kling
Instead of keeping a separate Vector<Event> for signposts, let them live in the main event stream. For fast iteration, we instead keep a cache of the signpost event indices.
2021-08-14Profiler: Use AK::Variant for type-specific data in Profile::EventAndreas Kling
Each event has a different set of data depending on the event type.
2021-08-13Profiler: Store event type as enumAndreas Kling
Also check for the most common event type (sample) first instead of leaving it as the fallback. This avoids a lot of string comparisons while parsing profiles.
2021-08-12Profiler: Parse and render signpost stringsAndreas Kling
The first perf_event argument to a PERF_EVENT_SIGNPOST is now interpreted as a string ID (in the profile strings set.) This allows us to generate signposts with custom strings. :^)
2021-08-12Profiler: Parse and paint profile signpost events :^)Andreas Kling
Signposts generated by perf_event(PERF_EVENT_SIGNPOST) now show up in profile timelines, and if you hover them you get a tooltip with the two arguments passed with the event.
2021-07-20Profiler: Make profiler not truncate 64-bit addressesGunnar Beutner
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-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-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-08Profiler: Let the user select more than one processGunnar Beutner
2021-05-07Profiler: Move filter checks into their own functionGunnar Beutner
2021-05-04Profiler: Move everything into the "Profiler" namespaceAndreas Kling
2021-04-26Kernel+Profiler: Improve profiling subsystemGunnar Beutner
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-23AK: Rename adopt() to adopt_ref()Andreas Kling
This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
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-03-04AK: Simplify Bitmap and implement in terms of BitmapViewAndreas Kling
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-03Profiler: Symbolicate addresses in non-PIE ELF objectsAndreas Kling
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-03Profiler: Cache and reuse mapped ELF objectsAndreas Kling
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-02Kernel+Profiler: Capture metadata about all profiled processesAndreas Kling
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-02-28Profiler: remove unimplemented Profile::LibraryMetadata::symbolicate() ↵thislooksfun
definition The implementation of Profile::LibraryMetadata::symbolicate() was removed in 340180ba057096d8cca917d2774c5a75c4b15975, but the corresponding public declaration was not.
2021-02-27Profiler: Add a new "Samples" view to the main UIAndreas Kling
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-27Profiler: Move ELF object name to its own profile graph columnAndreas Kling
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-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...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-01-12DevTools: Move to Userland/DevTools/Andreas Kling