Skip to content

Commit

Permalink
Properly initialize clone_ts.
Browse files Browse the repository at this point in the history
Initialize clone_ts when using a stack-residing scap_threadinfo to read
from a proclist. Otherwise, when reading from an old trace file the
initial clone_ts could be invalid, causing this difference in the
proc_exec_time chisel:

diff -r /tmp/sysdig.NzoD98EsyQ/results/proc_exec_time/wordpress.scap.output /tmp/sysdig.NzoD98EsyQ/baseline/proc_exec_time/wordpress.scap.output
3d2
< 1425066765.22 sleep        0.1
  • Loading branch information
mstemm committed Jan 26, 2017
1 parent 9fb749f commit 0c1ca0f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions userspace/libscap/scap_savefile.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ static int32_t scap_read_proclist(scap_t *handle, gzFile f, uint32_t block_lengt
tinfo.filtered_out = 0;
tinfo.root[0] = 0;
tinfo.sid = -1;
tinfo.clone_ts = 0;

while(((int32_t)block_length - (int32_t)totreadsize) >= 4)
{
Expand Down

0 comments on commit 0c1ca0f

Please sign in to comment.