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.
This commit is contained in:
Christian Hergert
2016-04-14 04:36:18 -07:00
parent bdf888f556
commit a7982ad1e8
3 changed files with 179 additions and 5 deletions

View File

@ -19,7 +19,7 @@
#ifndef SP_PERF_COUNTER_H
#define SP_PERF_COUNTER_H
#include <glib-object.h>
#include <gio/gio.h>
#include <linux/perf_event.h>
@ -110,6 +110,12 @@ typedef void (*SpPerfCounterCallback) (SpPerfCounterEvent *event,
guint cpu,
gpointer user_data);
void sp_perf_counter_authorize_async (GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean sp_perf_counter_authorize_finish (GAsyncResult *result,
GError **error);
GType sp_perf_counter_get_type (void);
SpPerfCounter *sp_perf_counter_new (GMainContext *context);
void sp_perf_counter_set_callback (SpPerfCounter *self,