mcelog: Fix leaky_bucket calculation of hours and days.

The current leak_bucket timeconv() function mistakenly multiplies both
hour and day based time units by an extra 60.

Signed-off-by: Robin Holt <rholt@cray.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
mcelog: Add missing entry to Ivy Bridge memory controller decode table

September 2013 edition of the software developer manual added an
entry that had been inadvertently omitted from earlier editions.
Add the 0x80 entry for "Corrected memory read error".

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
mcelog: Add a test for leaky bucket logging.

The leaky bucket code is not performing anywhere near what I had expected.
Here is a test which is #ifdef'd out by default.  Compile with
gcc -DTEST_LEAKY_BUCKET -DTEST_LEAKY_BUCKET_DEBUG -o test-leaky-bucket
leaky-bucket.c

Run the test to see when events get logged.

Compile with:
gcc -DTEST_LEAKY_BUCKET -o test-leaky-bucket leaky-bucket.c

./test-leaky-bucket  # Should print nothing and return 0.

Signed-off-by: Robin Holt <robinmholt@gmail.com>
To: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
mcelog: Make leaky-bucket log more sane.

When initialized with a threshold string of "X / Y", the leaky bucket
code will currently log every Xth event.  It will reset to the 0th event
whenever the event is more than Y seconds after the previous event.
This behavior is nothing close to what I had expected nor would guess
the normal administrator would expect.

This patch brings things more in line with my expectations.  The first
Xth events will be logged, and then, for every Y/X seconds, one additional
event will be allowed to be logged.

There is no testing for an inc value larger than 1.

Signed-off-by: Robin Holt <robinmholt@gmail.com>
To: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
document new release scheme