mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 15:40:53 +00:00
libsysprof-ui: add fork to list of marks
This commit is contained in:
@ -40,6 +40,7 @@ typedef struct
|
|||||||
gint64 end_time;
|
gint64 end_time;
|
||||||
guint has_samples : 1;
|
guint has_samples : 1;
|
||||||
guint has_counters : 1;
|
guint has_counters : 1;
|
||||||
|
guint has_forks : 1;
|
||||||
guint has_marks : 1;
|
guint has_marks : 1;
|
||||||
guint can_replay : 1;
|
guint can_replay : 1;
|
||||||
} SysprofCaptureFeatures;
|
} SysprofCaptureFeatures;
|
||||||
@ -330,6 +331,11 @@ sysprof_capture_view_scan_worker (GTask *task,
|
|||||||
features.can_replay = TRUE;
|
features.can_replay = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (frame.type == SYSPROF_CAPTURE_FRAME_FORK)
|
||||||
|
{
|
||||||
|
features.has_forks = TRUE;
|
||||||
|
sysprof_capture_reader_read_fork (reader);
|
||||||
|
}
|
||||||
else if (frame.type == SYSPROF_CAPTURE_FRAME_MARK)
|
else if (frame.type == SYSPROF_CAPTURE_FRAME_MARK)
|
||||||
{
|
{
|
||||||
const SysprofCaptureMark *mark;
|
const SysprofCaptureMark *mark;
|
||||||
@ -465,7 +471,7 @@ sysprof_capture_view_scan_finish (SysprofCaptureView *self,
|
|||||||
if (!priv->features.has_samples)
|
if (!priv->features.has_samples)
|
||||||
gtk_widget_hide (GTK_WIDGET (priv->callgraph_view));
|
gtk_widget_hide (GTK_WIDGET (priv->callgraph_view));
|
||||||
|
|
||||||
if (!priv->features.has_marks)
|
if (!priv->features.has_marks && !priv->features.has_forks)
|
||||||
gtk_widget_hide (GTK_WIDGET (priv->marks_view));
|
gtk_widget_hide (GTK_WIDGET (priv->marks_view));
|
||||||
|
|
||||||
if (!priv->features.has_counters)
|
if (!priv->features.has_counters)
|
||||||
|
|||||||
@ -311,7 +311,8 @@ cursor_foreach_cb (const SysprofCaptureFrame *frame,
|
|||||||
g_assert (SYSPROF_IS_MARKS_MODEL (self));
|
g_assert (SYSPROF_IS_MARKS_MODEL (self));
|
||||||
g_assert (frame->type == SYSPROF_CAPTURE_FRAME_MARK ||
|
g_assert (frame->type == SYSPROF_CAPTURE_FRAME_MARK ||
|
||||||
frame->type == SYSPROF_CAPTURE_FRAME_CTRSET ||
|
frame->type == SYSPROF_CAPTURE_FRAME_CTRSET ||
|
||||||
frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF);
|
frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF ||
|
||||||
|
frame->type == SYSPROF_CAPTURE_FRAME_FORK);
|
||||||
|
|
||||||
if (frame->type == SYSPROF_CAPTURE_FRAME_MARK)
|
if (frame->type == SYSPROF_CAPTURE_FRAME_MARK)
|
||||||
{
|
{
|
||||||
@ -329,6 +330,22 @@ cursor_foreach_cb (const SysprofCaptureFrame *frame,
|
|||||||
if G_LIKELY (item.end_time > self->max_end_time)
|
if G_LIKELY (item.end_time > self->max_end_time)
|
||||||
self->max_end_time = item.end_time;
|
self->max_end_time = item.end_time;
|
||||||
|
|
||||||
|
g_array_append_val (self->items, item);
|
||||||
|
}
|
||||||
|
else if (frame->type == SYSPROF_CAPTURE_FRAME_FORK)
|
||||||
|
{
|
||||||
|
SysprofCaptureFork *fk = (SysprofCaptureFork *)frame;
|
||||||
|
g_autofree gchar *message = g_strdup_printf ("PID: %d, Child PID: %d", frame->pid, fk->child_pid);
|
||||||
|
|
||||||
|
item.begin_time = frame->time;
|
||||||
|
item.end_time = item.begin_time;
|
||||||
|
item.group = g_string_chunk_insert_const (self->chunks, "fork");
|
||||||
|
item.name = g_string_chunk_insert_const (self->chunks, "Fork");
|
||||||
|
item.message = g_string_chunk_insert_const (self->chunks, message);
|
||||||
|
item.value.v64 = 0;
|
||||||
|
item.is_counter = FALSE;
|
||||||
|
item.counter_type = 0;
|
||||||
|
|
||||||
g_array_append_val (self->items, item);
|
g_array_append_val (self->items, item);
|
||||||
}
|
}
|
||||||
else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF)
|
else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF)
|
||||||
@ -475,7 +492,10 @@ sysprof_marks_model_new_async (SysprofCaptureReader *reader,
|
|||||||
}
|
}
|
||||||
else if (kind == SYSPROF_MARKS_MODEL_MARKS)
|
else if (kind == SYSPROF_MARKS_MODEL_MARKS)
|
||||||
{
|
{
|
||||||
static const SysprofCaptureFrameType types[] = { SYSPROF_CAPTURE_FRAME_MARK };
|
static const SysprofCaptureFrameType types[] = {
|
||||||
|
SYSPROF_CAPTURE_FRAME_MARK,
|
||||||
|
SYSPROF_CAPTURE_FRAME_FORK,
|
||||||
|
};
|
||||||
|
|
||||||
c = sysprof_capture_condition_new_where_type_in (G_N_ELEMENTS (types), types);
|
c = sysprof_capture_condition_new_where_type_in (G_N_ELEMENTS (types), types);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user