From patchwork Wed Aug 28 09:55:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sunshaojie X-Patchwork-Id: 19559 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 07A48248D3 for ; Wed, 28 Aug 2013 09:55:53 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id l13sf6088456qcy.8 for ; Wed, 28 Aug 2013 02:55:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=7dFs34wYJZ12QZmjmNt4K3jgRyMLXKjx8YUAEusbuVE=; b=FxRHNguWL8JqcejBAOl5SJsUpA6gO72x31/LsZt3kZIlQ4679yNEha/70jNH7WfHOT F1d4nwErtO31GwE78vcuhJuu9FNDzHg/NCOPnMRNPmoE9ymcABx77ebcaI+9HVqdFJ6T nrC3+44bp9HDavy4oYXHHkatyxnoi5HTzxTpo2cv02PWEhTVDBcVY1FnezZrL/YcTwcg 8cHD5UfWIndskST9pTMZaNw9ZEzv5LVZGtgBGLpvMZ466tCQZ/vxYtcGMaBuQM9wakKu WViZhJcliW698zcYNsuip3boqU4+LDa7sIgWQrzO9JuNl7AMK99M0Dyu/Kdp7CRyjbu3 JHzw== X-Received: by 10.236.14.100 with SMTP id c64mr9733125yhc.38.1377683752529; Wed, 28 Aug 2013 02:55:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.87.36 with SMTP id u4ls227080qez.56.gmail; Wed, 28 Aug 2013 02:55:52 -0700 (PDT) X-Received: by 10.58.165.70 with SMTP id yw6mr15923552veb.19.1377683752433; Wed, 28 Aug 2013 02:55:52 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id gr9si6268904vec.73.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 02:55:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id d10so3940531vea.5 for ; Wed, 28 Aug 2013 02:55:52 -0700 (PDT) X-Gm-Message-State: ALoCoQmaVNMIHl7FHgz/mCpCmM9rFDLu2ruX43W6aPm+mvC618UP1LicCZ5lu4qozDDJrQJ3r5CH X-Received: by 10.52.180.229 with SMTP id dr5mr20786037vdc.20.1377683752336; Wed, 28 Aug 2013 02:55:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp346375vcz; Wed, 28 Aug 2013 02:55:51 -0700 (PDT) X-Received: by 10.68.125.226 with SMTP id mt2mr26512397pbb.115.1377683750911; Wed, 28 Aug 2013 02:55:50 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id xx4si19969967pab.197.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 02:55:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of shaojie.sun@linaro.org) client-ip=209.85.220.52; Received: by mail-pa0-f52.google.com with SMTP id kq13so5990049pab.25 for ; Wed, 28 Aug 2013 02:55:50 -0700 (PDT) X-Received: by 10.66.149.231 with SMTP id ud7mr26132710pab.8.1377683750311; Wed, 28 Aug 2013 02:55:50 -0700 (PDT) Received: from localhost.localdomain ([58.251.159.202]) by mx.google.com with ESMTPSA id iu7sm30196553pbc.45.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 02:55:49 -0700 (PDT) From: Shaojie Sun To: daniel.lezcano@linaro.org Cc: sunshaojie@huawei.com, patches@linaro.org, private-pmwg@linaro.org, Shaojie Sun Subject: [PATCH IDLESTAT] topology: add cpu core info even without Hyper-Threading. Date: Wed, 28 Aug 2013 17:55:41 +0800 Message-Id: <1377683741-8321-1-git-send-email-shaojie.sun@linaro.com> X-Mailer: git-send-email 1.7.9.5 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: shaojie.sun@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In ARM big-little arch, core ID is not equal to cpuid. to keep code ID info, we print core ID info even without Hyper-Threading. Signed-off-by: Shaojie Sun --- topology.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/topology.c b/topology.c index e93381c..e9d3aa3 100644 --- a/topology.c +++ b/topology.c @@ -173,14 +173,9 @@ int output_topo_info(struct cpu_topology *topo_list) list_for_each_entry(s_phy, &topo_list->physical_head, list_physical) { printf("cluster%c:\n", s_phy->physical_id + 'A'); list_for_each_entry(s_core, &s_phy->core_head, list_core) { - if (s_core->is_ht) { - printf("\tcore%d\n", s_core->core_id); - list_for_each_entry(s_cpu, &s_core->cpu_head, list_cpu) - printf("\t\tcpu%d\n", s_cpu->cpu_id); - } else { - list_for_each_entry(s_cpu, &s_core->cpu_head, list_cpu) - printf("\tcpu%d\n", s_cpu->cpu_id); - } + printf("\tcore%d\n", s_core->core_id); + list_for_each_entry(s_cpu, &s_core->cpu_head, list_cpu) + printf("\t\tcpu%d\n", s_cpu->cpu_id); } } @@ -196,14 +191,9 @@ int outfile_topo_info(FILE *f, struct cpu_topology *topo_list) list_for_each_entry(s_phy, &topo_list->physical_head, list_physical) { fprintf(f, "cluster%c:\n", s_phy->physical_id + 'A'); list_for_each_entry(s_core, &s_phy->core_head, list_core) { - if (s_core->is_ht) { - fprintf(f, "\tcore%d\n", s_core->core_id); - list_for_each_entry(s_cpu, &s_core->cpu_head, list_cpu) - fprintf(f, "\t\tcpu%d\n", s_cpu->cpu_id); - } else { - list_for_each_entry(s_cpu, &s_core->cpu_head, list_cpu) - fprintf(f, "\tcpu%d\n", s_cpu->cpu_id); - } + fprintf(f, "\tcore%d\n", s_core->core_id); + list_for_each_entry(s_cpu, &s_core->cpu_head, list_cpu) + fprintf(f, "\t\tcpu%d\n", s_cpu->cpu_id); } }