This is an output of strace -T -ttt -ff -x -y -o pid.trace -p 2145
. Trace given below.
1503431273.934716 semop(1204093022, {{0, 1, SEM_UNDO}}, 1) = 0 <0.000004> 1503431273.934737 clock_gettime(CLOCK_REALTIME, {1503431273, 934741536}) = 0 <0.000004> 1503431273.934763 write(6</home/red/samples/debug/hexa.debug>, "17.08.23 01:17:53 [ hexa:2145"..., 79) = 79 <0.000016> 1503431273.934960 brk(0) = 0x1adc000 <0.000004> 1503431273.934974 brk(0x1afd000) = 0x1afd000 <0.000006> 1503431273.934994 brk(0) = 0x1afd000 <0.000003> 1503431273.935006 brk(0) = 0x1afd000 <0.000004> 1503431273.935017 brk(0x1afc000) = 0x1afc000 <0.000008> 1503431273.935033 brk(0) = 0x1afc000 <0.000003> 1503431273.935045 brk(0) = 0x1afc000 <0.000004> 1503431273.935057 brk(0) = 0x1afc000 <0.000004> 1503431273.935068 brk(0x1afb000) = 0x1afb000 <0.000005> 1503431273.935080 brk(0) = 0x1afb000 <0.000003> 1503431291.010338 brk(0) = 0x1afb000 <0.000006> 1503431291.010366 brk(0x1b1c000) = 0x1b1c000 <0.000006> 1503431291.010391 brk(0) = 0x1b1c000 <0.000003> 1503431291.010403 brk(0) = 0x1b1c000 <0.000004> 1503431291.010414 brk(0x1b12000) = 0x1b12000 <0.000008> 1503431291.010430 brk(0) = 0x1b12000 <0.000004> 1503431291.010443 brk(0) = 0x1b12000 <0.000004> 1503431291.010455 brk(0) = 0x1b12000 <0.000003> 1503431291.010466 brk(0x1b11000) = 0x1b11000 <0.000004> 1503431291.010478 brk(0) = 0x1b11000 <0.000004> 1503431301.277050 clock_gettime(CLOCK_REALTIME, {1503431301, 277067441}) = 0 <0.000005> 1503431301.277094 write(6</home/red/samples/debug/hexa.debug>, "17.08.23 01:18:21 [ hexa:2145"..., 91) = 91 <0.000019> 1503431301.277201 clock_gettime(CLOCK_REALTIME, {1503431301, 277216542}) = 0 <0.000005> 1503431301.277234 write(6</home/red/samples/debug/hexa.debug>, "17.08.23 01:18:21 [ hexa:2145"..., 126) = 126 <0.000018> 1503431301.277296 clock_gettime(CLOCK_REALTIME, {1503431301, 277301142}) = 0 <0.000004> 1503431301.277317 write(6</home/red/samples/debug/hexa.debug>, "17.08.23 01:18:21 [ hexa:2145"..., 126) = 126 <0.000012> 1503431301.288030 clock_gettime(CLOCK_REALTIME, {1503431301, 288037704}) = 0 <0.000004>
if you look at the above trace at two brk(0)s (please see 1503431273.935080 and 1503431291.010478) taking too much time, around 17 seconds and 10 seconds respectively (comparing left side time). But execution time in the right side is just minimal. I have done multiple runs of this program, in the same Redhat Linux box (7.2), all runs were giving same timings (with microseconds difference) at same place of system call (brk(0)).
What could be the issue? is it at Programming Level or OS level? I am not having source code for this, but I know it is a c/c++ program.