mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
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.
This commit is contained in:
@ -88,7 +88,7 @@ sp_capture_condition_match (const SpCaptureCondition *self,
|
|||||||
case SP_CAPTURE_CONDITION_WHERE_PID_IN:
|
case SP_CAPTURE_CONDITION_WHERE_PID_IN:
|
||||||
for (guint i = 0; i < self->u.where_pid_in->len; i++)
|
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 TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -169,7 +169,7 @@ sp_capture_condition_copy (const SpCaptureCondition *self)
|
|||||||
case SP_CAPTURE_CONDITION_WHERE_PID_IN:
|
case SP_CAPTURE_CONDITION_WHERE_PID_IN:
|
||||||
return sp_capture_condition_new_where_pid_in (
|
return sp_capture_condition_new_where_pid_in (
|
||||||
self->u.where_pid_in->len,
|
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:
|
case SP_CAPTURE_CONDITION_WHERE_COUNTER_IN:
|
||||||
return sp_capture_condition_new_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 *
|
SpCaptureCondition *
|
||||||
sp_capture_condition_new_where_pid_in (guint n_pids,
|
sp_capture_condition_new_where_pid_in (guint n_pids,
|
||||||
const GPid *pids)
|
const gint32 *pids)
|
||||||
{
|
{
|
||||||
SpCaptureCondition *self;
|
SpCaptureCondition *self;
|
||||||
|
|
||||||
@ -270,9 +270,9 @@ sp_capture_condition_new_where_pid_in (guint n_pids,
|
|||||||
|
|
||||||
self = g_slice_new0 (SpCaptureCondition);
|
self = g_slice_new0 (SpCaptureCondition);
|
||||||
self->type = SP_CAPTURE_CONDITION_WHERE_PID_IN;
|
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);
|
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;
|
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,
|
SpCaptureCondition *sp_capture_condition_new_where_time_between (gint64 begin_time,
|
||||||
gint64 end_time);
|
gint64 end_time);
|
||||||
SpCaptureCondition *sp_capture_condition_new_where_pid_in (guint n_pids,
|
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,
|
SpCaptureCondition *sp_capture_condition_new_where_counter_in (guint n_counters,
|
||||||
const guint *counters);
|
const guint *counters);
|
||||||
gboolean sp_capture_condition_match (const SpCaptureCondition *self,
|
gboolean sp_capture_condition_match (const SpCaptureCondition *self,
|
||||||
|
|||||||
@ -106,7 +106,7 @@ static inline void
|
|||||||
sp_capture_writer_frame_init (SpCaptureFrame *frame_,
|
sp_capture_writer_frame_init (SpCaptureFrame *frame_,
|
||||||
gint len,
|
gint len,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
gint64 time_,
|
gint64 time_,
|
||||||
SpCaptureFrameType type)
|
SpCaptureFrameType type)
|
||||||
{
|
{
|
||||||
@ -256,7 +256,7 @@ sp_capture_writer_flush_jitmap (SpCaptureWriter *self)
|
|||||||
sp_capture_writer_frame_init (&jitmap.frame,
|
sp_capture_writer_frame_init (&jitmap.frame,
|
||||||
len,
|
len,
|
||||||
-1,
|
-1,
|
||||||
getpid (),
|
_sp_getpid (),
|
||||||
SP_CAPTURE_CURRENT_TIME,
|
SP_CAPTURE_CURRENT_TIME,
|
||||||
SP_CAPTURE_FRAME_JITMAP);
|
SP_CAPTURE_FRAME_JITMAP);
|
||||||
jitmap.n_jitmaps = self->addr_hash_size;
|
jitmap.n_jitmaps = self->addr_hash_size;
|
||||||
@ -497,7 +497,7 @@ gboolean
|
|||||||
sp_capture_writer_add_map (SpCaptureWriter *self,
|
sp_capture_writer_add_map (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
guint64 start,
|
guint64 start,
|
||||||
guint64 end,
|
guint64 end,
|
||||||
guint64 offset,
|
guint64 offset,
|
||||||
@ -542,7 +542,7 @@ gboolean
|
|||||||
sp_capture_writer_add_mark (SpCaptureWriter *self,
|
sp_capture_writer_add_mark (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
guint64 duration,
|
guint64 duration,
|
||||||
const gchar *group,
|
const gchar *group,
|
||||||
const gchar *name,
|
const gchar *name,
|
||||||
@ -604,7 +604,7 @@ gboolean
|
|||||||
sp_capture_writer_add_process (SpCaptureWriter *self,
|
sp_capture_writer_add_process (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
const gchar *cmdline)
|
const gchar *cmdline)
|
||||||
{
|
{
|
||||||
SpCaptureProcess *ev;
|
SpCaptureProcess *ev;
|
||||||
@ -641,7 +641,7 @@ gboolean
|
|||||||
sp_capture_writer_add_sample (SpCaptureWriter *self,
|
sp_capture_writer_add_sample (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
const SpCaptureAddress *addrs,
|
const SpCaptureAddress *addrs,
|
||||||
guint n_addrs)
|
guint n_addrs)
|
||||||
{
|
{
|
||||||
@ -675,8 +675,8 @@ gboolean
|
|||||||
sp_capture_writer_add_fork (SpCaptureWriter *self,
|
sp_capture_writer_add_fork (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
GPid child_pid)
|
gint32 child_pid)
|
||||||
{
|
{
|
||||||
SpCaptureFork *ev;
|
SpCaptureFork *ev;
|
||||||
gsize len = sizeof *ev;
|
gsize len = sizeof *ev;
|
||||||
@ -704,7 +704,7 @@ gboolean
|
|||||||
sp_capture_writer_add_exit (SpCaptureWriter *self,
|
sp_capture_writer_add_exit (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid)
|
gint32 pid)
|
||||||
{
|
{
|
||||||
SpCaptureExit *ev;
|
SpCaptureExit *ev;
|
||||||
gsize len = sizeof *ev;
|
gsize len = sizeof *ev;
|
||||||
@ -731,7 +731,7 @@ gboolean
|
|||||||
sp_capture_writer_add_timestamp (SpCaptureWriter *self,
|
sp_capture_writer_add_timestamp (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid)
|
gint32 pid)
|
||||||
{
|
{
|
||||||
SpCaptureTimestamp *ev;
|
SpCaptureTimestamp *ev;
|
||||||
gsize len = sizeof *ev;
|
gsize len = sizeof *ev;
|
||||||
@ -1051,7 +1051,7 @@ gboolean
|
|||||||
sp_capture_writer_define_counters (SpCaptureWriter *self,
|
sp_capture_writer_define_counters (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
const SpCaptureCounter *counters,
|
const SpCaptureCounter *counters,
|
||||||
guint n_counters)
|
guint n_counters)
|
||||||
{
|
{
|
||||||
@ -1101,7 +1101,7 @@ gboolean
|
|||||||
sp_capture_writer_set_counters (SpCaptureWriter *self,
|
sp_capture_writer_set_counters (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
const guint *counters_ids,
|
const guint *counters_ids,
|
||||||
const SpCaptureCounterValue *values,
|
const SpCaptureCounterValue *values,
|
||||||
guint n_counters)
|
guint n_counters)
|
||||||
|
|||||||
@ -49,7 +49,7 @@ void sp_capture_writer_stat (SpCaptureWriter *
|
|||||||
gboolean sp_capture_writer_add_map (SpCaptureWriter *self,
|
gboolean sp_capture_writer_add_map (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
guint64 start,
|
guint64 start,
|
||||||
guint64 end,
|
guint64 end,
|
||||||
guint64 offset,
|
guint64 offset,
|
||||||
@ -58,7 +58,7 @@ gboolean sp_capture_writer_add_map (SpCaptureWriter *
|
|||||||
gboolean sp_capture_writer_add_mark (SpCaptureWriter *self,
|
gboolean sp_capture_writer_add_mark (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
guint64 duration,
|
guint64 duration,
|
||||||
const gchar *group,
|
const gchar *group,
|
||||||
const gchar *name,
|
const gchar *name,
|
||||||
@ -68,37 +68,37 @@ guint64 sp_capture_writer_add_jitmap (SpCaptureWriter *
|
|||||||
gboolean sp_capture_writer_add_process (SpCaptureWriter *self,
|
gboolean sp_capture_writer_add_process (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
const gchar *cmdline);
|
const gchar *cmdline);
|
||||||
gboolean sp_capture_writer_add_sample (SpCaptureWriter *self,
|
gboolean sp_capture_writer_add_sample (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
const SpCaptureAddress *addrs,
|
const SpCaptureAddress *addrs,
|
||||||
guint n_addrs);
|
guint n_addrs);
|
||||||
gboolean sp_capture_writer_add_fork (SpCaptureWriter *self,
|
gboolean sp_capture_writer_add_fork (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
GPid child_pid);
|
gint32 child_pid);
|
||||||
gboolean sp_capture_writer_add_exit (SpCaptureWriter *self,
|
gboolean sp_capture_writer_add_exit (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid);
|
gint32 pid);
|
||||||
gboolean sp_capture_writer_add_timestamp (SpCaptureWriter *self,
|
gboolean sp_capture_writer_add_timestamp (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid);
|
gint32 pid);
|
||||||
gboolean sp_capture_writer_define_counters (SpCaptureWriter *self,
|
gboolean sp_capture_writer_define_counters (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
const SpCaptureCounter *counters,
|
const SpCaptureCounter *counters,
|
||||||
guint n_counters);
|
guint n_counters);
|
||||||
gboolean sp_capture_writer_set_counters (SpCaptureWriter *self,
|
gboolean sp_capture_writer_set_counters (SpCaptureWriter *self,
|
||||||
gint64 time,
|
gint64 time,
|
||||||
gint cpu,
|
gint cpu,
|
||||||
GPid pid,
|
gint32 pid,
|
||||||
const guint *counters_ids,
|
const guint *counters_ids,
|
||||||
const SpCaptureCounterValue *values,
|
const SpCaptureCounterValue *values,
|
||||||
guint n_counters);
|
guint n_counters);
|
||||||
|
|||||||
Reference in New Issue
Block a user