Commit 607ef387 authored by Christian Hergert's avatar Christian Hergert

capture: use gint32 instead of GPid

GPid just isn't portable as a data type for on-disk storage, so
be more explicit and use gint32 directly.
parent 191754e5
......@@ -88,7 +88,7 @@ sp_capture_condition_match (const SpCaptureCondition *self,
case SP_CAPTURE_CONDITION_WHERE_PID_IN:
for (guint i = 0; i < self->u.where_pid_in->len; i++)
{
if (frame->pid == g_array_index (self->u.where_pid_in, GPid, i))
if (frame->pid == g_array_index (self->u.where_pid_in, gint32, i))
return TRUE;
}
return FALSE;
......@@ -169,7 +169,7 @@ sp_capture_condition_copy (const SpCaptureCondition *self)
case SP_CAPTURE_CONDITION_WHERE_PID_IN:
return sp_capture_condition_new_where_pid_in (
self->u.where_pid_in->len,
(const GPid *)(gpointer)self->u.where_pid_in->data);
(const gint32 *)(gpointer)self->u.where_pid_in->data);
case SP_CAPTURE_CONDITION_WHERE_COUNTER_IN:
return sp_capture_condition_new_where_counter_in (
......@@ -261,8 +261,8 @@ sp_capture_condition_new_where_time_between (gint64 begin_time,
}
SpCaptureCondition *
sp_capture_condition_new_where_pid_in (guint n_pids,
const GPid *pids)
sp_capture_condition_new_where_pid_in (guint n_pids,
const gint32 *pids)
{
SpCaptureCondition *self;
......@@ -270,9 +270,9 @@ sp_capture_condition_new_where_pid_in (guint n_pids,
self = g_slice_new0 (SpCaptureCondition);
self->type = SP_CAPTURE_CONDITION_WHERE_PID_IN;
self->u.where_pid_in = g_array_sized_new (FALSE, FALSE, sizeof (GPid), n_pids);
self->u.where_pid_in = g_array_sized_new (FALSE, FALSE, sizeof (gint32), n_pids);
g_array_set_size (self->u.where_pid_in, n_pids);
memcpy (self->u.where_pid_in->data, pids, sizeof (GPid) * n_pids);
memcpy (self->u.where_pid_in->data, pids, sizeof (gint32) * n_pids);
return self;
}
......
......@@ -35,7 +35,7 @@ SpCaptureCondition *sp_capture_condition_new_where_type_in (guint
SpCaptureCondition *sp_capture_condition_new_where_time_between (gint64 begin_time,
gint64 end_time);
SpCaptureCondition *sp_capture_condition_new_where_pid_in (guint n_pids,
const GPid *pids);
const gint32 *pids);
SpCaptureCondition *sp_capture_condition_new_where_counter_in (guint n_counters,
const guint *counters);
gboolean sp_capture_condition_match (const SpCaptureCondition *self,
......
......@@ -106,7 +106,7 @@ static inline void
sp_capture_writer_frame_init (SpCaptureFrame *frame_,
gint len,
gint cpu,
GPid pid,
gint32 pid,
gint64 time_,
SpCaptureFrameType type)
{
......@@ -256,7 +256,7 @@ sp_capture_writer_flush_jitmap (SpCaptureWriter *self)
sp_capture_writer_frame_init (&jitmap.frame,
len,
-1,
getpid (),
_sp_getpid (),
SP_CAPTURE_CURRENT_TIME,
SP_CAPTURE_FRAME_JITMAP);
jitmap.n_jitmaps = self->addr_hash_size;
......@@ -497,7 +497,7 @@ gboolean
sp_capture_writer_add_map (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
gint32 pid,
guint64 start,
guint64 end,
guint64 offset,
......@@ -542,7 +542,7 @@ gboolean
sp_capture_writer_add_mark (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
gint32 pid,
guint64 duration,
const gchar *group,
const gchar *name,
......@@ -604,7 +604,7 @@ gboolean
sp_capture_writer_add_process (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
gint32 pid,
const gchar *cmdline)
{
SpCaptureProcess *ev;
......@@ -641,7 +641,7 @@ gboolean
sp_capture_writer_add_sample (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
gint32 pid,
const SpCaptureAddress *addrs,
guint n_addrs)
{
......@@ -675,8 +675,8 @@ gboolean
sp_capture_writer_add_fork (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
GPid child_pid)
gint32 pid,
gint32 child_pid)
{
SpCaptureFork *ev;
gsize len = sizeof *ev;
......@@ -704,7 +704,7 @@ gboolean
sp_capture_writer_add_exit (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid)
gint32 pid)
{
SpCaptureExit *ev;
gsize len = sizeof *ev;
......@@ -731,7 +731,7 @@ gboolean
sp_capture_writer_add_timestamp (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid)
gint32 pid)
{
SpCaptureTimestamp *ev;
gsize len = sizeof *ev;
......@@ -1051,7 +1051,7 @@ gboolean
sp_capture_writer_define_counters (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
gint32 pid,
const SpCaptureCounter *counters,
guint n_counters)
{
......@@ -1101,7 +1101,7 @@ gboolean
sp_capture_writer_set_counters (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
gint32 pid,
const guint *counters_ids,
const SpCaptureCounterValue *values,
guint n_counters)
......
......@@ -49,7 +49,7 @@ void sp_capture_writer_stat (SpCaptureWriter *
gboolean sp_capture_writer_add_map (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
gint32 pid,
guint64 start,
guint64 end,
guint64 offset,
......@@ -58,7 +58,7 @@ gboolean sp_capture_writer_add_map (SpCaptureWriter *
gboolean sp_capture_writer_add_mark (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
gint32 pid,
guint64 duration,
const gchar *group,
const gchar *name,
......@@ -68,37 +68,37 @@ guint64 sp_capture_writer_add_jitmap (SpCaptureWriter *
gboolean sp_capture_writer_add_process (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
gint32 pid,
const gchar *cmdline);
gboolean sp_capture_writer_add_sample (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
gint32 pid,
const SpCaptureAddress *addrs,
guint n_addrs);
gboolean sp_capture_writer_add_fork (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
GPid child_pid);
gint32 pid,
gint32 child_pid);
gboolean sp_capture_writer_add_exit (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid);
gint32 pid);
gboolean sp_capture_writer_add_timestamp (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid);
gint32 pid);
gboolean sp_capture_writer_define_counters (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
gint32 pid,
const SpCaptureCounter *counters,
guint n_counters);
gboolean sp_capture_writer_set_counters (SpCaptureWriter *self,
gint64 time,
gint cpu,
GPid pid,
gint32 pid,
const guint *counters_ids,
const SpCaptureCounterValue *values,
guint n_counters);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment