#include <blackbox/chBlackBox.h>int bbList(KnBBStatus *status, int *nstatus);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
bbList() gives information about the set of black boxes on the system, by filling in the members of the status array.
The status parameter is an array of KnBBStatuses.
The nstatus parameter points to the number of KnBBStatuses passed in status.
KnBBStatus is a structure that identifies the state of a black box. It includes the following members:
One of the values of the KnBBState enumeration.
The time that the black box was frozen
The size in bytes of each buffer in the black box
The number of events in all buffers of the black box
The number of events dropped
The name of the underlying persistent store
The KnBBState enumeration can have one of the following values :
The currently active black box
Available for adding events
A black box frozen by bbFreeze()
Persistent store is unavailable
Reserved for non-blackbox use
For each KnBBStatus returned:
The bbs_state member is one of the values of the KnBBState enumeration, as described above.
If bbs_state is BBS_FROZEN, bbs_freezetime is the time that the black box was frozen. If bbs_state is some other value, the value of bbs_freezetime is undefined.
The bbs_size member is the size in bytes used to make up each buffer in the black box. Since each black box may have more than one buffer, the black box may use more total space than is indicated by bbs_size, but it is only guaranteed to have as much space as is indicated here. This can be used to determine how many events the black box is guaranteed to be able to store.
The bbs_count member is the number of events currently stored in all buffers of the black box being described. The KnBBEvent returned by bbRead() uses statically-sized buffers, so the black box is only guaranteed to be able to store (bbs_size / sizeof (KnBBEvent)) events at once. However, the events may be represented differently within the black box, which may allow more events to be stored, particularly if the events don't use all BB_MSG_MAX bytes of the event message body. This parameter can be used to get an approximation of how much space is necessary to capture some number of events from a given workload.
The bbs_ndropped member is the number of events dropped while events were being logged to this black box, i.e. were overwritten. It is reset when a black box is released through bbRelease().
The bbs_name member is the pathname of the persistent store holding the black box being described.
The caller can call bbGetNbb() first, to determine the number of black boxes configured on the node. When calling bbList(), nstatus should point to the number of KnBBStatuses passed in status. On successful return, nstatus will be filled in with the number of configured black boxes on the node.
If nstatus is less than the number of configured black boxes, status will be filled in with information about the first nstatus black boxes on the node.
bbList() returns K_OK on success, otherwise a negative error code is returned.
The status or nstatus argument points to an illegal address
An element of the status array is inconsistent
Some of the arguments provided are outside the caller's address space
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|