[Orca-dev] RE[2]: Digest 336
Rusty Carruth
rcarruth at tempe.tt.slb.com
Thu Oct 4 14:22:36 PDT 2001
alegrand at wallace.com wrote:
> I am unclear about the hardware that Rusty is using his short disk name
> is dad0.
Well, this is an Ultra 5 running Solaris 2.5.1.
I modified orcallator.se to tell me what the short names were as it added them,
and it got this list:
adding raw disk. short name: dad0
adding raw disk. short name: atapicd2
adding raw disk. short name: fd0
(this is on SunOS msfree 5.5.1 Generic_103640-32 sun4u sparc SUNW,Ultra-5_10)
Over in the other building I found one machine that gave me this:
adding raw disk. short name: sd0
adding raw disk. short name: sd1
adding raw disk. short name: sd2
(and that was on SunOS cass 5.5.1 Generic_103640-24 sun4u sparc SUNW,Ultra-1)
> Every short disk name that I have seen is "sdXX" this maybe the source of
> the problem. I am sure that I used this to recognize this disk. So now
> I find myself it the same situation you keep having.
>
> I have an idea what the problem is but I do not have the hardware it is
> happening on to replicate it.
>
> The best solution would be for Rusty and I figure out what needs to be
> changed.
Well, like I say, I did this (more comments follow the code stuff):
bash-2.04$ diff -u /tmp/orca*
--- /tmp/orcallator.se Thu Oct 4 12:55:22 2001
+++ /tmp/orcallator.se.orig Thu Oct 4 12:55:22 2001
@@ -470,7 +470,10 @@
// already identified how many physical devices are present and they
// are listed first we limit our self to mapping the first
// RAW_disk_count device name.
+//printf("raw disk count is %d, changed to %d\n",RAW_disk_count,RAW_disk_count - 1);
+printf("raw disk count is %d\n",RAW_disk_count);
for (i=0; i<RAW_disk_count; i++) {
+printf("I is now %d\n",i);
strcpy(long_name,GLOBAL_disk_info[i].long_name);
if (long_name[0] == 'c' && strchr(long_name, 's') == nil) {
strcpy(short_name,GLOBAL_disk_info[i].short_name);
@@ -535,6 +538,8 @@
strcpy(short_name, nkp[0].ks_name);
if (short_name[0] != 'm' &&
short_name[0] != 'n' &&
+ short_name[0] != 'f' && // fd fails on sun - rcarruth
+ short_name[1] != 'd' && // ditto - rcarruth
strchr(short_name,',') == nil) {
// Try to locate device.
for (rdisk=0; rdisk<RAW_disk_count;rdisk++) {
@@ -550,6 +555,7 @@
RAW_disk_map = 1;
strcpy(RAW_disk[rdisk].long_name, short_name);
strcpy(RAW_disk[rdisk].short_name, short_name);
+printf("adding raw disk. short name: %s\n",short_name);
RAW_disk[rdisk]._reads = 0;
RAW_disk[rdisk]._nread = 0;
RAW_disk[rdisk]._rlentime = 0;
@@ -1041,31 +1047,48 @@
}
}
+/* state as a digit */
+int state_dig(int state) {
+ switch(state) {
+ case ST_WHITE: return '0'; /* OK states are zero */
+ case ST_BLUE: return '0';
+ case ST_GREEN: return '0';
+ case ST_AMBER: return '1';/* bad states have a non-zero value.
+ case ST_RED: return '2';
+ case ST_BLACK: return '4';
+ default: return '9'; /* invalid state */
+ }
+}
+
measure_misc(long now, tm_t tm_now)
{
long uptime;
char states[12];
char tm_buf[16];
+ char sum_states[24];
+ int statetmp;
uptime = now - boot_time;
+ sum_states = "0 0 0 0 0 0 0 0 0 0 0";
states = "wwwwwwwwwww";
strftime(tm_buf, sizeof(tm_buf), "%T", tm_now);
-
- states[0] = state_char(lr_disk$dr.state);
- states[1] = state_char(lr_net$nr.state);
- states[2] = state_char(lr_rpcclient$r.state);
- states[3] = state_char(lr_swapspace$s.state);
- states[4] = state_char(lr_ram$ram.state);
- states[5] = state_char(lr_kmem$kmem.state);
- states[6] = state_char(lr_cpu$cpu.state);
- states[7] = state_char(lr_mutex$m.state);
- states[8] = state_char(lr_dnlc$dnlc.state);
- states[9] = state_char(lr_inode$inode.state);
- states[10]= state_char(lr_tcp$tcp.state);
+ statetmp = lr_disk$dr.state; states[0] = state_char(statetmp); sum_states[0] = state_dig(statetmp);
+ statetmp = lr_net$nr.state; states[1] = state_char(statetmp); sum_states[2] = state_dig(statetmp);
+ statetmp = lr_rpcclient$r.state; states[2] = state_char(statetmp); sum_states[4] = state_dig(statetmp);
+ statetmp = lr_swapspace$s.state; states[3] = state_char(statetmp); sum_states[6] = state_dig(statetmp);
+ statetmp = lr_ram$ram.state; states[4] = state_char(statetmp); sum_states[8] = state_dig(statetmp);
+ statetmp = lr_kmem$kmem.state; states[5] = state_char(statetmp); sum_states[10] = state_dig(statetmp);
+ statetmp = lr_cpu$cpu.state; states[6] = state_char(statetmp); sum_states[12] = state_dig(statetmp);
+ statetmp = lr_mutex$m.state; states[7] = state_char(statetmp); sum_states[14] = state_dig(statetmp);
+ statetmp = lr_dnlc$dnlc.state; states[8] = state_char(statetmp); sum_states[16] = state_dig(statetmp);
+ statetmp = lr_inode$inode.state; states[9] = state_char(statetmp); sum_states[18] = state_dig(statetmp);
+ statetmp = lr_tcp$tcp.state; states[10]= state_char(statetmp); sum_states[20]= state_dig(statetmp);
put_output(" timestamp", sprintf("%10d", now));
put_output("locltime", tm_buf);
put_output("DNnsrkcmdit", states);
+ put_output(" Dw Nw nw sw rw kw cw mw dw iw tw", sum_states);
+// 0 1 2 3 4 5 6 7 8 9 10
put_output(" uptime", sprintf("%8d", uptime));
}
bash-2.04$
> Yes, I think this code does include the patch.
(yes, it does)
> So what do we really need here? Can you send a patch to fix it?
I've got Version 1.28b4: Mar 27, 2001, with the above patches at this point.
The trick was here:
if (short_name[0] != 'm' &&
short_name[0] != 'n' &&
+ short_name[0] != 'f' && // fd fails on my sun ultra5 - rcarruth
+ short_name[1] != 'd' && // ditto - rcarruth
And it seems to work fine on all the machines I've tried it on (27 machines)
So, like everyone is saying - now what? ;-)
rc
> alegrand at wallace.com wrote:
> >
> > ]Blair,
> >
> > Does the version of orcallator Rusty is using include the patch
> > I sent you early this year. For the section that implements the rawdisk
> > code? (version 1.28b4)
> >
> > I believe it should have stopped this problem permanently. In any case
> > the problem is not a privillege issue. The structure being searched
> > contains mappings between the c..... long disk name to sdxxx short disk
> > names. Somestimes the long disk name field is missing. Sometimes the
> > list of mapppings also contains Disks that are nolonger in the system.
> > So you need to seach the table until you find everything you want.
> > Unfortunately
> > The length of as reported by GLOBAL_diskinfo_size is also incorrect.
> >
> > The line that accomplishes this is
> > if (strchr(long_name, 's' != nil) { break;}
> >
> > ALan
> >
More information about the Orca-dev
mailing list