Retrieve the transaction records from the advanced accounting data file.
The libaacct.a library.
#include <sys/aacct.h>
int getproclist(filename, begin_time, end_time, p_list);
int getlparlist(filename, begin_time, end_time, l_list);
int getarmlist(filename, begin_time, end_time, t_list);
char *filename;
long long begin_time;
long long end_time;
struct aacct_tran **p_list, **l_list, **t_list
The getproclist, getlparlist, and getarmlist subroutines parse the specified advanced accounting data file and retrieve the process, LPAR, and ARM transaction records, respectively. The retrieved transaction records are returned in the form of a linked list of type struct aacct_tran_rec.
These APIs can be called multiple times with different accounting data file names in order to generate a consolidated list of transaction records from multiple data files. They append the new file data to the end of the linked list pointed to by the p_list, l_list, and t_list arguments. They also internally sort the transaction records based on the time of transaction, which gives users a time-sorted list of transaction records from these routines.
The getproclist, getlparlist, and getarmlist subroutines can also be used to retrieve the intended transaction records for a particular interval of time by passing the begin and end times of the interval as arguments to these routines. If these interval arguments are specified as -1, transaction records for all the intervals are retrieved.
Item | Description |
---|---|
begin_time | Specifies the start timestamp for collecting records in a particular intervals. The input is in seconds since EPOCH. Specifying -1 retrieves all the records. |
end_time | Specifies the end timestamp for collecting records in a particular intervals. The input is in seconds since EPOCH. Specifying -1 retrieves all the records. |
filename | Name of the advanced accounting data file. |
l_list | Pointers to the linked list of aacct_tran_rec structures, which hold the retrieved LPAR records. |
p_list | Pointers to the linked list of aacct_tran_rec structures, which hold the retrieved process records. |
t_list | Pointers to the linked list of aacct_tran_rec structures, which hold the retrieved ARM records. |
No restrictions. Any user can call this function.
Item | Description |
---|---|
0 | The call to the subroutine was successful. |
-1 | The call to the subroutine failed. |
Item | Description |
---|---|
EINVAL | The passed pointer is NULL. |
ENOENT | Specified data file does not exist. |
EPERM | Permission denied. Unable to read the data file. |
ENOMEM | Insufficient memory. |