Commit Graph

72 Commits

Author SHA1 Message Date
c19d0635aa capture: add SpCaptureCursor and associated types
This API helps us simplify some of the tooling to iterate
through a capture. In particular, we might want to setup a
bunch of matches and then just iterate through the items.

This can also allow delaying the iteration until the future
which might be handy for visualizers which won't want to block
the main loop.

I'm not jazzed about the 64k buffer created for every cursor
due to the SpCaptureReader copy, but it's probably not a big
deal in practice until we start doing more exotic things.
2016-09-25 00:25:08 -07:00
b8f465659b reader: add sp_capture_reader_copy()
This function allows copying a capture so that we can do
additional reads. This does, however, copy the buffers which
might be more memory than we want for large usage. We can
tweak things as we go to figure out the cursors.
2016-09-25 00:23:28 -07:00
99ff8f2a5c wip: visualizers 2016-09-23 19:18:36 -07:00
c5ba20caeb build: allow using a host-installed sysprofd
In case we are building in a flatpak, we might want to rely on a system
installed sysprofd. This means we might want to pretend we have sysprofd
support (to be found on the system), but not actually build sysprofd.
2016-09-15 13:45:02 -07:00
541e8024e1 ui: use GtkScrolledWindow:propagate-natural-width and height
We need this for recent changes to how natural sizing will work now that
the max-content-* properties are stabilizing for their first public ABI
release.
2016-09-01 21:35:51 -07:00
69338ee16e callgraph-view: collapse row with Left Arrow
This makes Left Arrow do the opposite of Right Arrow.
2016-08-30 13:01:16 -07:00
f313ca4dae lib: Add full barrier before writing data_tail
The kernel says here http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/events/ring_buffer.c?id=7a1dcf6ad#n61 :

	 * Since the mmap() consumer (userspace) can run on a different CPU:
	 *
	 *   kernel				user
	 *
	 *   if (LOAD ->data_tail) {		LOAD ->data_head
	 *			(A)		smp_rmb()	(C)
	 *	STORE $data			LOAD $data
	 *	smp_wmb()	(B)		smp_mb()	(D)
	 *	STORE ->data_head		STORE ->data_tail
	 *   }
	 *
	 * Where A pairs with D, and B pairs with C.
	 *
	 * In our case (A) is a control dependency that separates the load of
	 * the ->data_tail and the stores of $data. In case ->data_tail
	 * indicates there is no room in the buffer to store $data we do not.
	 *
	 * D needs to be a full barrier since it separates the data READ
	 * from the tail WRITE.
	 *
	 * For B a WMB is sufficient since it separates two WRITEs, and for C
	 * an RMB is sufficient since it separates two READs.
	 *
	 * See perf_output_begin().

So I'm pretty sure we need a full barrier before writing out data_tail.
2016-08-23 16:53:39 -04:00
1b89cc58cf lib: use stdatomic.h for memory barriers
C11 gives us APIs for fencing logic.  Use that instead of a
a long, per-architecture, hand curated list of definitions.
2016-08-23 16:52:29 -04:00
1c1ef02b3d util: add full memory barrier fallback 2016-08-23 10:08:37 -07:00
6ed7ec20ae util: add read_barrier() for ARMv7 2016-08-22 11:54:10 -07:00
3cfcee4757 util: use ifdef instead of if defined 2016-08-22 11:53:58 -07:00
e4e1bf73b3 line-reader: handle invalid parameters more gracefully
This silences coverity which doesn't handle return_if_fail() macros
very well.
2016-08-22 11:02:03 -07:00
46a257da6e elfparser: suppress warnings about cast alignment
These are aligned according to the spec, so we can simply silence them
with the gpointer cast.
2016-08-21 17:32:59 -07:00
e81204dec9 process-model-item: remove duplicate const 2016-08-21 17:32:59 -07:00
a5b08cad94 reader: increment j, not i when swapping counter values 2016-08-21 17:32:59 -07:00
6058c62f44 reader: bswap jitmap item count 2016-08-21 17:32:59 -07:00
94c8551063 kernel-symbol: fix alignment warning
Our pointer is always malloc() aligned, so we have a safe cast here.
2016-08-21 17:32:59 -07:00
24716d7c88 elf: add more pango mappings 2016-08-18 14:38:14 +02:00
1ad1b23f57 callgraph: ensure cell renderer is available 2016-08-16 18:03:25 +02:00
c45a55b467 lib: avoid using hexpand in SpProfilerMenuButton
This can cause the widget to expand now that GtkHeaderBar supports expand
for start/end packed children.
2016-07-06 23:31:04 -07:00
329743c917 callgraph: Use U64_TO_POINTER
This fixes a "cast to pointer from integer of different size" on i586.

https://bugzilla.gnome.org/show_bug.cgi?id=767693
2016-06-15 18:06:25 -04:00
15a2873c25 Move from SpScrolledWindow to GtkScrolledWindow
GtkScrolledWindow has max-content-{width,height} properties now. Remove
SpScrolledWindow and bump the gtk+ requirement to 3.21.3 at the same
time.
2016-06-10 21:12:06 +02:00
28d9a7d8b4 callgraph view: Expand cursor row on Right 2016-06-05 21:08:39 +02:00
67efcc462b Fix handling plural forms
https://bugzilla.gnome.org/show_bug.cgi?id=765929
2016-05-03 12:42:20 +03:00
9c6cec9b49 perf: avoid authorization dialog when user owns target pid
If we check the UID of the pid from /proc/pid/status and the UID matches
our current user, we should be able to forego the authorization dialog.

This should fix a regression where sysprof worked from jhbuild when
profiling a process you have access to.
2016-04-25 15:11:54 -07:00
afadd90834 perf: ping the sysprofd service before we consider it up
This should help catch failures where the peer is not yet up and might
fail to start, before we actually block on communicating with it.
2016-04-24 17:49:03 -07:00
8709eaff14 build: let gcc know our cast is safe
Data is already aligned, so casting the ->data field is fine.
2016-04-20 22:35:17 -07:00
e759f2999f elf: tag GtkSourceView symbols
We see this library enough in the platform that it is work tagging.
2016-04-20 20:36:01 -07:00
b97425b300 perf: make sure we emit finished after last process exits
This fixes the "auto-stop" feature when the child exits, at least in the
case of /usr/bin/gnome-calculator. However, when testing with gedit I
did not see it accurately clean up, so something still needs to be
troubleshooted.
2016-04-18 22:31:39 -07:00
a594d06b0c perf: let the compiler know our cast is alignment-safe
We know everything is 64-bit aligned, so casting via (void*) squashes
the compiler warning.
2016-04-18 18:52:20 -07:00
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