|
@@ -66,3 +66,20 @@ Note that VAR has to be quoted as string."""
|
|
|
|
|
|
|
|
|
|
PerCpu()
|
|
PerCpu()
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+class LxCurrentFunc(gdb.Function):
|
|
|
|
+ """Return current task.
|
|
|
|
+
|
|
|
|
+$lx_current([CPU]): Return the per-cpu task variable for the given CPU
|
|
|
|
+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()
|