mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
capture: make counter value a union of int64 and double
This allows us to use the type field of the counter to specify if the counter is a double or a 64-bit integer.
This commit is contained in:
@ -606,7 +606,7 @@ sp_capture_reader_read_counter_define (SpCaptureReader *self)
|
||||
for (i = 0; i < def->n_counters; i++)
|
||||
{
|
||||
def->counters[i].id = GUINT32_SWAP_LE_BE (def->counters[i].id);
|
||||
def->counters[i].value = GUINT64_SWAP_LE_BE (def->counters[i].value);
|
||||
def->counters[i].value.v64 = GUINT64_SWAP_LE_BE (def->counters[i].value.v64);
|
||||
}
|
||||
}
|
||||
|
||||
@ -657,7 +657,7 @@ sp_capture_reader_read_counter_set (SpCaptureReader *self)
|
||||
for (j = 0; j < G_N_ELEMENTS (set->values[0].values); i++)
|
||||
{
|
||||
set->values[i].ids[j] = GUINT32_SWAP_LE_BE (set->values[i].ids[j]);
|
||||
set->values[i].values[j] = GUINT64_SWAP_LE_BE (set->values[i].values[j]);
|
||||
set->values[i].values[j].v64 = GUINT64_SWAP_LE_BE (set->values[i].values[j].v64);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user