public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: acme@redhat.com, Jiri Olsa <jolsa@redhat.com>
Cc: kan.liang@intel.com, linux-kernel@vger.kernel.org
Subject: perf test topo broken?
Date: Thu, 19 Nov 2015 14:13:53 -0800	[thread overview]
Message-ID: <20151119221353.GA6928@us.ibm.com> (raw)


'perf test topo' is broken on my x86_64 system, with a rather cryptic message.

	$ ./perf test -v topo
	36: Test topology in session                                 :
	--- start ---
	test child forked, pid 2705
	templ file: /tmp/perf-test-6rSAkb
	core_id number is too big.  nr 9, cpu_nr 8. You may need to upgrade the perf tool.
	test child interrupted
	---- end ----
	Test topology in session: FAILED!

	$ ./perf --version
	perf version 4.4.rc1.g34258a

(I included nr and cpu_nr values in the error message). The code (shown
below) is comparing a core_id value (nr) with number of cpus online (cpu_nr)
which don't seem to be related on this system.

On my system running 4.4.0-rc1 kernel, I have following cpus:

	$ head /proc/cpuinfo 
	processor	: 0
	vendor_id	: GenuineIntel
	cpu family	: 6
	model		: 44
	model name	: Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
	stepping	: 2
	microcode	: 0x10
	cpu MHz		: 1596.000
	cache size	: 12288 KB
	physical id	: 0

	$ ls -d /sys/devices/system/cpu/cpu?
	/sys/devices/system/cpu/cpu0  /sys/devices/system/cpu/cpu4
	/sys/devices/system/cpu/cpu1  /sys/devices/system/cpu/cpu5
	/sys/devices/system/cpu/cpu2  /sys/devices/system/cpu/cpu6
	/sys/devices/system/cpu/cpu3  /sys/devices/system/cpu/cpu7

	$ cat /sys/devices/system/cpu/online 
	0-7

	$ cat /sys/devices/system/cpu/cpu?/topology/core_id
	0
	1
	9
	10
	0
	1
	9
	10

Commenting out following code seems to cause the test to pass, but are
core_ids in general related to number of cpus online?

Sukadev

---
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 4383800..d5104da 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1652,11 +1652,14 @@ static int process_cpu_topology(struct perf_file_section *section,
                if (ph->needs_swap)
                        nr = bswap_32(nr);
 
+#if 0
                if (nr > (u32)cpu_nr) {
-                       pr_debug("core_id number is too big."
-                                "You may need to upgrade the perf tool.\n");
+                       pr_debug("core_id number is too big.  nr %d, cpu_nr %d. "
+                                "You may need to upgrade the perf tool.\n",
+                                nr, cpu_nr);
                        goto free_cpu;
                }
+#endif
                ph->env.cpu[i].core_id = nr;
 
                ret = readn(fd, &nr, sizeof(nr));


             reply	other threads:[~2015-11-19 22:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 22:13 Sukadev Bhattiprolu [this message]
2015-11-20  9:40 ` perf test topo broken? Jiri Olsa
2015-11-20  9:46 ` Jiri Olsa
2015-11-25 15:16   ` Liang, Kan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151119221353.GA6928@us.ibm.com \
    --to=sukadev@linux.vnet.ibm.com \
    --cc=acme@redhat.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox