![]() |
RDK Documentation (Open Sourced RDK Components)
|
Functions | |
int | processTopPattern (char *logfile, GList *pchead, int pcIndex) |
This API processes the top command log file patterns to retrieve load average and process usage. More... | |
int | addToJson (GList *pchead) |
This function adds the value to the telemetry output json object. More... | |
int | getIPVideo (char *line, pcdata_t *pcnode) |
Function to process pattern if it has split text in the header. More... | |
int | getErrorCode (char *str, char *ec, int ec_length) |
To get RDK error code. More... | |
int | handleRDKErrCodes (GList **rdkec_head, char *line) |
Function to handle error codes received from the log file. More... | |
int | processCountPattern (char *logfile, GList *pchead, int pcIndex, GList **rdkec_head) |
Function to process pattern count (loggrep) More... | |
int | processPattern (char **prev_file, char *logfile, GList **rdkec_head, GList *pchead, int pcIndex) |
Generic pattern function based on pattern to call top/count or using ccsp message bus. More... | |
char * | strSplit (char *str, char *delim) |
Function like strstr but based on the string delimiter. More... | |
void | getDType (char *filename, char *header, DType_t *dtype) |
To get node data type based on pattern. More... | |
int | parseFile (char *fname) |
Main logic function to parse sorted MAP file and to process pattern list. More... | |
int | main (int argc, char *argv[]) |
Main Function. More... | |
int | main () |
void | initSearchResultJson (cJSON **root, cJSON **sr) |
This API creates "searchResult" JSON array. More... | |
void | addToSearchResult (char *key, char *value) |
This API is to append the key/value pair to the SearchResult JSON array . More... | |
void | clearSearchResultJson (cJSON **root) |
This API deletes the result JSON object. More... | |
void | printJson (cJSON *root) |
This API is to print Json result. More... | |
int | getProcUsage (char *processName) |
To get process usage. More... | |
int | getProcPidStat (int pid, procinfo *pinfo) |
To get status of a process from its process ID. More... | |
char * | getResidentMemory (procMemCpuInfo *pInfo, int *processPid) |
To get the reserve memory of a given process in pages. More... | |
int | ccsp_handler_init () |
This API initalizes the ccsp message bus. More... | |
void | ccsp_handler_exit () |
This API is to uninitialize message bus. | |
int | get_tr181param_value (const char *path_namespace, char *parm_value, int len) |
This API is to retrieve the value of TR181 telemetry. More... | |
int | getLoadAvg () |
This API is to find the load average of system and add it to the SearchResult JSON. More... | |
static int | fsize (FILE *fp) |
This function returns file size. More... | |
void | clearConfVal (void) |
This function is to clear/free the global paths. | |
void | updateExecCounter () |
To update current dca execution count. | |
void | saveExecCounter () |
int | isSkipParam (int skipInterval) |
This API is to verify whether to skip this telemetry marker. More... | |
char * | getsRotatedLog (char *buf, int buflen, char *name) |
Function to return rotated log file. More... | |
void | updateIncludeConfVal (char *logpath, char *perspath) |
Function to update the global paths like PERSISTENT_PATH,LOG_PATH from include.properties file. More... | |
void | updateConfVal (char *logpath, char *perspath) |
Function to update the configuration values from device.properties file. More... | |
int | readLogSeek (char *name, long *seek_value) |
Function to read the rotated Log file. More... | |
void | writeLogSeek (char *name, long seek_value) |
Function to write the rotated Log file. More... | |
int | getProcInfo (procMemCpuInfo *pmInfo) |
To get CPU and mem info. More... | |
int | getMemInfo (procMemCpuInfo *pmInfo) |
To get the reserve memory of a given process. More... | |
int | getCPUInfo (procMemCpuInfo *pInfo) |
To get CPU info. More... | |
int processTopPattern | ( | char * | logfile, |
GList * | pchead, | ||
int | pcIndex | ||
) |
This API processes the top command log file patterns to retrieve load average and process usage.
[in] | logfile | top_log file |
[in] | pchead | Node head |
[in] | pcIndex | Node count |
Returns | zero on success, appropriate errorcode otherwise. |
int addToJson | ( | GList * | pchead | ) |
int getIPVideo | ( | char * | line, |
pcdata_t * | pcnode | ||
) |
int getErrorCode | ( | char * | str, |
char * | ec, | ||
int | ec_length | ||
) |
int handleRDKErrCodes | ( | GList ** | rdkec_head, |
char * | line | ||
) |
int processCountPattern | ( | char * | logfile, |
GList * | pchead, | ||
int | pcIndex, | ||
GList ** | rdkec_head | ||
) |
int processPattern | ( | char ** | prev_file, |
char * | logfile, | ||
GList ** | rdkec_head, | ||
GList * | pchead, | ||
int | pcIndex | ||
) |
Generic pattern function based on pattern to call top/count or using ccsp message bus.
[in] | prev_file | The previous log file. |
[in] | logfile | The current log file. |
[in] | rdkec_head | RDK errorcode head |
[in] | pchead | Node head |
[in] | pcIndex | Node count |
Returns | 0 upon success. |
char* strSplit | ( | char * | str, |
char * | delim | ||
) |
void getDType | ( | char * | filename, |
char * | header, | ||
DType_t * | dtype | ||
) |
int parseFile | ( | char * | fname | ) |
Main logic function to parse sorted MAP file and to process pattern list.
MAP file is of the form $header<#=#>$content<#=#>$logFileName<#=#>$skipInterval.
[in] | fname | Configuration file. |
Return | 0 upon success, -1 on failure. |
int main | ( | int | argc, |
char * | argv[] | ||
) |
void initSearchResultJson | ( | cJSON ** | root, |
cJSON ** | sr | ||
) |
This API creates "searchResult" JSON array.
The search result list contains collection of telemetry marker headers with their value.
Eg: {"searchResult":[{"MOCA_INFO_pnc_enabled":"1"},{"samv2_boardver_split":" V3.0 ##"},{"RF_ERR_DS_lockfail":"1"},{"RF_ERR_T3_timeout":"2"}]}
[out] | root | JSON object |
[in] | sr | Search result JSON array |
void addToSearchResult | ( | char * | key, |
char * | value | ||
) |
void clearSearchResultJson | ( | cJSON ** | root | ) |
void printJson | ( | cJSON * | root | ) |
int getProcUsage | ( | char * | processName | ) |
int getProcPidStat | ( | int | pid, |
procinfo * | pinfo | ||
) |
To get status of a process from its process ID.
This will return information such as process priority, virtual memory size, signals etc.
[in] | pid | PID value of the process. |
[in] | pinfo | Process info. |
Return | 1 on success, appropiate errorcode otherwise. |
char* getResidentMemory | ( | procMemCpuInfo * | pInfo, |
int * | processPid | ||
) |
To get the reserve memory of a given process in pages.
[in] | pInfo | Process Name. |
[in] | processPid | Process Id. |
Definition at line 128 of file dcaprocess.cpp.
int ccsp_handler_init | ( | ) |
This API initalizes the ccsp message bus.
Returns | zero on success, appropiate errorcode otherwise. |
Definition at line 68 of file dcatr181.c.
int get_tr181param_value | ( | const char * | path_namespace, |
char * | parm_value, | ||
int | len | ||
) |
This API is to retrieve the value of TR181 telemetry.
Returns | zero on success, appropiate errorcode otherwise. |
Definition at line 101 of file dcatr181.c.
int getLoadAvg | ( | ) |
This API is to find the load average of system and add it to the SearchResult JSON.
Return | 1 on success. |
Definition at line 57 of file dcautils.c.
|
static |
This function returns file size.
[in] | fp | File name |
Definition at line 85 of file dcautils.c.
int isSkipParam | ( | int | skipInterval | ) |
This API is to verify whether to skip this telemetry marker.
[in] | skipInterval | Polling frequency |
Definition at line 163 of file dcautils.c.
char* getsRotatedLog | ( | char * | buf, |
int | buflen, | ||
char * | name | ||
) |
Function to return rotated log file.
[in] | buf | Buffer |
[in] | buflen | Maximum buffer length |
[in] | name | Current Log file |
Definition at line 190 of file dcautils.c.
void updateIncludeConfVal | ( | char * | logpath, |
char * | perspath | ||
) |
Function to update the global paths like PERSISTENT_PATH,LOG_PATH from include.properties file.
[in] | logpath | Log file path |
[in] | perspath | Persistent path |
Definition at line 397 of file dcautils.c.
void updateConfVal | ( | char * | logpath, |
char * | perspath | ||
) |
Function to update the configuration values from device.properties file.
[in] | logpath | Log file path |
[in] | perspath | Persistent path |
Definition at line 491 of file dcautils.c.
int readLogSeek | ( | char * | name, |
long * | seek_value | ||
) |
Function to read the rotated Log file.
[in] | name | Log file name. |
[in] | seek_value | Position to seek. |
Returns | -1 on failure, appropriate errorcode otherwise. |
Definition at line 635 of file dcautils.c.
void writeLogSeek | ( | char * | name, |
long | seek_value | ||
) |
Function to write the rotated Log file.
[in] | name | Log file name. |
[in] | seek_value | Position to seek. |
Returns | -1 on failure, appropriate errorcode otherwise. |
Definition at line 678 of file dcautils.c.
bool getProcInfo | ( | procMemCpuInfo * | pmInfo | ) |
int getMemInfo | ( | procMemCpuInfo * | pmInfo | ) |
int getCPUInfo | ( | procMemCpuInfo * | pInfo | ) |