Title | eventcnv produces bogus output if you pass -b but not -e |
Status | closed |
Priority | optional |
Assigned user | Gareth Rees |
Organization | Ravenbrook |
Description | If 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. |
Analysis | The 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 found | manual_test |
Evidence | Here'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 in | 1.110.0 |
Created by | Gareth Rees |
Created on | 2012-10-21 15:54:55 |
Last modified by | Gareth Rees |
Last modified on | 2012-10-23 14:28:22 |
History | 2012-10-21 GDR Created. |
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. |