util: optimize dumping instance timezone handling
We can assume that such instances will not see a timezone
change happen during their lifetime, and even if they do,
it is probably best if they ignore it (a dump would ideally
behave as if it was atomic). This means we can optimize the
behaviour where printing the timestamp requires us to check
whether the timezone changed, which involves calling stat()
on /etc/localtime, which is not cheap on its own and made
even worse when multiple symlinks are involves.
glibc has a feature where setting the TZ environmental var
will cache the timezone, achieving precisely what we want.
Change-Id: I2f5e26a4be81b8f846036282fc1a0bfe02b70b48
Signed-off-by: Michal Bloch <m.bloch@samsung.com>