mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 08:00:53 +00:00
tests: ensure we sort by time after pid/tid
This commit is contained in:
@ -32,6 +32,7 @@ typedef struct
|
|||||||
{
|
{
|
||||||
gint pid;
|
gint pid;
|
||||||
gint tid;
|
gint tid;
|
||||||
|
gint64 time;
|
||||||
SysprofCaptureAddress addr;
|
SysprofCaptureAddress addr;
|
||||||
gint64 size;
|
gint64 size;
|
||||||
} Alloc;
|
} Alloc;
|
||||||
@ -53,6 +54,11 @@ compare_alloc (gconstpointer a,
|
|||||||
else if (aptr->tid > bptr->tid)
|
else if (aptr->tid > bptr->tid)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
if (aptr->time < bptr->time)
|
||||||
|
return -1;
|
||||||
|
else if (aptr->time > bptr->time)
|
||||||
|
return 1;
|
||||||
|
|
||||||
if (aptr->addr < bptr->addr)
|
if (aptr->addr < bptr->addr)
|
||||||
return -1;
|
return -1;
|
||||||
else if (aptr->addr > bptr->addr)
|
else if (aptr->addr > bptr->addr)
|
||||||
@ -84,6 +90,7 @@ find_temp_allocs (SysprofCaptureReader *reader)
|
|||||||
|
|
||||||
a.pid = ev->frame.pid;
|
a.pid = ev->frame.pid;
|
||||||
a.tid = ev->tid;
|
a.tid = ev->tid;
|
||||||
|
a.time = ev->frame.time;
|
||||||
a.addr = ev->alloc_addr;
|
a.addr = ev->alloc_addr;
|
||||||
a.size = ev->alloc_size;
|
a.size = ev->alloc_size;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user