greybus: loopback: timestamp seeding should not drop metrics
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Tue, 21 Jul 2015 22:50:06 +0000 (23:50 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 22 Jul 2015 17:46:53 +0000 (10:46 -0700)
commit3156be7deec47564853d13308090828c35f89cb9
treeae0d83a08f30186a980c3761eec3422129a849b3
parent09fb10fe4fc04785eb8a0065c64dd9728ed71dbe
greybus: loopback: timestamp seeding should not drop metrics

In the current code if the ts variable is not initialized then any data
already gathered in a previous loopback command is dropped instead of
logged. Also the timestamping of ts is done after the greybus operation.

This delayed time-stamping means that the delta between the before and
after timestamps is incorrect and if a delay in-between loopback operations
has been specified by the user, the ts timestamp will be very skewed
indeed.

- Move the ts initialization directly before the greybus operation.
- Remove the continue statement on first initialization of the ts variable.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/loopback.c