sstore_namespace_list, sstore_namespace_iter_next - Interface to search the namespace and explore system topology
cc [ flag... ] file... -lsstore [ library... ] #include <libsstore.h> sstore_err_t sstore_namespace_list(sstore_handle_t hdl, const char **ids, uint32_t id_count, sstore_range_t range, sstore_iter_t *iterp); sstore_err_t sstore_namespace_iter_next(sstore_handle_t hdl, sstore_iter_t iter, char **idp, uint64_t *start_tsp, uint64_t *end_tsp)
Handle to libsstore
Array of stats store identifiers
Total number of statistics store identifiers
Time range or data range
Passing NULL for range implies:
start-time = SS_TIME_NOW
end-time = SS_TIME_NOW
step = 1
Address to store the starting address of the iterator.
sstore_namespace_list() retrieves all of the matching identifiers. A resource is only shown if it is present during the given time range. The retrieved data is returned in the form of an iterator that can be used to read the data records. Once all the data records have been read from the iterator, the iterator should be freed using sstore_iter_free(3SSTORE).
The sstore_namespace_iter_next retrieves the next record in the iteration. Each record consists of an ssid and a time stamp. The reference pointers passed to this call are populated if the call succeeds. The identifier and time stamp, are populated on success do not need to be freed. They are freed on the next call to sstore_namespace_iter_next.
The given identifiers can use the wildcard character, * to match anything in the identifier except the reserved character combination, //:. So, a search pattern such as //:class.cpu//:res.id/* on a system that has cpu 0, 1, 2 and 3 online during the given time range returns the following identifiers:
//:class.cpu//:res.id/0 //:class.cpu//:res.id/1 //:class.cpu//:res.id/2 //:class.cpu//:res.id/3
A search pattern such as //:class.prset//:res.id/*//:class.cpu/res.id/* on a system that has two processor sets, 0, and 1 with cpu 0, and 1 being in processor set 0 and cpu 2, and 3 being in processor set 1 during the given time range returns the following identifiers:
//:class.prset//:res.id/0//:class.cpu/res.id/0 //:class.prset//:res.id/0//:class.cpu/res.id/1 //:class.prset//:res.id/1//:class.cpu/res.id/2 //:class.prset//:res.id/1//:class.cpu/res.id/3
The following search pattern will return an array with the identifiers for all the statistics that can be captured for cpu 0, 1, 2 and 3 if the start time and end time specified in the range are both SS_TIME_NOW, otherwise the pattern will return an array with the identifiers for all the statistics that were being captured during that time range:
//:class.cpu//:res.id///:s.[0:3]//:stat.*
Upon successful completion, sstore_namespace_list() and sstore_namespace_iter_next() return ESSTORE_OK. Otherwise, they return an error code, which is also cached in hdl.
The sstore_namespace_list() function will fail if:
Some arguments are invalid.
The connection to the Statistics Store failed or was interrupted.
The handle is invalid
No memory is available.
Statistics store is busy. Please retry after some time.
The total size of the result for the requested operation is larger than the maximum size limit set in hdl.
The sstore_data_iter_next() function will fail if:
Some arguments are invalid.
The handle is invalid
No more records left to iterate.
sstore_namespace_list() can throw up the following warnings:
An identifier is invalid.
See attributes(7) for descriptions of the following attributes:
|