Subject: | |
From: | |
Reply To: | |
Date: | Tue, 14 Feb 1995 20:03:16 GMT |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Mark Ranft ([log in to unmask]) wrote:
: Can anyone help me with the macro(s?) needed to display the accessors of a
particular file?
: I would especially be interested in determining the FLOCK holder.
Well, since you have a process hung waiting for the FLOCK, here's one
method of determining the info you want:
1) logon as MANAGER.SYS (or, some user with PM capability)
2) determine the PIN of one of the processes waiting for the file.
(let's say the PIN is 111 ($6f in hex).
3) enter DEBUG
:debug
4) open the appropriate SYMOS file for your release of the operating system.
4a) either do a :SHOWME and grab the middle of the second line of output:
RELEASE: X.50.40 MPE/iX HP31900 B.78.10 USER VERSION: X.50.40
----
and use SYMOS.OSB78.TELESUP
or
4b) enter: use datinit.dat.telesup
and then: macstart , "1"
5) do the following "FV" command to look at the process' PIB.PORT_AREA:
(Don't forget the "#" in front of decimal numbers.)
fv pib (#111) "pib_type.port_area"
About half way through the 50 or so lines of output are a couple
of lines that look like:
PIB_SEM_ADDR : a.ca045610
PIB_SEM_NEXT_PIN : 7ffd
(Note: the field is closer to the start on pre-5.0 releases of MPE/iX)
The PIB_SEM_ADDR is the address of the semaphore (lock) that the
process is (or WAS!) waiting on. For now, we'll assume that the process
is still waiting on that semaphore. The PIB_SEM_NEXT_PIN is the
PIN (Process Identification Number) of the next process in line for the
semaphore after the process you are looking at.
BTW, you could have just done:
fv pib (#111) "pib_type.port_area.pib_sem_addr"
a.ca045610
6) do the following "FV" command to look at the sempahore record whose
address you just found:
fv ca045610 "semaphore_rec"
RECORD
SEM_INFO_WORD :
SEM_STATE : 2
SEM_LOCK : 0
SEM_SPEC : 8
SEM_CLASS : 13
SEM_OWNER : 75
SEM_SPIN_STATE_REC :
SPIN_SEM_STATE : 0
SPIN_SEM_LOCK : 0
SPIN_SEM_SPEC : 0
SPIN_SEM_CLASS : 0
SPIN_SEM_OWNER : 1
SEM_SPIN_OWNER_COUNT : 2f2
END
(the output may vary slightly on different releases of MPE/iX)
The field labelled "SEM_OWNER" is the PIN (in hex) of the process that
owns the semaphore ... in this case, the process that has the file FLOCKed.
7) Exit Debug by entering: c
Hope this helps.
An alternative method is to approach the problem from the direction of
the file system, instead of the process-waiting mechanism. I chose not
to do this, in this case, because it requires more usage of Debug/DAT macros.
In the alternative, I'd locate the GUFD for the file in question, and
then (assuming the GUFD is at $ca0455c4), do:
fv $ca0455c4 "gufd_record.FLOCK_SEMAPHORE"
which would take us directly to the sempahore that is associated with the
FLOCK.
Stan Sieler
|
|
|