]>
git.saurik.com Git - apple/xnu.git/blob - tools/lldbmacros/counter.py
1 from memory
import IterateZPerCPU
4 @lldb_type_summary(['scalable_counter_t'])
5 @header("Counter Value\n-------------")
6 def GetSimpleCounter(counter
):
7 """ Prints out the value of a percpu counter
8 params: counter: value - value object representing counter
9 returns: str - THe value of the counter as a string.
12 for v
in IterateZPerCPU(counter
, "uint64_t *"):
16 @lldb_command('showcounter')
17 def ShowSimpleCounter(cmd_args
=None):
18 """ Show the value of a percpu counter.
19 Usage: showcounter <address of counter>
22 raise ArgumentError("Please specify the address of the counter you want to read.")
24 print GetSimpleCounter(kern
.GetValueFromAddress(cmd_args
[0], "scalable_counter_t"))