base: only commit useful trace events

If the length of a trace event entry is zero it should be ommitted.

Fixes #851.