call "CBL_CTF_TRACE_NOTIFY" using by value install-function by reference notif-install returning status-code
01 cblt-trc-notif-install typedef. 03 cblte-tni-version cblt-x4-comp5. *> pic x(4) comp-5. 03 cblte-tni-handle cblt-x4-comp5. *> pic x(4) comp-5. 03 cblte-tni-callback cblt-ppointer. *> procedure pointer
0 | Install a callback |
1 | Uninstall a callback |
To acquire a tracer handle to trace "mycomp" component events and install a callback to handle threshold level and property change notifications:
copy "cbltypes.cpy". copy "mfctf.cpy". 01 component-id pic x(7) value "mycomp". 01 install-params cblt-trc-notif-install. linkage section. 01 lk-tracer-handle pic x(4) comp-5. 01 lk-notif-type pic x(4) comp-5. 01 lk-notif-param pic x. 01 lk-notif-param-level redefines lk-notif-param pic x(4) comp-5. 01 lk-notif-param-property redefines lk-notif-param cblt-trc-notif-prop-change .... *> *> Acquire tracer handle *> call "CBL_CTF_TRACER_GET" using by value 0 by reference component-id by reference tracer-handle ... *> *> Install callback function *> move low-values to install-params move tracer-handle to cblte-tni-handle of install-params set cblte-tni-callback of install-params to entry "my-callback" call "CBL_CTF_TRACER_NOTIFY" using by value 0 by reference install-params ... goback. *> *> The callback function to handle trace level and property *> changes *> entry "my-callback" using by value lk-tracer-handle by value lk-notif-type by value lk-notif-param. evaluate lk-notif-type when 78-TRC-NOTIF-TYPE-LEVEL-CHANGE .... when 78-TRC-NOTIF-TYPE-PROP-CHANGE .... end-evaluate move 0 to return-code goback.
Comments:
A tracer configuration callback function is installed by a component to allow it to be notified when any configuration change to the associated tracer occurs, such as a threshold level change, or property value change.
The interface to the callback function is as follows:
where tracer-handle and notification-type are pic x(4) comp-5 items, and notification-param is a pic x(n). All parameters are input only. The callback function should set return-code to 0 on completion.
Version types (cblte-tnpc-version): 0 = structure version