|
RDK Documentation (Open Sourced RDK Components)
|
48 #define USLEEP_SEC 100
49 #define MAX_PROCESS 10
50 #define RDK_EC_MAXLEN 5
52 #define RTL_FILENAME "/.rtl_temp.log"
53 #define EXEC_COUNTER_FILENAME "/tmp/.dcaCounter.txt"
55 #define INCLUDE_PROPERTIES "/etc/include.properties"
56 #define DEVICE_PROPERTIES "/etc/device.properties"
57 #define DELIMITER "<#=#>"
59 #define DEFAULT_SEEK_PREFIX "/opt/.telemetry/tmp/rtl_"
60 #define DEFAULT_LOG_PATH "/opt/logs/"
63 extern char *PERSISTENT_PATH;
64 extern char *LOG_PATH;
65 extern char *DEVICE_TYPE;
67 extern char *RTL_TEMP_LOG_FILE;
68 extern char *OUTPUT_FILE;
70 extern cJSON *SEARCH_RESULT_JSON;
71 extern cJSON *ROOT_JSON;
73 extern int CUR_EXEC_COUNT;
74 extern long LAST_SEEK_VALUE;
77 #define LOG(fmt,__etc...) \
79 fprintf(stderr, fmt"\n", ##__etc); \
83 #ifndef UNREFERENCED_PARAMETER
84 #define UNREFERENCED_PARAMETER(_p_) (void)(_p_)
95 int checkLogSeek(
char *name,
long prevSeekVal);
98 void saveExecCounter(
void);
void initSearchResultJson(cJSON **root, cJSON **sr)
This API creates "searchResult" JSON array.
void clearSearchResultJson(cJSON **root)
This API deletes the result JSON object.
void updateExecCounter(void)
To update current dca execution count.
void printJson(cJSON *root)
This API is to print Json result.
int getProcUsage(char *processName)
To get process usage.
char * getsRotatedLog(char *buf, int buflen, char *name)
Function to return rotated log file.
void writeLogSeek(char *name, long seek_value)
Function to write the rotated Log file.
int getLoadAvg(void)
This API is to find the load average of system and add it to the SearchResult JSON.
int isSkipParam(int skipInterval)
This API is to verify whether to skip this telemetry marker.
int readLogSeek(char *name, long *seek_value)
Function to read the rotated Log file.
void addToSearchResult(char *key, char *value)
This API is to append the key/value pair to the SearchResult JSON array .
void clearConfVal(void)
This function is to clear/free the global paths.
void updateIncludeConfVal(char *logpath, char *perspath)
Function to update the global paths like PERSISTENT_PATH,LOG_PATH from include.properties file.
void updateConfVal(char *logpath, char *perspath)
Function to update the configuration values from device.properties file.