- ring.buffer[ring.head][0] = proc_id;
- ring.buffer[ring.head][1] = proc_status;
- ring.buffer[ring.head][2] = 0;
- ring.buffer[ring.head][3] =
- (long long unsigned int)CDTIME_T_TO_US(cdtime());
+ DEBUG("procevent plugin: Process %d status is now %s at %llu", proc_id,
+ (proc_status == PROCEVENT_EXITED ? "EXITED" : "STARTED"),
+ (long long unsigned int)CDTIME_T_TO_US(cdtime()));
+
+ if (proc_status == PROCEVENT_EXITED) {
+ ring.buffer[ring.head][0] = proc_id;
+ ring.buffer[ring.head][1] = proc_status;
+ ring.buffer[ring.head][2] = proc_extra;
+ ring.buffer[ring.head][3] =
+ (long long unsigned int)CDTIME_T_TO_US(cdtime());
+ } else {
+ ring.buffer[ring.head][0] = proc_id;
+ ring.buffer[ring.head][1] = proc_status;
+ ring.buffer[ring.head][2] = 0;
+ ring.buffer[ring.head][3] =
+ (long long unsigned int)CDTIME_T_TO_US(cdtime());
+ }
+
+ ring.head = next;