@@ -190,13 +190,18 @@ public static void showTracingDialog(
190190 private static void showTracingDialog (
191191 TraceType type , Client client , Shell shell , Models models , Widgets widgets ) {
192192 models .analytics .postInteraction (View .Trace , ClientAction .Show );
193+
193194 TraceInputDialog input =
194195 new TraceInputDialog (shell , type , models , widgets , models .devices ::loadDevices );
196+
195197 if (loadDevicesAndShowDialog (input , models ) == Window .OK ) {
196- TraceProgressDialog progress = new TraceProgressDialog (
197- shell , models .analytics , input .getValue (), widgets .theme );
198+ TraceProgressDialog progress =
199+ new TraceProgressDialog (shell , models .analytics , input .getValue (), widgets .theme );
200+
198201 Tracer .Trace trace = Tracer .trace (client , shell , input .getValue (), progress );
202+
199203 progress .setTrace (trace );
204+
200205 if (progress .open () == Window .OK && progress .successful ()) {
201206 models .capture .loadCapture (input .getValue ().output );
202207 }
@@ -429,7 +434,9 @@ public TraceInput(Composite parent, TraceType type, Models models, Widgets widge
429434 createGroup (this , "Application" , new GridLayout (2 , false )),
430435 new GridData (GridData .FILL_HORIZONTAL ));
431436 targetLabel = createLabel (appGroup , TARGET_LABEL + ":" );
437+
432438 traceTarget = withLayoutData (new ActionTextbox (appGroup , trace .getUri ()) {
439+
433440 @ Override
434441 protected String createAndShowDialog (String current ) {
435442 DeviceCaptureInfo dev = getSelectedDevice ();
@@ -450,6 +457,7 @@ protected String createAndShowDialog(String current) {
450457 }
451458 return null ;
452459 }
460+
453461 }, new GridData (SWT .FILL , SWT .FILL , true , false ));
454462
455463 createLabel (appGroup , "Additional Arguments:" );
@@ -1070,11 +1078,26 @@ public TraceRequest getTraceRequest(Settings settings) {
10701078 options .setClearCache (clearCache .getSelection ());
10711079 }
10721080
1081+ if (dev .isFuchsia ()) {
1082+ if (type == TraceType .System ) {
1083+ options .setFuchsiaTraceConfig (FuchsiaTraceConfigDialog .getCategories (settings ));
1084+ } else if (type == TraceType .Vulkan ) {
1085+ String uri = trace .getUri ();
1086+ if (!uri .isEmpty ()) {
1087+ String [] tokens = uri .split ("\\ s+" );
1088+ int globalId = Integer .parseInt (tokens [0 ]);
1089+ options .setFuchsiaTraceConfig (FuchsiaTraceConfigDialog .getGlobalId (globalId ));
1090+ } else {
1091+ throw new AssertionError ("No global ID found in URI" );
1092+ }
1093+ } else {
1094+ throw new AssertionError ("Invalid Fuchsia trace type" );
1095+ }
1096+ }
1097+
10731098 if (type == TraceType .System ) {
10741099 options .setDuration (duration .getSelection ());
1075- if (dev .isFuchsia ()) {
1076- options .setFuchsiaTraceConfig (FuchsiaTraceConfigDialog .getConfig (settings ));
1077- } else {
1100+ if (!dev .isFuchsia ()) {
10781101 int durationMs = duration .getSelection () * 1000 ;
10791102 // TODO: this isn't really unlimited.
10801103 durationMs = (durationMs == 0 ) ? (int )MINUTES .toMillis (10 ) : durationMs ;
0 commit comments