Commit Graph

145 Commits

Author SHA1 Message Date
rdb 6274b478aa pstats: Better handle overlapping collectors in Timeline
Prevents staircase effect where overlapping bars will end up ever
increasing the number of rows
2025-02-27 15:11:16 +01:00
rdb c8a918a209 pstats: Add Alt+Left in GTK flame graph to go back
See #1658
2024-10-29 13:15:28 +01:00
rdb c48721493a pstats: Allow scrolling through frames in flame charts
Closes #1658
2024-10-28 13:17:56 +01:00
rdb 61f8df2d7d general: Fix assorted compiler warnings 2024-10-14 12:06:35 +02:00
rdb 4ca495d828 CMake: Add separate BUILD_TOOLS option to build binaries
This is separate from BUILD_PANDATOOL, which builds the pandatool tree
2024-08-12 16:39:20 +02:00
rdb 91c22a0fd6 pstats: Perf improvement for smooth mode in strip chart with dropped frames
This significantly improves PStats strip chart performance with high frame rates and high number of dropped frames
2024-03-15 12:45:19 +01:00
rdb 07902429b8 pstats: optimize method that searches for frame at given time
This method is called a lot in the strip chart code and the current implementation can be very slow with a large frame rate
2024-03-15 12:44:14 +01:00
rdb 9fd9e2868e pstats: Don't compute frame data for dropped frames
When a frame is dropped, the previous non-dropped frame is considered to be repeated, but the strip chart would compute new cached frame data for it, causing performance to be unusably slow at high frame rate data gathering even when most frames are skipped

This makes performance remotely usable in that situation
2024-03-14 10:22:18 +01:00
rdb f59be2d6f7 pstats: Performance optimizations for strip chart 2024-03-13 23:22:15 +01:00
rdb a9f6e6fd8a pstats: Fix menus not updating in some conditions
Menus would only update properly if there was a strip chart open that would cause the PStatView to be updated

Calling `check_update()` in `new_collector()` doesn't work properly because the views haven't been updated there yet; calling `do_update()` there does work around it but I think the better fix is just to make sure we always update the view so that the `check_update()` (which is also called by `idle()`) works properly
2024-01-30 12:24:12 +01:00
rdb 71154492b9 pstats: Add macOS port
Closes #1531
2023-08-30 15:08:46 +02:00
rdb 577dc25130 pstats: Fix erroneous highlight in strip chart before oldest frame 2023-08-29 22:51:17 +02:00
rdb 2157f1162e pstats: Proper thread cleanup after a thread exits (PStats 3.2)
The thread will linger around in the server as long as there is data (so, it will be removed after `pstats-history` seconds)

Fixes #450
2023-01-10 14:37:39 +01:00
rdb 2aa2a35a9f pstats: Fix regression: crash when opening session file 2022-12-26 11:18:00 +01:00
rdb e1b4083d6d Merge branch 'release/1.10.x' 2022-12-12 17:19:10 +01:00
rdb fb14c29525 pstats: Server can handle new protocol version 2.3
It changes the following things:
* Changes the counts in the PStatFrameData from uint16 to uint32, since I was hitting the value limit in some heavy frames with Python profiling enabled - no good reason for this limitation, so this allows removing it later
* Adds a T_expire_thread message, which I can use later to fix #450

These features are not used on the client side, but will be used on master.  Adding these changes here now makes it possible to use a master client with a 1.10.13 version of the server (can be useful if you can't compile Panda on the host).
2022-12-10 19:45:29 +01:00
rdb 264fe5e057 pstats: Fix clock skew handling when frames arrive out-of-order 2022-12-07 15:01:39 +01:00
rdb 39744ac7de pstats: Fix save/load incompatibility with double-prec builds 2022-12-07 13:53:12 +01:00
rdb 7c85b54ba4 pstats: Use proper microsecond symbol on GTK 2022-12-03 22:28:02 +01:00
rdb d6055cc927 pstats: Timeline: show longer collector name if there's room
Similar to what we're doing on the flame graph now

Also, tweak tooltip message for collectors that overlap frame boundary if it's partially on a dropped frame, so that it isn't misleading
2022-12-03 21:44:36 +01:00
rdb f3cf30089b pstats: Improvements and fixees to Timeline view:
- Properly display and stack bars overlapping frame boundaries
- Ignore "App:Show code:General" collector (already disabled on master, but to support 1.10 clients) - it's an "inverted" collector that doesn't nest properly so it messes up the stacking
- Better handling / display of dropped frames
- Better handling of clock skew due to `PStatClient::resume_after_pause()` (but please don't use it, because it's not possible to fully handle it properly)
- Vertical scrolling (Windows only)
2022-12-02 22:19:43 +01:00
rdb 12c51fe2f6 pstats: Fix flame graph showing old results when opening in non-running session 2022-12-02 22:19:43 +01:00
rdb 1564435bbd pstats: Move last session and layout files to $XDG_STATE_HOME on Linux
This is a new directory that is slightly more persistent than $XDG_CACHE_HOME
2022-12-01 13:04:54 +01:00
rdb 7691d3f67b pstats: Fix some issues with updates of flame graph
Upon reading data from datagram, the bars would animate from zero width, which looks odd when opening an existing session.

Also, fix the scale area not updating properly in GTK version.
2022-11-30 12:34:12 +01:00
rdb 36aec8b014 pstats: Show collector start count in mouse-over tooltips 2022-11-29 20:59:14 +01:00
rdb a5610f217e Merge branch 'release/1.10.x' into incoming 2022-11-29 20:58:51 +01:00
rdb 386fe609fa pstats: Show hierarchical parent of collector in flame graph
Only when it's different from the nesting parent, and only if there's room.
2022-11-29 16:55:40 +01:00
rdb 7b9f2cd854 pstats: Support nested start/stop pairs in the server, accept 3.1
Currently, the client doesn't send nested start/stop pairs, but there is no good reason not to handle this case in the server, and in some cases it is useful to send them (I will soon make changes on master to take advantage of this).

Client version 3.1 indicates that the client may send nested start/stop pairs.
2022-11-29 15:48:02 +01:00
rdb 3468b95fa9 pstats: Show collector start/stop pair count in time-based graphs
It can be very useful to know how often a collector was invoked in a frame, not just how long it took.  This adds a number to the upper-right corner showing exactly that (but not aggregated, just for leaf collectors).
2022-11-29 13:01:55 +01:00
rdb 5247446500 pstats: Performance improvements for time-based strip charts
Remove the use of set and list, which are allocator-heavy and insertion was a bottleneck.  Since each sample occurs only once on the linked list, we can more efficiently roll our own linked list with next and prev pointers, so no allocation needed.  Instead of the set, we can just store a per-collector flag.
2022-11-29 12:51:04 +01:00
rdb 21cae91890 pstats: Fix hovering strip chart labels being excessively slow
Now properly uses the cached data rather than computing it on every mouseover
2022-11-26 21:43:41 +01:00
rdb bb6976d558 pstats: Third significant update to PStats server UI, including:
* Windows stay open after client disconnects, for further inspection
* Ability to save session results to a file, and reopening those files
* Ability to save the current graph window layout for new sessions
* Ability to change colors (by right-clicking on bar)
* SI prefixes for Hz units (kHz, MHz, etc.)
* Ability to export session to Chrome Tracing JSON format
* "Close All Graphs" menu option
* Graphs now properly show data when opened while Pause is on
* Some fixes for weird graph window minimize behavior on Windows
2022-10-05 18:58:36 +02:00
rdb ecf4d19e83 Merge branch 'release/1.10.x' 2022-05-10 16:12:36 +02:00
rdb 759115fbc7 pstats: Fix crash when frame has only level data and no time data 2022-02-22 15:25:04 +01:00
rdb 161ac4c2f7 pstats: Another major update for PStats server UI, including:
- New powerful scrolling Timeline view for seeing all time events across all threads
- Redo flame graph to use stack-based nesting rather than the standard collector nesting
- Rewrite flame graph drawing to not use labels
- Status bar appears in main window showing top-level level collectors; double-clicking them brings up their chart and right-clicking them shows their children
- Context menus are added when right-clicking labels and charts
- Tooltips now appear when mouse hovers over collector area in a chart
- Strip chart windows now automatically determine the appropriate scale better
- Graph menus redone to allow opening flame chart anywhere as well as strip chart
- Instead of just ms everywhere, also use s / us / ns where appropriate
- Don't disable smoothing right away on mouse down on strip chart, only after dragging
- Windows: The MDI child windows are quite ugly and overlap with the status bar, so instead they are now top-level windows, but some code is added to make them spawn inside and move with the parent window, and minimize to its corner.  I can back this out if people prefer the old behavior despite the ugly decoration
- Windows: Label text shows ellipsis when cut off
- Windows: Graph windows no longer have icons
- Windows: Graph windows no longer spawn perfectly on top of each other, rather cascading
- GTK: Render at high resolution when GDK_SCALE is not 1
- GTK: Graph windows are forced to be floating in tiling WMs
- GTK: Flame chart window no longer has useless dividing bar
- GTK: Use more efficient cairo surface types
2022-02-18 18:19:11 +01:00
rdb 7da70cf939 pstatserver: Major improvements to PStats server UI, including:
* New "Flame Graph" chart for seeing all collectors in a frame, much easier to read than piano roll
* Update controls, fonts, background color to more modern visual style on Windows
* Proper support for high DPI monitors (with correct scaling)
* Add tooltips for collector labels showing full name and averaged value
* Colors of collectors are now converted to sRGB transfer encoding
* Major performance improvement to piano roll view on Windows
* Movering mouse over labels now highlights the corresponding area in chart
* Label hover effect changed to darkening effect instead of border
* Reimplement graph as static common control on Windows
* Check boxes are now clickable by their label on Windows
* Graph windows have minimum sizes on Windows
2022-02-02 21:05:10 +01:00
rdb 36edb22fd1 pstats: Include client pid with hello message
Useful for uniquely identifying the process in a situation where multiple clients on the same host connect with the same server.

New version bump is not necessary, as old servers should just ignore the extra field in the datagram.
2022-01-30 02:03:18 +01:00
rdb e4573ef0fe cleanup: Remove more unnecessary nullptr checks before delete
Follow-up to #934
2020-05-05 14:46:30 +02:00
Sam Edwards 6760c1366d CMake: Update pandatool CMakeLists.txt files for style consistency 2018-10-28 05:08:38 -06:00
Sam Edwards 2ab77d9a27 Merge branch 'master' into cmake 2018-08-14 21:59:45 -06:00
Sam Edwards b2bfb31114 general: Remove `using std::*` from headers
Also remove most `using namespace std;` statements. The only one that remains is in py_panda.h.

Closes #350
Closes #335
2018-06-14 16:04:49 +02:00
Sam Edwards c4126942f6 Merge branch 'master' into cmake 2018-06-10 02:29:21 -06:00
Sam Edwards 7790f8429d general: Fully qualify header references into the std namespace
Closes #341
2018-06-07 10:35:12 +02:00
Sam Edwards 592a2e2d68 Merge branch 'master' into cmake 2018-06-06 13:18:12 -06:00
Sam Edwards e2b4353800 general: Replace NULL (and 0 as pointer) with C++11 nullptr
Exceptions to this replacement are:
- .c files
- Headers included by a .c file
- stb_image.h
- dr_flac.h
- Strings
- Comments
2018-06-03 16:35:13 -06:00
Sam Edwards 6efb07de93 Merge branch 'master' into cmake 2018-05-14 19:09:14 -06:00
Sam Edwards 87c11d8018 pstatclient: Rename config_pstats to config_pstatclient 2018-05-14 02:36:42 -06:00
Sam Edwards 1fcb8a2748 CMake: Skip optional subdirectories in a cleaner way
Instead of wrapping the whole subdirectory's CMakeLists in
a gigantic if block, we use if(NOT HAVE_FOO) + return()

This is tidier since it keeps the indentation generally consistent
across all CMakeLists files.
2018-04-20 02:26:47 -06:00
Sam Edwards d642ca4fa0 CMake: Change linkages to go through metalibs
This changes the target_link_libraries() declarations so they only
go directly to a component library if it's in the same metalib.

If it's outside of the metalib, the correct thing to do is link against
the metalib. CMake takes care of the transitive linking for us, so
there isn't actually any big change here.
2018-04-15 01:10:21 -06:00
Sam Edwards 441371e8d9 Merge branch 'master' into cmake 2016-03-15 18:30:55 -07:00