From 72bdc160ea7f07ecdb3a9d338e092dab62bf6844 Mon Sep 17 00:00:00 2001
From: Mitchel Humpherys <mitchelh@codeaurora.org>
Date: Mon, 21 Apr 2014 17:55:37 -0700
Subject: [PATCH] lrdp-v2: add missing argument to cfs_node_func

[29d3f2edc8f: "lrdp-v2: refactor Iommu domain parsing code"] introduced
an extra argument for rb_tree `walker' functions, but didn't update the
runqueue rb_tree user, so the ramdump parser currently fails to print
the runqueue state. Fix this.

For certain dumps, before this change we would see the following
backtrace:

    Traceback (most recent call last):
      File "ramparse.py", line 266, in <module>
        p.cls(dump).parse()
      File "parsers/runqueue.py", line 196, in parse
        self.print_cfs_state(cfs_rq_addr)
      File "parsers/runqueue.py", line 101, in print_cfs_state
        rb_walker.walk(tasks_timeline_addr, self.cfs_node_func)
      File "rb_tree.py", line 54, in walk
        self._walk(node, func, [], extra)
      File "rb_tree.py", line 39, in _walk
        self._walk(left_node, func, seen, extra)
      File "rb_tree.py", line 39, in _walk
        self._walk(left_node, func, seen, extra)
      File "rb_tree.py", line 41, in _walk
        func(node, extra)
    TypeError: cfs_node_func() takes exactly 2 arguments (3 given)

Change-Id: Ic19ec42d6cfbe87b6e0a0e99c6adf7c41e5b35e9
---
 linux-ramdump-parser-v2/parsers/runqueue.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-ramdump-parser-v2/parsers/runqueue.py b/linux-ramdump-parser-v2/parsers/runqueue.py
index b101bf5..bbdaaec 100644
--- a/linux-ramdump-parser-v2/parsers/runqueue.py
+++ b/linux-ramdump-parser-v2/parsers/runqueue.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2013, The Linux Foundation. All rights reserved.
+# Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License version 2 and
@@ -70,7 +70,7 @@ class RunQueues(RamParser):
                 self.print_cfs_state(my_q_addr)
                 self.tab_offset -= 1
 
-    def cfs_node_func(self, node):
+    def cfs_node_func(self, node, extra):
         run_node_offset = self.ramdump.field_offset(
             'struct sched_entity', 'run_node')
 
-- 
GitLab