Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752481AbcCMSje (ORCPT ); Sun, 13 Mar 2016 14:39:34 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38738 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751684AbcCMSja (ORCPT ); Sun, 13 Mar 2016 14:39:30 -0400 Subject: Re: [PATCHv3 10/13] scripts/gdb: Add cpu iterators To: Jan Kiszka , linux-kernel@vger.kernel.org References: <1457005267-843-1-git-send-email-kieran.bingham@linaro.org> <1457005267-843-11-git-send-email-kieran.bingham@linaro.org> <56E5965F.5030001@siemens.com> Cc: lee.jones@linaro.org, peter.griffin@linaro.org, maxime.coquelin@st.com From: Kieran Bingham Message-ID: <56E5B3DF.9000706@linaro.org> Date: Sun, 13 Mar 2016 18:39:27 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56E5965F.5030001@siemens.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1965 Lines: 77 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 >> --- >> 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 >