- lttv_state_create_process(ts, process, cpu, child_pid, &s->parent.timestamp);
+ child_process = lttv_state_find_process(ts, ANY_CPU, child_pid);
+ if(child_process == NULL) {
+ lttv_state_create_process(ts, process, cpu,
+ child_pid, &s->parent.timestamp);
+ } else {
+ /* The process has already been created : due to time imprecision between
+ * multiple CPUs : it has been scheduled in before creation.
+ *
+ * Simply put a correct parent.
+ */
+ child_process->ppid = process->pid;
+ }