Commit Graph

409 Commits

Author SHA1 Message Date
5c2a1f2016 libsysprof: fix cost accounting for categories
We don't want to derive the total count from each summary, but instead
the total count of nodes w/ is_toplevel set.
2023-07-21 09:46:12 -07:00
76c0a8ece7 libsysprof: update categories.txt 2023-07-20 17:46:04 -07:00
ad5fc5f372 libsysprof: add locking category 2023-07-20 17:45:55 -07:00
8e861b222d libsysprof: add category-name helper
Just to ease translations
2023-07-20 17:31:15 -07:00
d13d2cb479 sysprof: drop signals category
Not really all that useful currently.
2023-07-20 17:30:44 -07:00
90c6d87a8c libsysprof: implement callgraph frame summaries 2023-07-20 17:02:56 -07:00
0f70dd1d68 libsysprof: keep count in callgraph node
I don't want this to overlap with augmentation data, or be augmentation
data specific, so just keep our own private copy of this data in the
node to do the sort of things we want with it (such as summaries).
2023-07-20 17:02:34 -07:00
a75429241e libsysprof: simplify summary generation
This still doesn't actually do anything, just the scaffolding.
2023-07-20 16:36:29 -07:00
ff40f7d37d tests: move tests to appropriate libraries 2023-07-20 16:20:52 -07:00
b8f39ef20a build: fix library name for libsysprof-6.so 2023-07-20 16:11:14 -07:00
4a8d5007e5 libsysprof: add scaffolding to perform category summaries
The goal here is to summarize the categories starting from a specific
frame.
2023-07-20 16:04:42 -07:00
9400757821 libsysprof: make presentation type one above uncategorized
That way we can do > presentation checks.
2023-07-20 16:03:56 -07:00
79c49fca02 libsysprof: track which nodes are toplevel
We used to do this, and now we have space for it here as we added the
categorization field.
2023-07-20 16:03:37 -07:00
dfa893f06a libsysprof: ensure descendants view is categorized 2023-07-20 15:31:50 -07:00
516917d74b tests: add category to test-callgraph 2023-07-20 15:05:29 -07:00
4d411d8586 libsysprof: update categories.txt 2023-07-20 15:00:21 -07:00
5d28ed9a74 libsysprof: add io and ipc categories 2023-07-20 15:00:05 -07:00
79a7fb5b22 libsysprof: update categories.txt 2023-07-20 14:37:33 -07:00
3763a4a4e9 libsysprof: update category groupings 2023-07-20 14:37:14 -07:00
c8e09327fc libsysprof: add simple text format for category rules 2023-07-20 14:30:34 -07:00
cab3f086f7 build: ensure enums header is build 2023-07-20 13:19:21 -07:00
1e84fe39a1 libsysprof: more categorization 2023-07-20 13:15:28 -07:00
4d2cdb2abe libsysprof: implement category inheretance
and remove template type, just keep that with layout.
2023-07-20 13:07:51 -07:00
ae7201c9ff libsysprof: use callgraph node to categorize for icons 2023-07-20 12:20:25 -07:00
92d2cedb8d libsysprof: add API to categorize callgraph
This just gets the plumbing in place with some basic categorization for
callgraph information. The real work of categorizing by nick/symbol still
needs to be done (some can be copied from SysprofCategoryIcon).

This also adds a property and getter for SysprofCallgraphFrame which will
expose the node's category to the UI code.
2023-07-20 11:32:44 -07:00
5afb315be5 libsysprof: fix flags get type generation 2023-07-20 11:24:04 -07:00
7f7afe9559 libsysprof: add a tooltip-text helper 2023-07-19 22:35:25 -07:00
de15129786 libsysprof: add more elf groupings 2023-07-19 22:35:12 -07:00
c55d1887ba libsysprof: include lsusb information 2023-07-19 19:07:12 -07:00
d04e5c5678 libsysprof: silence stderr 2023-07-19 19:07:05 -07:00
118484607d libsysprof: compress various process information 2023-07-19 18:33:00 -07:00
4d37230917 libsysprof: don't try to compress 0 length file content 2023-07-19 18:32:45 -07:00
3b2e9edeb9 libsysprof: record some system info from linux instrument
We might want a secondary instrument for this eventually, but for now we'll
just attach it in the Linux instrument.

This takes the output of eglinfo and glxinfo and adds it as a file in the
capture syscap. Compressed of course to keep the size smaller.
2023-07-19 18:30:24 -07:00
90ed413c5a libsysprof: add API to add compressed file from data 2023-07-19 18:29:38 -07:00
dbb7833cbf libsysprof: join libsysprof-analyze and libsysprof-profile
This brings together the two libraries back into one now that the whole
design is pretty well sorted out. They depend on roughly the same libraries
anyway and it's way easier of the single library can both read and write
the capture files (along with bringing in libsysprof-capture symbols in
a single place).
2023-07-19 17:40:41 -07:00
12e75e4c8c build: remove libsysprof
This library is going away now that we have -analyze and -profile libs.
2023-07-17 11:38:25 -07:00
8202a40f4d preload: hoist preloads into src/ directory
They will get used from libsysprof-profile, but it's nice to have them
a directory up going forward.
2023-06-06 16:32:21 -07:00
38dbf0dc95 build: add mapped_ring_buffer_sources for inclusion
We use this in various places but it relies on some static API in the
libsysprof-capture. Make it available to the other libraries.
2023-05-26 16:46:44 -07:00
754e5df789 libsysprof: only record process from perf, not threads
Otherwise we'll get additional SysprofCaptureProcess frames that relate
to the threads instead of just the processes.
2023-05-22 18:35:35 -07:00
8e101624bc libsysprof: add mmap variant for elfparser 2023-05-19 10:35:31 -07:00
11f0531591 libsysprof: include gzip'd /proc/kallsyms in capture
Compressed, this adds about 2.5mb to the capture file for the contents of
the kallsyms. However, that is useful so that we can decode kernel symbols
after the fact without relying on __symbols__ to be tacked on by the
recording machine.
2023-05-15 12:15:08 -07:00
efab045006 libsysprof-analyze: start on sysprof-analyze library
The goal here is to break up libsysprof into a library for recording
profiles (using libsysprof-capture) and a library for analyzing profiles
(both used by the sysprof UI).
2023-04-25 11:57:26 -07:00
dcbeb0f87a libsysprof: add SysprofCaptureModel
This adds a GListModel that we can use to load capture files. The goal here
is to map the entire capture into memory so we can avoid reading lots of
buffers. That also allows for the model items to live as long as the model
is alive (or underlying file map, really).

The next goal is to stack features on top of this such as implementing the
callgraph as a filter of the model, or generic filters between the
callgraph model and the actual data source model.
2023-04-24 17:26:45 -07:00
7c378668e1 libsysprof: update radix tree sources 2023-01-26 11:03:39 -08:00
1e1a719895 Revert "libsysprof: Avoid a use-after-free in raxRemove"
This reverts commit bb83598b12.

See !63 and #84
2023-01-26 10:59:22 -08:00
bb83598b12 libsysprof: Avoid a use-after-free in raxRemove
As we are freeing the child, make sure to set it to NULL so that we are not
trying to remove it again.
2023-01-18 17:26:20 +01:00
ee71fb58b1 Fix LD_PRELOAD syntax
From ld.so(8): The items of the list can be separated
by spaces or colons...
2023-01-15 15:01:21 -05:00
6d50f3ca7b meson: Override dependencies to improve usage as a subproject
With this change, sysprof can be consumed as a subproject without
making any changes to the build files of a project. All you need to do
is provide a wrap file with a `[provide]` section:

https://mesonbuild.com/Wrap-dependency-system-manual.html#provide-section

This is also necessary because otherwise projects need to hard-code
the subproject name, which might be `sysprof` when using `wrap-git` or
`sysprof-3.46.0` when using `wrap-file` (to build from a release
tarball). This can cause conflicts between different subprojects that
consume sysprof differently.

Other projects like glib, cairo, pango, etc already do this.
2022-12-18 10:04:00 +05:30
6212396483 libsysprof: Actually set spawnable flags to inherit stdin
The code calculated flags but never actually set them on the spawnable,
so the `inherit-stdin` property did not work.

Fixes: 8799d2f0ca
See: https://gitlab.gnome.org/GNOME/sysprof/-/issues/76#note_1531919
2022-10-07 17:55:09 +00:00
1ef9fc1e30 elf: handle NULL lookaside
This code uses the hashtable directly to avoid the overhead of calling
the path which creates ProcessInfo entries. So we need to also handle
the chance the lookaside is NULL.
2022-09-05 20:51:58 -07:00