test: Fix unittest cprintftime's build.
authorGabe Black <gabeblack@google.com>
Tue, 1 Sep 2020 03:52:24 +0000 (20:52 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 1 Sep 2020 21:53:42 +0000 (21:53 +0000)
commit52f5cd2f67ce4c823fa2d05bc0caf7228896e95b
treead55c4b01811f6bbf2c3d52f410183f06a11236a
parente2fc29076a694df349a2435c7f80fb5eeeb0f532
test: Fix unittest cprintftime's build.

This test, which measures the performance of cprintf vs. sprintf, was
missing a couple of includes which were needed for the alarm() and
signal() functions, as well as the SIGALRM constant.

Also, it was using %#x to print the value of a pointer which gcc
complained about when compiling sprintf. This is fixed by changing that
format specifier to %p, the specifier to use when printing pointers.
Apparently either the implicit conversion to an integer value (which %#x
expects) or the size of the type it was converted to weren't good enough
for gcc any more.

Change-Id: I8eca3479bef2c2fa79f8ef4881bb3ff35d7c54ca
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33897
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/unittest/cprintftime.cc