mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-09 22:50:54 +00:00
libsysprof-analyze: fix various swap calculations
This commit is contained in:
@ -135,11 +135,11 @@ swap_int32 (gboolean needs_swap,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline gint64
|
||||||
swap_int64 (gboolean needs_swap,
|
swap_int64 (gboolean needs_swap,
|
||||||
gint64 value)
|
gint64 value)
|
||||||
{
|
{
|
||||||
if (!needs_swap)
|
if G_LIKELY (!needs_swap)
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||||
@ -1150,7 +1150,7 @@ sysprof_document_load_worker (GTask *task,
|
|||||||
{
|
{
|
||||||
const SysprofCaptureMark *mark = (const SysprofCaptureMark *)tainted;
|
const SysprofCaptureMark *mark = (const SysprofCaptureMark *)tainted;
|
||||||
const char *endptr = (const char *)tainted + ptr->length;
|
const char *endptr = (const char *)tainted + ptr->length;
|
||||||
gint64 duration = self->needs_swap ? GUINT64_SWAP_LE_BE (mark->duration) : mark->duration;
|
gint64 duration = swap_int64 (self->needs_swap, mark->duration);
|
||||||
|
|
||||||
if (t + duration > guessed_end_nsec)
|
if (t + duration > guessed_end_nsec)
|
||||||
guessed_end_nsec = t + duration;
|
guessed_end_nsec = t + duration;
|
||||||
|
|||||||
Reference in New Issue
Block a user