Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1356714
| From | Kieran Bingham <kieran.bingham@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCHv3 10/13] scripts/gdb: Add cpu iterators |
| Date | 2016-03-13 19:40 +0100 |
| Message-ID | <rcj5L-ZV-7@gated-at.bofh.it> (permalink) |
| References | <r8zVv-6xi-3@gated-at.bofh.it> <r8zVy-6xi-65@gated-at.bofh.it> <rchdD-8dH-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 13/03/16 16:33, Jan Kiszka wrote:
> On 2016-03-03 12:41, Kieran Bingham wrote:
>> The linux kernel provides macro's for iterating against values from the
>> cpu_list masks. By providing some commonly used masks, we can mirror the
>> kernels helper macros with easy to use generators.
>>
>> Signed-off-by: Kieran Bingham <kieran.bingham@linaro.org>
>> ---
>> scripts/gdb/linux/cpus.py | 21 +++++++++++++++++++++
>> 1 file changed, 21 insertions(+)
>>
>> diff --git a/scripts/gdb/linux/cpus.py b/scripts/gdb/linux/cpus.py
>> index 4297b83fedef..59e24472c507 100644
>> --- a/scripts/gdb/linux/cpus.py
>> +++ b/scripts/gdb/linux/cpus.py
>> @@ -100,6 +100,27 @@ def cpu_list(mask_name):
>> yield cpu
>>
>>
>> +def each_online_cpu():
>> + for cpu in cpu_list("cpu_online_mask"):
>> + yield cpu
>> +
>> +
>> +def each_present_cpu():
>> + for cpu in cpu_list("cpu_present_mask"):
>> + yield cpu
>> +
>> +
>> +def each_possible_cpu():
>> + for cpu in cpu_list("cpu_possible_mask"):
>> + yield cpu
>> +
>
> This patch requires rebasing over master (these masks became macros).
Ah, yes Ok - I see.
Changed between 4b804c85dc37d...5aec01b834fd6
I'll fixup, and rebase on next.
> In general, please base on master or even next before posting.
Ack. Of course,
And of course this highlights your concerns about the need for continual
testing as well!
>
>> +
>> +def print_cpus():
>> + gdb.write("Possible CPUS : {}\n".format(list(each_possible_cpu())))
>> + gdb.write("Present CPUS : {}\n".format(list(each_present_cpu())))
>> + gdb.write("Online CPUS : {}\n".format(list(each_online_cpu())))
>
> I think this can be useful. Let's make it a real, discoverable command.
> lx-cpus?
Ack.
Looking through the above breakage, I see there is also a
cpu_active_mask, so I'll add that for completeness.
--
Kieran
>
>> +
>> +
>> class PerCpu(gdb.Function):
>> """Return per-cpu variable.
>>
>>
>
> Jan
>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCHv3 10/13] scripts/gdb: Add cpu iterators Jan Kiszka <jan.kiszka@siemens.com> - 2016-03-13 17:40 +0100 Re: [PATCHv3 10/13] scripts/gdb: Add cpu iterators Kieran Bingham <kieran.bingham@linaro.org> - 2016-03-13 19:40 +0100
csiph-web