opentracing: Add span to root if parent not found

If the quark for a parent span ID does not exist, add the span at the
child span at the root of the trace's span instead of returning.

Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Change-Id: Ia290e2d33f08499db65965d484e0f02a2bdc12e8
Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/172157
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.core/src/org/eclipse/tracecompass/incubator/internal/opentracing/core/analysis/spanlife/SpanLifeStateProvider.java b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.core/src/org/eclipse/tracecompass/incubator/internal/opentracing/core/analysis/spanlife/SpanLifeStateProvider.java
index 02c05c9..db2f4c6 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.core/src/org/eclipse/tracecompass/incubator/internal/opentracing/core/analysis/spanlife/SpanLifeStateProvider.java
+++ b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.core/src/org/eclipse/tracecompass/incubator/internal/opentracing/core/analysis/spanlife/SpanLifeStateProvider.java
@@ -109,7 +109,8 @@
         } else {
             Integer parentQuark = fSpanMap.get(refId);
             if (parentQuark == null) {
-                return;
+                // We don't have the parent span, just start this span at root
+                parentQuark = openTracingSpansQuark;
             }
             spanQuark = ss.getQuarkRelativeAndAdd(parentQuark, name + '/' + spanId + '/' + errorTag + '/' + processName);
         }