Lines Matching +full:cpu +full:- +full:offset

4 #  per-cpu tools
6 # Copyright (c) Siemens AG, 2011-2013
27 return gdb.selected_thread().num - 1
30 if tid > (0x100000000 - MAX_CPUS - 2):
31 return 0x100000000 - tid - 2
33 return tasks.get_thread_info(tasks.get_task_by_pid(tid))['cpu']
35 raise gdb.GdbError("Sorry, obtaining the current CPU is not yet "
39 def per_cpu(var_ptr, cpu): argument
40 if cpu == -1:
41 cpu = get_current_cpu()
43 offset = gdb.parse_and_eval(
44 "trap_block[{0}].__per_cpu_base".format(str(cpu)))
47 offset = gdb.parse_and_eval(
48 "__per_cpu_offset[{0}]".format(str(cpu)))
51 offset = 0
52 pointer = var_ptr.cast(utils.get_long_type()) + offset
81 entry = -1
98 cpu = entry * bits_per_entry + bit
103 yield int(cpu)
107 for cpu in cpu_list("__cpu_online_mask"):
108 yield cpu
112 for cpu in cpu_list("__cpu_present_mask"):
113 yield cpu
117 for cpu in cpu_list("__cpu_possible_mask"):
118 yield cpu
122 for cpu in cpu_list("__cpu_active_mask"):
123 yield cpu
127 """List CPU status arrays
129 Displays the known state of each CPU based on the kernel masks
133 super(LxCpus, self).__init__("lx-cpus", gdb.COMMAND_DATA)
146 """Return per-cpu variable.
148 $lx_per_cpu("VAR"[, CPU]): Return the per-cpu variable called VAR for the
149 given CPU number. If CPU is omitted, the CPU of the current context is used.
155 def invoke(self, var_name, cpu=-1): argument
157 return per_cpu(var_ptr, cpu)
162 def get_current_task(cpu): argument
173 return per_cpu(var_ptr, cpu).dereference()
204 $lx_current([CPU]): Return the per-cpu task variable for the given CPU
205 number. If CPU is omitted, the CPU of the current context is used."""
210 def invoke(self, cpu=-1): argument
211 return get_current_task(cpu)