Merge branch 'linus' into perf/core, to fix conflicts
[linux-2.6-microblaze.git] / tools / perf / tests / attr.py
index 6bb50e8..ff9b60b 100644 (file)
@@ -1,4 +1,5 @@
 #! /usr/bin/python
+# SPDX-License-Identifier: GPL-2.0
 
 import os
 import sys
@@ -237,6 +238,7 @@ class Test(object):
         # events in result. Fail if there's not any.
         for exp_name, exp_event in expect.items():
             exp_list = []
+            res_event = {}
             log.debug("    matching [%s]" % exp_name)
             for res_name, res_event in result.items():
                 log.debug("      to [%s]" % res_name)
@@ -253,7 +255,10 @@ class Test(object):
                 if exp_event.optional():
                     log.debug("    %s does not match, but is optional" % exp_name)
                 else:
-                    exp_event.diff(res_event)
+                    if not res_event:
+                        log.debug("    res_event is empty");
+                    else:
+                        exp_event.diff(res_event)
                     raise Fail(self, 'match failure');
 
             match[exp_name] = exp_list