kviewinfo
The kviewinfo utility is used to generate a cross reference by function and view of where views are used. It can then recommend suitable views based on those views created. For each record it also tracks what views exist for the record and a histogram of how often each FLD from the record is used. Here is an example page.
Before running the utility you must first generate the raw view data by add the GenerateViewInfo flag to the flag section of your build.xml then run a full build using kmake. This will generate a .k7view XML file for each .kbin file built. It does slow down the build process slightly.
Then you can run the kviewinfo utility which will create a temporary subdirectory of the $KBIN output directory containing an XML file for each function and record. These XML files reference an XSLT stylesheet and can viewed in an XSLT enabled web browser like Mozilla, Firefox or IE5.5.
kmake -b K8-ORA-7 -a -i -k kviewinfo -b K8-ORA-7
Command line switches
Switch | Purpose |
---|---|
-b system | Build using the specified system name from kconf.xml |
-f | Name of source file to output generated views to |
-h | Generate viewinfo help files. Originally these were always generated, but creating the help files took longer than the rest of the process so this is now enabled by the option |
-i | Do not iterate. This is only used for debugging purposes |
-n | Number of views to generate for each DEF DATABASE ROW |
-s | Operate silently without printing status or error messages |
-u | Specify a build xml file directly rather than using a system name |
-v | Print version information and terminate |
-? | Produce a usage message on standard output |
View optimization
kviewinfo can also generate optimum views for a particular system. This will generate n optimum views for each DEF DATABASE ROW. Both n and the file to generate these views to must be specified by the user. As part of the process kviewinfo will generate a .viewpatch file per source file in the same directory as the source file. The patch file contains information for KCML on how to automatically apply the generated views to the system. To use the patch files you will need to set $OPTIONS_RUN_63=0x01 when building/using the system.
Example:kmake -b K8-ORA-7 -a -i -k kviewinfo -b K8-ORA-7 -n 30 -f c:/k8/sw/programs/genviews.src
kmake -b K8-ORA-7-PATCH -a -i -k
Exit codes
If kviewinfo encounters an error situation it will terminate setting its exit code to one of the following:
0 | Success |
2 | Fatal error |
See also: