This chapter describes a number of IOC test routines that are of interest to both application developers and system
developers. The routines are available from either iocsh or the vxWorks shell. In both shells the parentheses around
arguments are optional. On vxWorks all character string arguments must be enclosed in double quote characters
all arguments must be separated by commas. For iocsh single or double quotes must be used around string arguments that
contain spaces or commas but are otherwise optional, and arguments may be separated by either commas or spaces. For
dbpf("aiTest","2") dbpf "aiTest","2"
are both valid with both iocsh and with the vxWorks shell.
dbpf aiTest 2
Is valid for iocsh but not for the vxWorks shell.
Both iosch and vxWorks shells allow output redirection, i.e. the standard output of any command can be redirected to a file. For example
dbl > dbl.lst
will send the output of the
dbl command to the file
If iocsh is being used it provides help for all commands that have been registered. Just type
dbl("<record type>","<field list>")
dbl dbl("ai") dbl("*") dbl("")
This command prints the names of records in the run time database. If
<record type> is empty
"*", or not
specified, all records are listed. If
<record type> is specified, then only the names of the records of that type are
<field list> is given and not empty then the values of the fields specified are also printed.
List Record Names That Match a Pattern:
Lists all record names that match a pattern. The pattern can contain any characters that are legal in record names as well as
*", which matches 0 or more characters.
List Record Alias Names with optional pattern:
Lists the names of all aliases (which match the pattern if given) and the records they refer to. Examples:
dbla dbla "alia*"
This command calls
dbNameToAddr and then prints the value of each field in the
dbAddr structure describing the field.
If the field name is not specified then
VAL is assumed (the two examples above are equivalent).
This performs a
dbNameToAddr and then a
dbGetField. It prints the field type and value. If the field name is not
VAL is assumed (the two examples above are equivalent). Note that
dbGetField locks the record lockset,
dbgf will not work on a record with a stuck lockset; use
dbpr instead in this case.
This command performs a
dbNameToAddr followed by a
<field_name> is not specified
VAL is assumed.
This command prints all fields of the specified record up to and including those with the indicated interest level. Interest level has one of the following values:
dbProcess and finally
dbpr (interest level 3). Its purpose is to test record processing.
Print number of records:
This command displays the number of records of each type and the total number of records. If
0 then only record types with record instances are displayed otherwise all record types are displayed.
A breakpoint facility that allows the user to step through database processing on a per lockset basis. This facility has been constructed in such a way that the execution of all locksets other than ones with breakpoints will not be interrupted. This was done by executing the records in the context of a separate task.
The breakpoint facility records all attempts to process records in a lockset containing breakpoints. A record that is
processed through external means, e.g.: a scan task, is called an entrypoint into that lockset. The
described below will list all detected entrypoints to a lockset, and at what rate they have been detected.
Sets a breakpoint in a record. Automatically spawns the
bkptCont, or breakpoint continuation task (one per lockset).
Further record execution in this lockset is run within this task's context. This task will automatically quit if two conditions
are met, all breakpoints have been removed from records within the lockset, and all breakpoints within the lockset have
Removes a breakpoint from a record.
Steps through execution of records within a lockset. If this command is called without an argument, it will automatically step starting with the last detected breakpoint.
Continues execution until another breakpoint is found. This command may also be called without an argument.
Print Fields Of Suspended Record:
Prints out the fields of the last record whose execution was suspended.
Toggles the automatic record printing feature. If this feature is enabled for a given record, it will automatically be printed after the record is processed.
Prints out the status of all locksets that are suspended or contain breakpoints. This lists all the records with breakpoints
set, what records have the autoprint feature set (by
dbap), and what entrypoints have been detected. It also displays the
vxWorks task ID of the breakpoint continuation task for the lockset. Here is an example output from this call:
LSet: 00009 Stopped at: so#B: 00001 T: 0x23cafac Entrypoint: so#C: 00001 C/S: 0.1 Breakpoint: so(ap) LSet: 00008#B: 00001 T: 0x22fee4c Breakpoint: output
The above indicates that two locksets contain breakpoints. One lockset is stopped at record ``
so." The other is not
currently stopped, but contains a breakpoint at record ``
LSet:" is the lockset number that is being considered.
#B:" is the number of breakpoints set in records within that lockset. ``
T:" is the vxWorks task ID of the continuation
C:" is the total number of calls to the entrypoint that have been detected. ``
C/S:" is the number of those calls that
have been detected per second.
(ap) indicates that the autoprint feature has been turned on for record ``
The user should also be aware of the field
TPRO, which is present in every database record. If it is set
TRUE then a
message is printed each time its record is processed and a message is printed for each record processed as a result of it
Display error log messages on console:
This determines if error messages are displayed on the IOC console. 0 means no and any other value means yes.
Initialize error log client buffering
errlogInit(int bufSize) errlogInit2(int bufSize, int maxMsgSize)
The error log client maintains a circular buffer of messages that are waiting to be sent to the log server. If not set using one or other of these routines the default value for bufSize is 1280 bytes and for maxMsgSize is 256 bytes.
Send a message to the log server
This command is provided for use from the ioc shell only. It sends its string argument and a new-line to the log server, without displaying it on the IOC console. Note that the iocsh will have expanded any environment variable macros in the string (if it was double-quoted) before passing it to errlog.
dbior ("<driver_name>",<interest level>)
This command calls the report entry of the indicated driver. If
<driver_name> is ``" or ``*", then a report for all drivers
is generated. The command also calls the report entry of all device support modules. Interest level is one of the following:
Hardware Configuration Report:
This command produces a report of all hardware links. To use it on the IOC, issue the command:
dbhcr > report
The report will probably not be in the sort order desired. The Unix command:
sort report > report.sort
should produce the sort order you desire.
Print Periodic Lists:
This routine prints a list of all records in the periodic scan list of the specified rate. If rate is 0.0 all period lists are shown.
Print Event Lists:
This routine prints a list of all records in the event scan list for the specified event nunber. If event_number is 0 all event scan lists are shown.
Print I/O Event Lists:
This routine prints a list of all records in the I/O event scan lists.
The built-in time providers depend on the IOC's target architecture, so some of the specific subsystem report commands listed below are only available on the architectures that use that particular provider.
This routine displays the time providers and their priority levels that have registered with the General Time subsystem for both current and event times. At level 1 it also shows the current time as obtained from each provider.
Installs the optional Last Resort event provider at priority 999, which returns the current time for every event number.
Only vxWorks and RTEMS targets use this time provider. The report displays the provider's synchronization state, and at interest level 1 it also gives the synchronization interval, when it last synchronized, the nominal and measured system tick rates, and on vxWorks the NTP server address.
On vxWorks and RTEMS this command shuts down the NTP time synchronization thread. With the thread shut down, the driver will no longer act as a current time provider.
This time provider is used on several target architectures, registered as the time provider of last resort. On vxWorks and RTEMS the report displays the synchronization state, when it last synchronized the system time with a higher priority provider, and the synchronization interval. On workstation operating systems the synchronization task is not started on the assumption that some other process is taking care of synchronzing the OS clock as appropriate, so the report is minimal.
Some sites may prefer to provide their own implementation of a system clock time provider to replace the built-in one. On vxWorks and RTEMS this command stops the OS Clock synchronization thread, allowing the OS clock to free-run. The time provider will continue to return the current system time after this command is used however.
Specifies macro substitutions used when access security is initialized.
This command defines a new access security file.
This command reinitializes the access security system. It rereads the access security file in order to create the new access
security database. This command is useful either because the
asSetFilename command was used to change the file or
because the file itself was modified. Note that it is also possible to reinitialize the access security via a subroutine record.
See the access security document for details.
This provides a complete dump of the access security database.
aspuag("<user access group>")
Print the members of the user access group. If no user access group is specified then the members of all user access groups are displayed.
asphag("<host access group>")
Print the members of the host access group. If no host access group is specified then the members of all host access groups are displayed.
asprules("<access security group>")
Print the rules for the specified access security group or if no group is specified for all groups.
aspmem("<access security group>", <print clients>)
Print the members (records) that belong to the specified access security group, for all groups if no group is specified. If
<print clients> is (0, 1) then Channel Access clients attached to each member (are not, are) shown.
Channel Access Server Report
Level can have one of the following values:
Prints server's protocol version level and a one line summary for each client attached. The summary lines contain the client's login name, client's host name, client's protocol version number, and the number of channel created within the server by the client.
Level one provides all information in level 0 and adds the task id used by the server for each client, the client's IP protocol type, the file number used by the server for the client, the number of seconds elapsed since the last request was received from the client, the number of seconds elapsed since the last response was sent to the client, the number of unprocessed request bytes from the client, the number of response bytes which have not been flushed to the client, the client's IP address, the client's port number, and the client's state.
Level two provides all information in levels 0 and 1 and adds the number of bytes allocated by each client and a list of channel names used by each client. Level 2 also provides information about the number of bytes in the server's free memory pool, the distribution of entries in the server's resource hash table, and the list of IP addresses to which the server is sending beacons. The channel names are shown in the form:
This routine prints the Channel Access event list for the specified record.
Database to Channel Access Report - See ``Record Link Reports"
Prints a report of the channel access links for the INP fields of the access security rules. Level 0 produces a summary report. Level 1 produces a summary report plus details on any unconnect channels. Level 2 produces the summary nreport plus a detail report on each channel.
NOTE: This routine is only available on vxWorks. On PowerPC CPUs it requires BSP support to work, and even then it cannot display chained interrupts using the same vector.
Print Interrupt Vector List
Print the environment variables that are created with epicsEnvSet. These are defined in <base>/config/CONFIG_ENV
and <base>/config/CONFIG_SITE_ENV or else by user applications calling
Show Environment variables. On vxWorks it shows the variables created via calls to
Print release information for iocCore.
These routines are normally only of interest to EPICS system developers NOT to Application Developers.
Test Get Field:
This performs a
dbNameToAddr and then calls
dbGetField with all possible request types and options. It prints the
results of each call. This routine is of most interest to system developers for testing database access.
Test Put Field:
This command performs a
dbNameToAddr, then calls
dbPutField, followed by
dbgf for each possible request type.
This routine is of interest to system developers for testing database access.
Test Process Notify:
This command performs a
dbProcessNotify request. If a value argument is provided it issues a
putProcessRequest to the named record; if no value is provided it issues a
processGetRequest. This routine is mainly of interest to system developers for testing database access.
Lock Set Report:
This command generates a report showing the lock set to which each record belongs. If
recordname is 0,
records are shown, otherwise only records in the same lock set as
recordname are shown.
level can have the following values:
Show locked locksets:
This command generates a report showing all locked locksets, the records they contain, the lockset state and the thread
that currently owns the lockset. The
level argument is passed to
epicsMutexShow to adjust the information reported
about each locked epicsMutex.
Database to channel access report
This command generates a report showing database channel access links. If
recordname is ``*" then information about
all records is shown otherwise only information about the specified record.
level can have the following values:
Report hardware links. See ``Hardware Reports".
These routines are of interest to EPICS system developers. They are used to test the old database access interface, which is still used by Channel Access.
Get Field Test:
This performs a
db_name_to_addr and then calls
db_get_field with all possible request types. It prints the results
of each call. This routine is of interest to system developers for testing database access.
Put Field Test:
This command performs a
db_get_field and prints the result for each
possible request type. This routine is of interest to system developers for testing database access.
Test Process Notify:
This routine tests
dbProcessNotify via the old database access interface.
It only supports issuing a
putProcessRequest to the named record.
The current path for database includes is displayed.
If the second argument is 0 then all menus are displayed.
Dump Record Description:
If the second argument is 0 then all descriptions of all records are displayed.
Dump Field Description:
dbDumpField(pdbbase,"<record type>","<field name>")
If the second argument is 0 then the field descriptions of all records are displayed. If the third argument is 0 then the description of all fields are displayed.
Dump Device Support:
If the second argument is 0 then the device support for all record types is displayed.
Dump Driver Support:
Dump Record Instances:
If the second argument is 0 then the record instances for all record types are displayed. The third argument determines
which fields are displayed just like for the command
Dump breakpoint table
This command dumps a breakpoint table. If the second argument is 0 all breakpoint tables are dumped.
Dump the Process variable Directory:
This command shows how many records are mapped to each hash table entry of the process variable directory. If verbose is not 0 then the command also displays the names which hash to each hash table entry.