MPS issue job003333

Titleeventcnv produces bogus output if you pass -b but not -e
Statusclosed
Priorityoptional
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionIf you call the eventenv program and pass a bucket size via the -b option, but do not request event statistics with the -e option, you get nonsensical output.
AnalysisThe code in eventcnv.c that output the bucket stats looks like this:

    /* Output bucket, if necessary, and update counters */
    if (bucketSize != 0 && eventTime >= bucketLimit) {
      reportBucketResults(bucketLimit-1);
      clearBucket();
      do {
        bucketLimit += bucketSize;
      } while (eventTime >= bucketLimit);
    }

and also this:

    /* report last bucket (partial) */
    if (bucketSize != 0) {

Either the combination of -b without -e needs to be detected when the options are processed, or else the bucket output in each case needs to be guarded by "if (reportStats)".

Also, it would be good programming practice for the closing delimiter to be printed by the same function (in this case, reportBucketResults) as the opening delimiter, to avoid the malformed non-lists that you can see in "Evidence".

See also job003331, job003332, and job003335, which also affect this region of code.
How foundmanual_test
EvidenceHere's a test run:

    $ eventcnv -b 1000000000 -SL
    (000000003B9AC9FF(000007DC7DC16553803

The output shows the start of a bucket record for each bucket, but not the contents of the bucket, or its end.
Observed in1.110.0
Created byGareth Rees
Created on2012-10-21 15:54:55
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.