52 #include <sys/types.h> 61 #define SEND_MODE_OFF 0 62 #define SEND_MODE_ONCE 1 63 #define SEND_MODE_ON 2 73 DLT_STRING(
"dlt-system-processes, send process info."));
76 char filename[PATH_MAX];
82 DIR *dir = opendir(
"/proc");
85 while ((dp=readdir(dir)) !=
NULL)
87 if(isdigit(dp->d_name[0]))
90 snprintf(filename,PATH_MAX,
"/proc/%s/cmdline",dp->d_name);
91 pFile = fopen(filename,
"r");
94 bytes = fread(buffer, 1,
sizeof(buffer)-1, pFile);
97 if((strcmp((*popts).Name[n],
"*")==0) ||
98 (strcmp(buffer, (*popts).Name[n])==0))
101 snprintf(filename,PATH_MAX,
"/proc/%s/%s", dp->d_name,(*popts).Filename[n]);
102 pFile = fopen(filename,
"r");
105 bytes = fread(buffer, 1,
sizeof(buffer)-1, pFile);
114 if(strcmp((*popts).Name[n],
"*") !=0)
124 DLT_STRING(
"dlt-system-processes, failed to open /proc."));
135 DLT_STRING(
"dlt-system-processes, in thread."));
153 if(process_delays[i] <= 0)
171 DLT_STRING(
"dlt-system-processes, starting process log."));
172 static pthread_attr_t t_attr;
#define DLT_SYSTEM_LOG_PROCESSES_MAX
DLT_IMPORT_CONTEXT(dltsystem)
int Mode[DLT_SYSTEM_LOG_PROCESSES_MAX]
#define DLT_DECLARE_CONTEXT(CONTEXT)
int TimeDelay[DLT_SYSTEM_LOG_PROCESSES_MAX]
unsigned char buffer[BUFFER_SIZE]
Buffer for dlt file transfer. The size is defined by BUFFER_SIZE.
#define DLT_REGISTER_CONTEXT(CONTEXT, CONTEXTID, DESCRIPTION)
#define DLT_LOG(CONTEXT, LOGLEVEL, ARGS...)
void start_logprocess(DltSystemConfiguration *conf)
void logprocess_thread(void *v_conf)
LogProcessOptions LogProcesses
pthread_t threads[MAX_THREADS]