Commit Graph

98 Commits

Author SHA1 Message Date
f2f03259a2 visualizer-ticks: set CSS element name to "ticks" 2016-09-27 17:21:49 -07:00
fa1a8d9276 visualizer-ticks: use color from GtkStyleContext
This should improve the coloring when used with a dark theme.
2016-09-27 17:21:28 -07:00
3a3b4f1fa0 visualizer-ticks: adjust line draw ordering
We want to draw the most important ticks on top, which will
improve things should we start using CSS to define styling.
2016-09-27 17:09:37 -07:00
857082b222 visualizer-ticks: tweak half-line positioning
Just to get things a bit more friendly should we choose even
line widths.
2016-09-27 17:08:52 -07:00
ad130db3d6 cpu-visualizer-row: hide if no counters were found
If we failed to locate any counters, then there isn't much we
can show the user here. So just hide the row.
2016-09-27 16:44:23 -07:00
984fac73b6 visualizer-ticks: adjust tick positioning and add 5sec span
Just some improvements to out positioning so things line up
as expected.
2016-09-27 16:38:17 -07:00
aa21c2379f visualizer-ticks: start on minimal ticks implementation
We need some sort of scale for content, so we will do this with
an overlay for now. However, we will also want something to be
able to do selections in the future.

This still needs some iteration for correctness, but this sort
of gets the ball rolling.
2016-09-27 15:42:26 -07:00
c24306349f line-visualizer-row: ignore css border
If a border is specified in CSS, we do not want to draw on
that. Make sure we adjust our allocation to take that into
account.
2016-09-27 15:40:46 -07:00
1dcb41f623 line-visualizer-row: use scaled surface when available
If we have not yet received our proper draw for the new size
allocation (likely right after the size allocate), then we can
just use the old surface but at a scaled value. This is handy
so that we don't block the main loop trying to do drawing of
lots of data points. Instead we just scale the image and wait
for the high-quality version to complete.
2016-09-26 23:24:17 -07:00
321fc18eee cpu-visualizer-row: stop after locating counters
In practice, we do a single counter definition for the CPU
definitions. So we can stop iterating the samples after we
successfully locate an item.
2016-09-26 22:14:44 -07:00
f600a96364 hostinfo: stash CPU usage 4x per second
Probably want to make this a tunable at some point, but this
makes things a bit better for graphing now.
2016-09-26 21:59:28 -07:00
573ba7bf51 line-visualizer-row: use cairo_curve_to()
This makes our line graph match more closely to the design
coming from Builder's cpu graph.
2016-09-26 21:57:33 -07:00
4bdbc46381 line-visualizer-row: simplify data point rendering
We can use some crafty scale/translations to simplify the
line drawing of data points.
2016-09-26 20:08:34 -07:00
63e7e1d1dd line-visualizer-row: remove debug code 2016-09-26 19:27:37 -07:00
bdc62bac1e visualizer-list: add SpVisualizerList
This simplifies the visualizer reader and time propagation. It
will also give us a single place to manage zoom levels when we
get to that.
2016-09-26 19:21:10 -07:00
24477d41cf line-visualizer: plumb off-screen rendering mechanics
This starts getting the mechanics in place for off screen
rendering using a cairo image surface. We create our own
point cache for storing x,y pairs and then simplify our
drawing based on that.
2016-09-26 17:38:47 -07:00
e537b84c29 cpu-visualizer: remove prepare vfunc
This is going away, at least in this form.
2016-09-26 17:37:59 -07:00
e4bc640a49 capture-cursor: reset reader upon creation
When creating our private reader copy, we need to reset the
reader so that we start at the beginning. Otherwise, we are
likely to be at the end of the capture (especially for in
memory captures).
2016-09-26 17:37:11 -07:00
a3257ed40b capture-condition: style cleanup
Just some nits and defensive programming.
2016-09-26 17:36:47 -07:00
571c2320da pointcache: add PointCache utility class
This is a simple cache that keeps x,y pairs for use when drawing
visualizers. To keep this generic, and save on memory, we simply
store the x,y coordinates as floats between 0.0 and 1.0. This
saves us roughly 50% on each data point over the 2 8-byte
numbers we would otherwise store.

Obviously, we could take this further and make some fancy index
storage with run-length-encode values, but this should work for
now and allow us to get more exotic later.
2016-09-26 17:34:58 -07:00
0a9193ab70 line-visualizer: remove legacy drawing code
This provides the plumbing to do the threaded drawing, we just
need to write the capture cursor and draw operations from the
pixman/cairo worker thread (and do so safely).
2016-09-25 15:37:00 -07:00
5ceff81d5d visualizer: add set_time_range() and get_time_range()
This allows the row to be notified of the visible range, which
can result from changing the zoom or a new reader being set.
2016-09-25 15:35:14 -07:00
1f07467800 capture-condition: add new AND condition
This requires that both the left and right condition evaluate
to TRUE. We obviously will want to add more of these for things
like OR, NOT, etc. However, we can add them as necessary since
they are fairly self contained patches.
2016-09-25 13:32:14 -07:00
3b9ea07d31 cpu: discover cpu counters from SpCaptureReader
This allows us to dynamically discover the cpu counters from the
capture by looking for the "CPU Total" category.
2016-09-25 12:19:53 -07:00
84c61c3344 capture-condition: add matcher for counter ids
This lets us focus on the query of "show me all events related
to counter X" rather than the implementation details. Which
means later on, if we build a real index, we can optimize this
without changing user code.
2016-09-25 11:36:18 -07:00
01794db9b0 visualizer-row: add padding to visualizer rows 2016-09-25 00:27:54 -07:00
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