File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/metadata Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 2020
2121import java .util .ArrayList ;
2222import java .util .Collection ;
23+ import java .util .LinkedHashMap ;
2324import java .util .List ;
25+ import java .util .Map ;
26+ import java .util .Map .Entry ;
2427import java .util .stream .Collectors ;
2528
2629import org .eclipse .jdt .annotation .NonNull ;
4649import org .eclipse .tracecompass .internal .ctf .core .utils .JsonMetadataStrings ;
4750
4851import com .google .common .collect .Iterables ;
52+ import com .google .gson .JsonElement ;
4953
5054/**
5155 * IOStructGen
@@ -151,6 +155,15 @@ private void parseRoot(ICTFMetadataNode root) throws ParseException {
151155 throw new ParseException ("Only one trace block is allowed" ); //$NON-NLS-1$
152156 }
153157 traceNode = child ;
158+ if (child instanceof JsonTraceMetadataNode ) {
159+ JsonTraceMetadataNode node = (JsonTraceMetadataNode ) child ;
160+ Map <String , String > env = new LinkedHashMap <>();
161+ for ( Entry <String , JsonElement > entry : node .getEnvironment ().entrySet ()) {
162+ env .put (entry .getKey (), entry .getValue ().toString ());
163+ }
164+ fTrace .setEnvironment (env );
165+
166+ }
154167 parseTrace (traceNode );
155168 } else if (CTFParser .tokenNames [CTFParser .STREAM ].equals (type ) || JsonMetadataStrings .FRAGMENT_DATA_STREAM .equals (type )) {
156169 StreamParser .INSTANCE .parse (child , new StreamParser .Param (fTrace , fRoot ));
You can’t perform that action at this time.
0 commit comments