util: optimize dumping instance timezone handling 02/191502/2
authorMichal Bloch <m.bloch@samsung.com>
Wed, 17 Oct 2018 12:08:39 +0000 (14:08 +0200)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Mon, 22 Oct 2018 03:01:40 +0000 (03:01 +0000)
commit6f82369e504c8968b582c1da863ba0801d5f0af0
treeb5c720ff68348a2a1a1ccae1199e4d9a2e27a01c
parentd6c8da71eab134fe49e50043cd2f67829e0d2351
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>
src/logutil/logutil.c