[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <d33aed5e89cfb715115c08b4677d567e6eadee22.1359463075.git.jan.kiszka@siemens.com>
Date: Tue, 29 Jan 2013 13:38:00 +0100
From: Jan Kiszka <jan.kiszka@...mens.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Cc: Jason Wessel <jason.wessel@...driver.com>,
kgdb-bugreport@...ts.sourceforge.net,
Andi Kleen <andi@...stfloor.org>,
Tom Tromey <tromey@...hat.com>,
Ben Widawsky <ben@...dawsk.net>, Borislav Petkov <bp@...en8.de>
Subject: [PATCH v5 17/20] scripts/gdb: Add lx_current convenience function
This is a shorthand for *$lx_per_cpu("current_task"), i.e. a convenience
function to retrieve the currently running task of the active context.
Signed-off-by: Jan Kiszka <jan.kiszka@...mens.com>
---
scripts/gdb/percpu.py | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/scripts/gdb/percpu.py b/scripts/gdb/percpu.py
index 864962c..4dab8d3 100644
--- a/scripts/gdb/percpu.py
+++ b/scripts/gdb/percpu.py
@@ -59,3 +59,19 @@ class PerCpu(gdb.Function):
return per_cpu(var_ptr, cpu)
PerCpu()
+
+
+class LxCurrentFunc(gdb.Function):
+ __doc__ = "Return current task.\n" \
+ "\n" \
+ "$lx_current([CPU]): Return the per-cpu task variable for the given CPU\n" \
+ "number. If CPU is omitted, the CPU of the current context is used."
+
+ def __init__(self):
+ super(LxCurrentFunc, self).__init__("lx_current")
+
+ def invoke(self, cpu = -1):
+ var_ptr = gdb.parse_and_eval("¤t_task")
+ return per_cpu(var_ptr, cpu).dereference()
+
+LxCurrentFunc()
--
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists