logd: optimize code hotspots
am: f9162cf711  -s ours

* commit 'f9162cf711abd55ccb1c6f9d5f4805b96471c88f':
  logd: optimize code hotspots