RAS/CEC: Dump the different array element sections
authorBorislav Petkov <bp@suse.de>
Sat, 20 Apr 2019 21:01:03 +0000 (23:01 +0200)
committerBorislav Petkov <bp@suse.de>
Sat, 8 Jun 2019 15:39:11 +0000 (17:39 +0200)
When dumping the array elements, print them in the following format:

  [ PFN | generation in binary | count ]

to be perfectly clear what all those sections are.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
drivers/ras/cec.c

index 364f7e1a6bade01700a50e35117d3986e089be66..dc08c705b49359ed4ce0f1f770039d91483d3e45 100644 (file)
@@ -429,6 +429,8 @@ static int action_threshold_set(void *data, u64 val)
 }
 DEFINE_DEBUGFS_ATTRIBUTE(action_threshold_ops, u64_get, action_threshold_set, "%lld\n");
 
+static const char * const bins[] = { "00", "01", "10", "11" };
+
 static int array_dump(struct seq_file *m, void *v)
 {
        struct ce_array *ca = &ce_arr;
@@ -440,7 +442,8 @@ static int array_dump(struct seq_file *m, void *v)
        for (i = 0; i < ca->n; i++) {
                u64 this = PFN(ca->array[i]);
 
-               seq_printf(m, " %03d: [%016llx|%03llx]\n", i, this, FULL_COUNT(ca->array[i]));
+               seq_printf(m, " %3d: [%016llx|%s|%03llx]\n",
+                          i, this, bins[DECAY(ca->array[i])], COUNT(ca->array[i]));
        }
 
        seq_printf(m, "}\n");