libsysprof-capture: shorten names by removing Frame

This commit is contained in:
Christian Hergert
2019-05-22 16:36:30 -07:00
parent 684aa1aba6
commit 567f8a3a0f
13 changed files with 35 additions and 35 deletions

View File

@ -105,7 +105,7 @@ sysprof_capture_condition_match (const SysprofCaptureCondition *self,
case SYSPROF_CAPTURE_CONDITION_WHERE_COUNTER_IN: case SYSPROF_CAPTURE_CONDITION_WHERE_COUNTER_IN:
if (frame->type == SYSPROF_CAPTURE_FRAME_CTRSET) if (frame->type == SYSPROF_CAPTURE_FRAME_CTRSET)
{ {
const SysprofCaptureFrameCounterSet *set = (SysprofCaptureFrameCounterSet *)frame; const SysprofCaptureCounterSet *set = (SysprofCaptureCounterSet *)frame;
for (guint i = 0; i < self->u.where_counter_in->len; i++) for (guint i = 0; i < self->u.where_counter_in->len; i++)
{ {
@ -127,7 +127,7 @@ sysprof_capture_condition_match (const SysprofCaptureCondition *self,
} }
else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF) else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF)
{ {
const SysprofCaptureFrameCounterDefine *def = (SysprofCaptureFrameCounterDefine *)frame; const SysprofCaptureCounterDefine *def = (SysprofCaptureCounterDefine *)frame;
for (guint i = 0; i < self->u.where_counter_in->len; i++) for (guint i = 0; i < self->u.where_counter_in->len; i++)
{ {

View File

@ -721,10 +721,10 @@ sysprof_capture_reader_read_sample (SysprofCaptureReader *self)
return sample; return sample;
} }
const SysprofCaptureFrameCounterDefine * const SysprofCaptureCounterDefine *
sysprof_capture_reader_read_counter_define (SysprofCaptureReader *self) sysprof_capture_reader_read_counter_define (SysprofCaptureReader *self)
{ {
SysprofCaptureFrameCounterDefine *def; SysprofCaptureCounterDefine *def;
g_assert (self != NULL); g_assert (self != NULL);
g_assert ((self->pos % SYSPROF_CAPTURE_ALIGN) == 0); g_assert ((self->pos % SYSPROF_CAPTURE_ALIGN) == 0);
@ -733,7 +733,7 @@ sysprof_capture_reader_read_counter_define (SysprofCaptureReader *self)
if (!sysprof_capture_reader_ensure_space_for (self, sizeof *def)) if (!sysprof_capture_reader_ensure_space_for (self, sizeof *def))
return NULL; return NULL;
def = (SysprofCaptureFrameCounterDefine *)(gpointer)&self->buf[self->pos]; def = (SysprofCaptureCounterDefine *)(gpointer)&self->buf[self->pos];
if (def->frame.type != SYSPROF_CAPTURE_FRAME_CTRDEF) if (def->frame.type != SYSPROF_CAPTURE_FRAME_CTRDEF)
return NULL; return NULL;
@ -744,13 +744,13 @@ sysprof_capture_reader_read_counter_define (SysprofCaptureReader *self)
if (G_UNLIKELY (self->endian != G_BYTE_ORDER)) if (G_UNLIKELY (self->endian != G_BYTE_ORDER))
def->n_counters = GUINT16_SWAP_LE_BE (def->n_counters); def->n_counters = GUINT16_SWAP_LE_BE (def->n_counters);
if (def->frame.len < (sizeof *def + (sizeof (SysprofCaptureFrameCounterDefine) * def->n_counters))) if (def->frame.len < (sizeof *def + (sizeof (SysprofCaptureCounterDefine) * def->n_counters)))
return NULL; return NULL;
if (!sysprof_capture_reader_ensure_space_for (self, def->frame.len)) if (!sysprof_capture_reader_ensure_space_for (self, def->frame.len))
return NULL; return NULL;
def = (SysprofCaptureFrameCounterDefine *)(gpointer)&self->buf[self->pos]; def = (SysprofCaptureCounterDefine *)(gpointer)&self->buf[self->pos];
if (G_UNLIKELY (self->endian != G_BYTE_ORDER)) if (G_UNLIKELY (self->endian != G_BYTE_ORDER))
{ {
@ -768,10 +768,10 @@ sysprof_capture_reader_read_counter_define (SysprofCaptureReader *self)
return def; return def;
} }
const SysprofCaptureFrameCounterSet * const SysprofCaptureCounterSet *
sysprof_capture_reader_read_counter_set (SysprofCaptureReader *self) sysprof_capture_reader_read_counter_set (SysprofCaptureReader *self)
{ {
SysprofCaptureFrameCounterSet *set; SysprofCaptureCounterSet *set;
g_assert (self != NULL); g_assert (self != NULL);
g_assert ((self->pos % SYSPROF_CAPTURE_ALIGN) == 0); g_assert ((self->pos % SYSPROF_CAPTURE_ALIGN) == 0);
@ -780,7 +780,7 @@ sysprof_capture_reader_read_counter_set (SysprofCaptureReader *self)
if (!sysprof_capture_reader_ensure_space_for (self, sizeof *set)) if (!sysprof_capture_reader_ensure_space_for (self, sizeof *set))
return NULL; return NULL;
set = (SysprofCaptureFrameCounterSet *)(gpointer)&self->buf[self->pos]; set = (SysprofCaptureCounterSet *)(gpointer)&self->buf[self->pos];
if (set->frame.type != SYSPROF_CAPTURE_FRAME_CTRSET) if (set->frame.type != SYSPROF_CAPTURE_FRAME_CTRSET)
return NULL; return NULL;
@ -797,7 +797,7 @@ sysprof_capture_reader_read_counter_set (SysprofCaptureReader *self)
if (!sysprof_capture_reader_ensure_space_for (self, set->frame.len)) if (!sysprof_capture_reader_ensure_space_for (self, set->frame.len))
return NULL; return NULL;
set = (SysprofCaptureFrameCounterSet *)(gpointer)&self->buf[self->pos]; set = (SysprofCaptureCounterSet *)(gpointer)&self->buf[self->pos];
if (G_UNLIKELY (self->endian != G_BYTE_ORDER)) if (G_UNLIKELY (self->endian != G_BYTE_ORDER))
{ {

View File

@ -74,9 +74,9 @@ const SysprofCaptureSample *sysprof_capture_reader_read_sample
SYSPROF_AVAILABLE_IN_ALL SYSPROF_AVAILABLE_IN_ALL
GHashTable *sysprof_capture_reader_read_jitmap (SysprofCaptureReader *self); GHashTable *sysprof_capture_reader_read_jitmap (SysprofCaptureReader *self);
SYSPROF_AVAILABLE_IN_ALL SYSPROF_AVAILABLE_IN_ALL
const SysprofCaptureFrameCounterDefine *sysprof_capture_reader_read_counter_define (SysprofCaptureReader *self); const SysprofCaptureCounterDefine *sysprof_capture_reader_read_counter_define (SysprofCaptureReader *self);
SYSPROF_AVAILABLE_IN_ALL SYSPROF_AVAILABLE_IN_ALL
const SysprofCaptureFrameCounterSet *sysprof_capture_reader_read_counter_set (SysprofCaptureReader *self); const SysprofCaptureCounterSet *sysprof_capture_reader_read_counter_set (SysprofCaptureReader *self);
SYSPROF_AVAILABLE_IN_ALL SYSPROF_AVAILABLE_IN_ALL
gboolean sysprof_capture_reader_reset (SysprofCaptureReader *self); gboolean sysprof_capture_reader_reset (SysprofCaptureReader *self);
SYSPROF_AVAILABLE_IN_ALL SYSPROF_AVAILABLE_IN_ALL

View File

@ -202,7 +202,7 @@ typedef struct
guint32 padding1 : 16; guint32 padding1 : 16;
guint32 padding2; guint32 padding2;
SysprofCaptureCounter counters[0]; SysprofCaptureCounter counters[0];
} SysprofCaptureFrameCounterDefine } SysprofCaptureCounterDefine
SYSPROF_ALIGNED_END(1); SYSPROF_ALIGNED_END(1);
SYSPROF_ALIGNED_BEGIN(1) SYSPROF_ALIGNED_BEGIN(1)
@ -226,7 +226,7 @@ typedef struct
guint32 padding1 : 16; guint32 padding1 : 16;
guint32 padding2; guint32 padding2;
SysprofCaptureCounterValues values[0]; SysprofCaptureCounterValues values[0];
} SysprofCaptureFrameCounterSet } SysprofCaptureCounterSet
SYSPROF_ALIGNED_END(1); SYSPROF_ALIGNED_END(1);
SYSPROF_ALIGNED_BEGIN(1) SYSPROF_ALIGNED_BEGIN(1)
@ -260,8 +260,8 @@ G_STATIC_ASSERT (sizeof (SysprofCaptureExit) == 24);
G_STATIC_ASSERT (sizeof (SysprofCaptureTimestamp) == 24); G_STATIC_ASSERT (sizeof (SysprofCaptureTimestamp) == 24);
G_STATIC_ASSERT (sizeof (SysprofCaptureCounter) == 128); G_STATIC_ASSERT (sizeof (SysprofCaptureCounter) == 128);
G_STATIC_ASSERT (sizeof (SysprofCaptureCounterValues) == 96); G_STATIC_ASSERT (sizeof (SysprofCaptureCounterValues) == 96);
G_STATIC_ASSERT (sizeof (SysprofCaptureFrameCounterDefine) == 32); G_STATIC_ASSERT (sizeof (SysprofCaptureCounterDefine) == 32);
G_STATIC_ASSERT (sizeof (SysprofCaptureFrameCounterSet) == 32); G_STATIC_ASSERT (sizeof (SysprofCaptureCounterSet) == 32);
G_STATIC_ASSERT (sizeof (SysprofCaptureMark) == 96); G_STATIC_ASSERT (sizeof (SysprofCaptureMark) == 96);
G_STATIC_ASSERT (sizeof (SysprofCaptureMetadata) == 64); G_STATIC_ASSERT (sizeof (SysprofCaptureMetadata) == 64);

View File

@ -308,7 +308,7 @@ sysprof_capture_writer_cat (SysprofCaptureWriter *self,
case SYSPROF_CAPTURE_FRAME_CTRDEF: case SYSPROF_CAPTURE_FRAME_CTRDEF:
{ {
const SysprofCaptureFrameCounterDefine *frame; const SysprofCaptureCounterDefine *frame;
if (!(frame = sysprof_capture_reader_read_counter_define (reader))) if (!(frame = sysprof_capture_reader_read_counter_define (reader)))
goto panic; goto panic;
@ -344,7 +344,7 @@ sysprof_capture_writer_cat (SysprofCaptureWriter *self,
case SYSPROF_CAPTURE_FRAME_CTRSET: case SYSPROF_CAPTURE_FRAME_CTRSET:
{ {
const SysprofCaptureFrameCounterSet *frame; const SysprofCaptureCounterSet *frame;
if (!(frame = sysprof_capture_reader_read_counter_set (reader))) if (!(frame = sysprof_capture_reader_read_counter_set (reader)))
goto panic; goto panic;

View File

@ -1111,7 +1111,7 @@ sysprof_capture_writer_define_counters (SysprofCaptureWriter *self,
const SysprofCaptureCounter *counters, const SysprofCaptureCounter *counters,
guint n_counters) guint n_counters)
{ {
SysprofCaptureFrameCounterDefine *def; SysprofCaptureCounterDefine *def;
gsize len; gsize len;
guint i; guint i;
@ -1123,7 +1123,7 @@ sysprof_capture_writer_define_counters (SysprofCaptureWriter *self,
len = sizeof *def + (sizeof *counters * n_counters); len = sizeof *def + (sizeof *counters * n_counters);
def = (SysprofCaptureFrameCounterDefine *)sysprof_capture_writer_allocate (self, &len); def = (SysprofCaptureCounterDefine *)sysprof_capture_writer_allocate (self, &len);
if (!def) if (!def)
return FALSE; return FALSE;
@ -1162,7 +1162,7 @@ sysprof_capture_writer_set_counters (SysprofCaptureWriter *self,
const SysprofCaptureCounterValue *values, const SysprofCaptureCounterValue *values,
guint n_counters) guint n_counters)
{ {
SysprofCaptureFrameCounterSet *set; SysprofCaptureCounterSet *set;
gsize len; gsize len;
guint n_groups; guint n_groups;
guint group; guint group;
@ -1183,7 +1183,7 @@ sysprof_capture_writer_set_counters (SysprofCaptureWriter *self,
len = sizeof *set + (n_groups * sizeof (SysprofCaptureCounterValues)); len = sizeof *set + (n_groups * sizeof (SysprofCaptureCounterValues));
set = (SysprofCaptureFrameCounterSet *)sysprof_capture_writer_allocate (self, &len); set = (SysprofCaptureCounterSet *)sysprof_capture_writer_allocate (self, &len);
if (!set) if (!set)
return FALSE; return FALSE;

View File

@ -39,7 +39,7 @@ static gboolean
sysprof_cpu_visualizer_counter_found (const SysprofCaptureFrame *frame, sysprof_cpu_visualizer_counter_found (const SysprofCaptureFrame *frame,
gpointer user_data) gpointer user_data)
{ {
const SysprofCaptureFrameCounterDefine *def = (SysprofCaptureFrameCounterDefine *)frame; const SysprofCaptureCounterDefine *def = (SysprofCaptureCounterDefine *)frame;
GArray *counters = user_data; GArray *counters = user_data;
gboolean found = FALSE; gboolean found = FALSE;

View File

@ -581,7 +581,7 @@ sysprof_line_visualizer_row_load_data_frame_cb (const SysprofCaptureFrame *frame
if (frame->type == SYSPROF_CAPTURE_FRAME_CTRSET) if (frame->type == SYSPROF_CAPTURE_FRAME_CTRSET)
{ {
const SysprofCaptureFrameCounterSet *set = (SysprofCaptureFrameCounterSet *)frame; const SysprofCaptureCounterSet *set = (SysprofCaptureCounterSet *)frame;
gdouble x = calc_x (load->begin_time, load->end_time, frame->time); gdouble x = calc_x (load->begin_time, load->end_time, frame->time);
for (guint i = 0; i < set->n_values; i++) for (guint i = 0; i < set->n_values; i++)
@ -625,7 +625,7 @@ sysprof_line_visualizer_row_load_data_range_cb (const SysprofCaptureFrame *frame
if (frame->type == SYSPROF_CAPTURE_FRAME_CTRSET) if (frame->type == SYSPROF_CAPTURE_FRAME_CTRSET)
{ {
const SysprofCaptureFrameCounterSet *set = (SysprofCaptureFrameCounterSet *)frame; const SysprofCaptureCounterSet *set = (SysprofCaptureCounterSet *)frame;
for (guint i = 0; i < set->n_values; i++) for (guint i = 0; i < set->n_values; i++)
{ {

View File

@ -333,7 +333,7 @@ cursor_foreach_cb (const SysprofCaptureFrame *frame,
} }
else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF) else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF)
{ {
SysprofCaptureFrameCounterDefine *ctrdef = (SysprofCaptureFrameCounterDefine *)frame; SysprofCaptureCounterDefine *ctrdef = (SysprofCaptureCounterDefine *)frame;
for (guint i = 0; i < ctrdef->n_counters; i++) for (guint i = 0; i < ctrdef->n_counters; i++)
{ {
@ -346,7 +346,7 @@ cursor_foreach_cb (const SysprofCaptureFrame *frame,
} }
else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRSET) else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRSET)
{ {
SysprofCaptureFrameCounterSet *ctrset = (SysprofCaptureFrameCounterSet *)frame; SysprofCaptureCounterSet *ctrset = (SysprofCaptureCounterSet *)frame;
for (guint i = 0; i < ctrset->n_values; i++) for (guint i = 0; i < ctrset->n_values; i++)
{ {

View File

@ -229,7 +229,7 @@ discover_new_rows_frame_cb (const SysprofCaptureFrame *frame,
} }
else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF) else if (frame->type == SYSPROF_CAPTURE_FRAME_CTRDEF)
{ {
const SysprofCaptureFrameCounterDefine *def = (const SysprofCaptureFrameCounterDefine *)frame; const SysprofCaptureCounterDefine *def = (const SysprofCaptureCounterDefine *)frame;
for (guint i = 0; i < def->n_counters; i++) for (guint i = 0; i < def->n_counters; i++)
{ {

View File

@ -216,7 +216,7 @@ test_reader_basic (void)
sysprof_capture_writer_flush (writer); sysprof_capture_writer_flush (writer);
{ {
const SysprofCaptureFrameCounterDefine *def; const SysprofCaptureCounterDefine *def;
def = sysprof_capture_reader_read_counter_define (reader); def = sysprof_capture_reader_read_counter_define (reader);
g_assert (def != NULL); g_assert (def != NULL);
@ -247,7 +247,7 @@ test_reader_basic (void)
for (i = 0; i < 1000; i++) for (i = 0; i < 1000; i++)
{ {
const SysprofCaptureFrameCounterSet *set; const SysprofCaptureCounterSet *set;
set = sysprof_capture_reader_read_counter_set (reader); set = sysprof_capture_reader_read_counter_set (reader);
g_assert (set != NULL); g_assert (set != NULL);

View File

@ -344,7 +344,7 @@ main (gint argc,
case SYSPROF_CAPTURE_FRAME_CTRDEF: case SYSPROF_CAPTURE_FRAME_CTRDEF:
{ {
const SysprofCaptureFrameCounterDefine *frame; const SysprofCaptureCounterDefine *frame;
if (!(frame = sysprof_capture_reader_read_counter_define (reader))) if (!(frame = sysprof_capture_reader_read_counter_define (reader)))
goto panic; goto panic;
@ -380,7 +380,7 @@ main (gint argc,
case SYSPROF_CAPTURE_FRAME_CTRSET: case SYSPROF_CAPTURE_FRAME_CTRSET:
{ {
const SysprofCaptureFrameCounterSet *frame; const SysprofCaptureCounterSet *frame;
if (!(frame = sysprof_capture_reader_read_counter_set (reader))) if (!(frame = sysprof_capture_reader_read_counter_set (reader)))
goto panic; goto panic;

View File

@ -189,7 +189,7 @@ main (gint argc,
case SYSPROF_CAPTURE_FRAME_CTRDEF: case SYSPROF_CAPTURE_FRAME_CTRDEF:
{ {
const SysprofCaptureFrameCounterDefine *def = sysprof_capture_reader_read_counter_define (reader); const SysprofCaptureCounterDefine *def = sysprof_capture_reader_read_counter_define (reader);
guint i; guint i;
g_print ("NEW COUNTERS: pid=%d time=%"G_GINT64_FORMAT"\n", def->frame.pid, def->frame.time); g_print ("NEW COUNTERS: pid=%d time=%"G_GINT64_FORMAT"\n", def->frame.pid, def->frame.time);
@ -211,7 +211,7 @@ main (gint argc,
case SYSPROF_CAPTURE_FRAME_CTRSET: case SYSPROF_CAPTURE_FRAME_CTRSET:
{ {
const SysprofCaptureFrameCounterSet *set = sysprof_capture_reader_read_counter_set (reader); const SysprofCaptureCounterSet *set = sysprof_capture_reader_read_counter_set (reader);
guint i; guint i;
g_print ("SET COUNTERS: pid=%d time=%"G_GINT64_FORMAT"\n", set->frame.pid, set->frame.time); g_print ("SET COUNTERS: pid=%d time=%"G_GINT64_FORMAT"\n", set->frame.pid, set->frame.time);