aubinator_error_decode: Compare only the class_name of the ring.
authorRafael Antognolli <rafael.antognolli@intel.com>
Tue, 20 Mar 2018 16:13:08 +0000 (09:13 -0700)
committerRafael Antognolli <rafael.antognolli@intel.com>
Wed, 21 Mar 2018 18:35:15 +0000 (11:35 -0700)
ring_name is "<class_name> + <instance_id>" (e.g. rcs0). So we need to
first compare the class name only, then get the instance id.

Without this, INSTDONE is not being decoded.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
src/intel/tools/aubinator_error_decode.c

index 017be5bbc2b0379478caf7b801d85efceb7e666a..db880d74a9e632eeaa708a3a9d5595c857a57fcd 100644 (file)
@@ -120,7 +120,7 @@ static int ring_name_to_class(const char *ring_name,
       [VECS] = "vecs",
    };
    for (size_t i = 0; i < ARRAY_SIZE(class_names); i++) {
-      if (strcmp(ring_name, class_names[i]))
+      if (strncmp(ring_name, class_names[i], strlen(class_names[i])))
          continue;
 
       *class = i;