libsysprof: port UI to new ABI

Some minor changes were necessary so that we could change the ABI in
libsysprof-capture to be free from GLib (and therefore used by GLib).

This also adds some wrappers for capture API in libsysprof so that we
can continue to use GError from UI code.
This commit is contained in:
Christian Hergert
2020-07-02 12:11:44 -07:00
committed by Philip Withnall
parent 608582d3c4
commit 97ddf5a0cc
24 changed files with 107 additions and 29 deletions

View File

@ -81,7 +81,7 @@ sysprof_battery_aid_prepare (SysprofAid *self,
#endif
}
static gboolean
static bool
collect_battery_counters (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -114,7 +114,7 @@ sysprof_callgraph_aid_prepare (SysprofAid *self,
#endif
}
static gboolean
static bool
discover_samples_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -123,7 +123,7 @@ build_title (const SysprofCaptureCounter *ctr)
return g_string_free (str, FALSE);
}
static gboolean
static bool
collect_counters (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -85,7 +85,7 @@ sysprof_cpu_aid_prepare (SysprofAid *self,
#endif
}
static gboolean
static bool
collect_info (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -62,7 +62,7 @@ state_free (State *st)
g_slice_free (State, st);
}
static gboolean
static bool
discover_max_n_addr (const SysprofCaptureFrame *frame,
gpointer user_data)
{
@ -78,7 +78,7 @@ discover_max_n_addr (const SysprofCaptureFrame *frame,
return TRUE;
}
static gboolean
static bool
build_point_cache_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -135,7 +135,7 @@ update_cpu_info_cb (GObject *object,
gtk_label_set_label (self->cpu_label, str);
}
static gboolean
static bool
cpu_info_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -80,7 +80,7 @@ sysprof_diskstat_aid_prepare (SysprofAid *self,
sysprof_profiler_add_source (profiler, source);
}
static gboolean
static bool
collect_diskstat_counters (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -143,7 +143,7 @@ sysprof_display_profiler_stopped_cb (SysprofDisplay *self,
g_autoptr(SysprofCaptureReader) reader = NULL;
g_autoptr(GError) error = NULL;
if (!(reader = sysprof_capture_writer_create_reader (writer, &error)))
if (!(reader = sysprof_capture_writer_create_reader_with_error (writer, &error)))
{
g_warning ("Failed to create capture creader: %s\n", error->message);
gtk_stack_set_visible_child (priv->stack, GTK_WIDGET (priv->failed_view));
@ -1071,7 +1071,7 @@ sysprof_display_open (SysprofDisplay *self,
g_set_object (&priv->file, file);
if (!(reader = sysprof_capture_reader_new (path, &error)))
if (!(reader = sysprof_capture_reader_new_with_error (path, &error)))
{
GtkWidget *dialog;
GtkWidget *window;
@ -1229,7 +1229,7 @@ sysprof_display_save (SysprofDisplay *self)
g_autofree gchar *path = g_file_get_path (file);
g_autoptr(GError) error = NULL;
if (!sysprof_capture_reader_save_as (priv->reader, path, &error))
if (!sysprof_capture_reader_save_as_with_error (priv->reader, path, &error))
{
GtkWidget *msg;

View File

@ -73,7 +73,7 @@ typedef struct
G_DEFINE_TYPE (SysprofDuplexVisualizer, sysprof_duplex_visualizer, SYSPROF_TYPE_VISUALIZER)
static gboolean
static bool
collect_ranges_cb (const SysprofCaptureFrame *frame,
gpointer data)
{
@ -126,7 +126,7 @@ collect_ranges_cb (const SysprofCaptureFrame *frame,
return TRUE;
}
static gboolean
static bool
collect_values_cb (const SysprofCaptureFrame *frame,
gpointer data)
{

View File

@ -613,7 +613,7 @@ calc_y_int64 (gint64 lower,
return (gdouble)(value - lower) / (gdouble)(upper - lower);
}
static gboolean
static bool
sysprof_line_visualizer_load_data_frame_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{
@ -655,7 +655,7 @@ sysprof_line_visualizer_load_data_frame_cb (const SysprofCaptureFrame *frame,
return TRUE;
}
static gboolean
static bool
sysprof_line_visualizer_load_data_range_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -289,7 +289,7 @@ sysprof_log_model_init (SysprofLogModel *self)
self->items = g_array_new (FALSE, FALSE, sizeof (Item));
}
static gboolean
static bool
cursor_foreach_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -80,7 +80,7 @@ sysprof_logs_aid_new (void)
return g_object_new (SYSPROF_TYPE_LOGS_AID, NULL);
}
static gboolean
static bool
find_marks_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -84,7 +84,7 @@ sysprof_marks_aid_new (void)
return g_object_new (SYSPROF_TYPE_MARKS_AID, NULL);
}
static gboolean
static bool
find_marks_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -301,7 +301,7 @@ sysprof_marks_model_init (SysprofMarksModel *self)
self->items = g_array_new (FALSE, FALSE, sizeof (Item));
}
static gboolean
static bool
cursor_foreach_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -87,7 +87,7 @@ sysprof_memprof_aid_prepare (SysprofAid *self,
#endif
}
static gboolean
static bool
discover_samples_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -79,7 +79,7 @@ sysprof_netdev_aid_prepare (SysprofAid *self,
sysprof_profiler_add_source (profiler, source);
}
static gboolean
static bool
collect_netdev_counters (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -65,7 +65,7 @@ discovery_ref (Discovery *d)
return d;
}
static gboolean
static bool
discover_max_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{
@ -85,7 +85,7 @@ discover_max_cb (const SysprofCaptureFrame *frame,
return TRUE;
}
static gboolean
static bool
calc_points_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -69,7 +69,7 @@ sysprof_rapl_aid_new (void)
return g_object_new (SYSPROF_TYPE_RAPL_AID, NULL);
}
static gboolean
static bool
collect_info (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -382,7 +382,7 @@ calc_x (gint64 lower,
return (gdouble)(value - lower) / (gdouble)(upper - lower);
}
static gboolean
static bool
sysprof_time_visualizer_load_data_frame_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{

View File

@ -608,7 +608,7 @@ compare_gint64 (const gint64 *a,
return 0;
}
static gboolean
static bool
index_frame_times_frame_cb (const SysprofCaptureFrame *frame,
gpointer user_data)
{