Commit Graph

42 Commits

Author SHA1 Message Date
7a639e9bf8 menu-button: ensure the scrolled window is always full width
When no items were present, this was shrinking. It should always maintain
width of the popover.
2016-04-16 18:58:43 -07:00
57faf5b9e6 menu-button: show process arguments in process list
This parses the \0 out of the cmdline proc entry and makes them visible
as both in the list of processes and as tooltips when hovered.
2016-04-16 18:57:50 -07:00
9e082a257d menu-button: hide the process list when whole-system is enabled
No sense in showing a desensitized widget that cannot be toggled except
for discover-ability. But progressive disclosure is probably better.
2016-04-16 18:21:26 -07:00
4fdd7aca71 menu-button: improve error reporting on argv command line 2016-04-16 17:40:07 -07:00
f4aabd8b7c perf: ignore not-supported failures
If the pre-authorize fails due to lacking support for sysprofd, that is
fine, we can fail later on if authorization was required.
2016-04-16 17:16:29 -07:00
f5904bc493 perf: fix typo
Typo when polkit/sysprofd is unavailable to pre-authorize the request.
2016-04-16 17:14:42 -07:00
4479c56135 perf: polkit is optional for the library
So changing this was a little backwards. The goal here is to allow using
libsysprof-2 without polkit, it just won't have the ability to elevate
privileges.
2016-04-16 17:13:56 -07:00
74d88245c5 perf: use #ifdef not #if
This is conditionally added to CFLAGS, so make sure we use #ifdef instead
of #if.
2016-04-16 17:08:38 -07:00
c2eecefe50 build: add polkit cflags/libs to libsysprof-2 target 2016-04-16 17:05:56 -07:00
f307ce50ab platform: fix missing ;
Clearly, we are testing the fallback path well.
2016-04-16 17:00:56 -07:00
f2d40eda89 platform: include gstdio for g_unlink(). 2016-04-16 16:57:11 -07:00
9f8f33b210 perf: use #ifdef, not #if
config.h does not unconditionally define these, they are not defined when
inactive.
2016-04-16 16:56:41 -07:00
06aaff90e5 perf: optionally enable clockid and use_clockid
Some kernels to not have this feature yet, so check for support in
linux/perf_event.h and optionally enable the struct field.
2016-04-16 16:07:11 -07:00
de572f4ed6 memfd: add workaround for systems without memfd
Just a quick workaround to use a tmpfile if memfd is not available. We
should try to ensure that we get something on tmpfs, but this is probably
good enough for a fallback.
2016-04-16 15:49:03 -07:00
8291e05da3 menu-button: sync menu button settings when attaching profiler
We were failing to launch a program a second or third time, due to the
settings not beeing sync'd to the profiler instance.
2016-04-15 18:19:20 -07:00
ceeb29b0e6 callgraph: add accessor to determine number of functions
We can use this to notify the user that not enough samples where collected
to build a callgraph. This can happen when all the samples collected are
ignored (due to being in ignored kernel space address ranges for example).
2016-04-15 18:11:02 -07:00
18d2d81824 perf-source: we need PERF_SAMPLE_TID
I mistakingly removed this, which caused us to not get sample delivery.
2016-04-15 05:04:29 -07:00
49e9ad9db8 capture: make counter value a union of int64 and double
This allows us to use the type field of the counter to specify if the
counter is a double or a 64-bit integer.
2016-04-15 04:54:55 -07:00
48420b0c87 writer: increment the next counter id, not the return value 2016-04-15 04:51:23 -07:00
253b387323 capture: add sp_capture_reader_peek_frame()
It can be useful to peek at the whole frame header (for things like time
or pid or cpu).
2016-04-15 04:51:23 -07:00
ad5f855a2b capture: add 64-bit time stamp for start time
We keep the start time as a iso8601 string, which is useful, but not
enough for relative timestamps to the epoch (start time). Include a
clock time in the same clock domain.
2016-04-15 04:51:23 -07:00
f72306f5a8 writer: use SP_CAPTURE_CURRENT_TIME
This should be nsec, not usec based time.
2016-04-15 04:51:23 -07:00
dd821b48e8 perf-source: fix acquisition of time for comm and mmap events
We were not getting the proper value for time. We need sample_id_all set
according to my cursory reading of the core.c in the kernel. Also, the
time is aligned to 64-bit (after the comm field).
2016-04-15 04:51:23 -07:00
609ee997da perf-counter: pass sample_id_all to sysprofd 2016-04-15 04:51:23 -07:00
d7ed2ddf30 writer: allow callers to define a counter range
This allows dynamic counter ids that can be allocated in blocks.
2016-04-14 21:36:07 -07:00
1b8cfed5c8 writer: use dup()d fd when creating reader
Readers can share the file-offset in the file-descriptor table, but should
really have their own fd that they can close().
2016-04-14 19:25:26 -07:00
cd0a39859e capture: drop ADD from capture type
I opted to not implement this yet, so ensure its not in the capture
format types.
2016-04-14 18:33:23 -07:00
c87a90cd9a capture: add frame type for defining and setting counters
We might want to add a CTRADD type later on, for relative values rather
than absolute. But this should get us started.

Simply define counters upfront, and then set them during the capture
process.

Obviously, we need to come up with a good way to visualize this
information in the UI.
2016-04-14 18:29:39 -07:00
89e75fae2d profiler: reset timer when starting
If we reuse the profiler instance (not convinced this is a good idea yet)
then we could have a nonzero elapsed time. Reset it immediately so that
the UI doesn't jitter between the previous value and 00:00.
2016-04-14 05:39:49 -07:00
a7982ad1e8 perf: delay source start until polkit has authorized
Without this, after logging in you are already multiple seconds into your
profiling session recording. Not ideal. So instead, we do the async polkit
auth upfront during SpSource::prepare(), and then toggle ready after we
have received notification.
2016-04-14 04:36:18 -07:00
88d3ae3b74 profiler: extract SpProfiler into an interface
It would be nice to be able to support a remote profiler session in the
future, so add SpLocalProfiler implementation of SpProfiler interface.
2016-04-14 02:37:28 -07:00
5d25b8a242 build: be a bit more flexible with configuration options
It would be nice if we can be a bit more flexible with where the
sysprof-cli tool can run. Lets try to break out the system checks a
bit more.
2016-04-14 00:59:28 -07:00
f4df6616c6 lib: add some padding to classes
We might want to extend these going forward, so give us a chance to avoid
breaking ABI.
2016-04-13 23:05:02 -07:00
a8205c7c29 build: allow disabling the GTK interface with --disable-gtk
For some systems, such as embedded Linux including ARM, we might want to
just compile libsysprof/sysprof-cli without the GTK user interface. This
allows for that. You can copy the capture files to your visualization
host to render the results.
2016-04-13 21:32:01 -07:00
61fed5b8f2 build: split profiler and gtk widgets into separate libraries
This will make it easier to support installing just sysprof-cli and the
sysprofd helper daemon on systems where GTK is not feasible or necessary.
This does not, however, do that. It simply gets things broken up into
pieces.
2016-04-13 21:09:52 -07:00
66d4bb25e1 callgraph: add column headers in screenshot text 2016-04-13 20:58:44 -07:00
32ea29e1ba lib: only export ^sp_ symbols 2016-04-13 20:20:52 -07:00
acd749a4e3 callgraph: add sp_callgraph_view_screenshot()
Similar to the old sysprof, this generates a textual representation of the
descendants view. It matches the expansion of the treeview in the output
text.
2016-04-13 19:40:20 -07:00
8743dbd0c9 elf-symbol-resolver: add GObject Introspection tag
When we see addresses in libgobject-introspection, give them the
"Introspection" tag to make it clear which library the symbol came from.
This is particularly useful since so many functions overlap with g_
prefixes.
2016-04-13 09:20:05 -07:00
172a1b772d callgraph: allow going backward with alt+left arrow
Sometimes its really annoying to dive into a descendant and then want to
go back to where you were. This uses alt+left arrow to go back to the
previous node. It doesn't, however, re-expand the tree to the previous
state.
2016-04-13 06:31:30 -07:00
29c4ec495f Land Sysprof 2.x
This is a major redesign a modernization of Sysprof. The core data
structures and design are largely the same, but it has been ported to
Gtk3 and has lots of additions that should make your profiling experience
smoother. Especially for those that are new to profiling.

There are some very simple help docs added, but we really need the
experts to come in and write some documentation here.
2016-04-13 05:24:03 -07:00
2ea0287f89 move source around in preparation to land sysprof2 2016-04-13 05:10:31 -07:00