MPS issue job003332

Titleeventcnv outputs an empty bucket when you specify a bucket size
Statusclosed
Priorityoptional
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionIf you run the eventcnv program passing a bucket size (-b) argument, then the first bucket is always empty.
AnalysisThe offending code is in eventcnv.c:

    if (bucketSize != 0 && eventTime >= bucketLimit) {
      reportBucketResults(bucketLimit-1);
      clearBucket();

There's no check to see if the bucket is empty, which it will be when the first event is encountered (unless its eventTime is less than the bucket limit).

See also job003331, job003333, and job003335, which also affect this region of code.
How foundmanual_test
EvidenceHere's a run on a small example (483 events):

    $ eventcnv -e all -SL -b 1000000000
    (000000003B9AC9FF 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
    (000007DC7DC16553803 0 0 0 0 0 0 0 0 0 0 0 64 12 41 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 64 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1E3)
    (t 0 0 0 0 0 0 0 0 0 0 0 64 12 41 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 64 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1E3)

Note that the first bucket is empty, and all events appear in the second bucket.
Observed in1.110.0
Created byGareth Rees
Created on2012-10-21 15:44:30
Last modified byGareth Rees
Last modified on2012-10-23 14:28:22
History2012-10-21 GDR Created.

Fixes

Change Effect Date User Description
180028 closed 2012-10-23 14:28:22 Gareth Rees Remove reporting features from eventcnv, as discussed with RB. Eventcnv was always intended to be a simple tool that just translates events, not a report generator. In particular:
* Remove -e option and associated event specification parsing.
* Remove -b option and bucket statistics.
* Don't intern labels (always print addresses).
* Remove -v option (events are always output).
* If -h or -? is specified, exit after printing help message.
* Help text refer to the "Telemetry" section of reference manual.