Subject: SOLUTION: Top on a two processor sparc10

From: [email-masked] (Jason C. Austin)
Date: 01 Mar 1994 16:25:49 GMT

I got some time to load top into the debugger and found why it
won't run on a two processor sparc10.

	Top gets the offset to the CPU information by loading them at
the "cpu" symbol.  For a two processor, it loads the first two
offsets.  The problem is that a two CPU board takes up an SBUS slot
also, so the default two processor setup has a single CPU boards in
each MBUS slot.  This gives you processor number 0 and 2, and not 0
and 1 which top is expecting.

	To fix it, change the m_sunos5.c code that sets cpu_offset to
load the first and the third offset instead of the first and second.
--
Jason C. Austin
[email-masked]

---

From: [email-masked] (Willard Dawson)
Date: Wed, 2 Mar 1994 03:10:09 GMT

[email-masked] (Chris Webster) writes:

>[email-masked] (Jason C. Austin) writes:
>>

>Does this problem exist with a 2 processor sparc1000?

>--Chris

Thanks to a hint from another comp.unix.solaris poster, I've
successfully compiled and run top-3.3beta on a two-CPU Sparc 10 with
Solaris 2.3.

The fix:  Change line 317 of machine.c from:

  for (i = 0; i < ncpus; i++)

to:

  for (i = 0; i < ncpus; i+=2)

It seems that the CPUs on Sparcs are numbered in 0,2,4,... increments.

---

From: [email-masked] (Casper H.S. Dik)
Date: 2 Mar 1994 08:46:02 GMT

>It seems that the CPUs on Sparcs are numbered in 0,2,4,... increments.

The fix is wrong.  Only on machines where the two
processors are on seperate cards, the processors are numbered
0,2,4 etc.  On machines with two processor cards (54s) the CPUS
are numbered 0,1,2,3.  You should test for NULL pointers in
the list of CPUs.

Casper