1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
package Torello.Browser.BrowserAPI;

// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Java-HTML Imports
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

import Torello.Browser.*;
import Torello.Browser.helper.*;
import Torello.Browser.JavaScriptAPI.*;
import Torello.JSON.*;

import Torello.Java.ReadOnly.ReadOnlyList;
import Torello.Java.ReadOnly.ReadOnlyArrayList;

import Torello.JavaDoc.Annotations.StaticFunctional;
import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg;

import Torello.Browser.BrowserAPI.NestedHelpers.Commands.Tracing$$Commands;


// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// JDK Imports
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

import javax.json.JsonObject;
import javax.json.JsonValue;

/**
 * <SPAN CLASS=COPIEDJDK><B><CODE>[No Description Provided by Google]</CODE></B></SPAN>
 * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.CODE_GEN_NOTE>
 */
@StaticFunctional@JDHeaderBackgroundImg(EmbedTagFileID="CDP.WOOD_PLANK_NOTE")
public class Tracing
{
    // No Pubic Constructors
    private Tracing() { }


    // ********************************************************************************************
    // ********************************************************************************************
    // Eliminated Types
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * Configuration for memory dump. Used only when "memory-infra" category is enabled.
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>

     * <EMBED CLASS='external-html' DATA-CTAS='JsonValue' DATA-FILE-ID=CDP.EliminatedType
     *     DATA-NAME=MemoryDumpConfig>
     */
    public static final String MemoryDumpConfig =
        "MemoryDumpConfig has been eliminated.\n" +
        "It was replaced with the standard Java-Type: JsonValue";


    // ********************************************************************************************
    // ********************************************************************************************
    // Enumerated String Constants Lists
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * Details exposed when memory request explicitly declared.
     * Keep consistent with memory_dump_request_args.h and
     * memory_instrumentation.mojom
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
     */
    public static final ReadOnlyList<String> MemoryDumpLevelOfDetail = new ReadOnlyArrayList<>
        (String.class, "background", "detailed", "light");

    /**
     * Compression type to use for traces returned via streams.
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
     */
    public static final ReadOnlyList<String> StreamCompression = new ReadOnlyArrayList<>
        (String.class, "gzip", "none");

    /**
     * Data format of a trace. Can be either the legacy JSON format or the
     * protocol buffer format. Note that the JSON format will be deprecated soon.
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
     */
    public static final ReadOnlyList<String> StreamFormat = new ReadOnlyArrayList<>
        (String.class, "json", "proto");

    /**
     * Backend type to use for tracing. <CODE>chrome</CODE> uses the Chrome-integrated
     * tracing service and is supported on all platforms. <CODE>system</CODE> is only
     * supported on Chrome OS and uses the Perfetto system tracing service.
     * <CODE>auto</CODE> chooses <CODE>system</CODE> when the perfettoConfig provided to Tracing.start
     * specifies at least one non-Chrome data source; otherwise uses <CODE>chrome</CODE>.
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
     */
    public static final ReadOnlyList<String> TracingBackend = new ReadOnlyArrayList<>
        (String.class, "auto", "chrome", "system");



    // ********************************************************************************************
    // ********************************************************************************************
    // Basic Types
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * <CODE>[No Description Provided by Google]</CODE>
     * 
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Tracing DATA-API=BrowserAPI>
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
    public static class TraceConfig
        extends BaseType<TraceConfig>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Tracing.TraceConfig> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.Types.
                Tracing$$TraceConfig$$.singleton;

        /**
         * Controls how the trace buffer stores data. The default is <CODE>recordUntilFull</CODE>.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
         * <EMBED CLASS='external-html' DATA-D=Tracing DATA-C=TraceConfig DATA-F=recordMode DATA-FILE-ID=CDP.EL1>
         * @see BaseType#enumStrList(String)
         */
        public final String recordMode;

        /**
         * Size of the trace buffer in kilobytes. If not specified or zero is passed, a default value
         * of 200 MB would be used.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
         */
        public final Number traceBufferSizeInKb;

        /**
         * Turns on JavaScript stack sampling.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
         */
        public final Boolean enableSampling;

        /**
         * Turns on system tracing.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
         */
        public final Boolean enableSystrace;

        /**
         * Turns on argument filter.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
         */
        public final Boolean enableArgumentFilter;

        /**
         * Included category filters.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final String[] includedCategories;

        /**
         * Excluded category filters.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final String[] excludedCategories;

        /**
         * Configuration to synthesize the delays in tracing.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
         */
        public final String[] syntheticDelays;

        /**
         * Configuration for memory dump triggers. Used only when "memory-infra" category is enabled.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
         */
        public final JsonValue memoryDumpConfig;

        /** Constructor.  Please review this class' fields for documentation. */
        public TraceConfig(
                ReadOnlyList<Boolean> isPresent, String recordMode, Number traceBufferSizeInKb,
                Boolean enableSampling, Boolean enableSystrace, Boolean enableArgumentFilter,
                String[] includedCategories, String[] excludedCategories, String[] syntheticDelays,
                JsonValue memoryDumpConfig
            )
        {
            super(singleton, Domains.Tracing, "TraceConfig", 9);

            this.recordMode             = recordMode;
            this.traceBufferSizeInKb    = traceBufferSizeInKb;
            this.enableSampling         = enableSampling;
            this.enableSystrace         = enableSystrace;
            this.enableArgumentFilter   = enableArgumentFilter;
            this.includedCategories     = includedCategories;
            this.excludedCategories     = excludedCategories;
            this.syntheticDelays        = syntheticDelays;
            this.memoryDumpConfig       = memoryDumpConfig;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 9, "Tracing.TraceConfig");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static TraceConfig fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<TraceConfig> descriptor()
        { return singleton.descriptor(); }
    }


    // ********************************************************************************************
    // ********************************************************************************************
    // Command-Return Types
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * Request a global memory dump.
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Tracing DATA-API=BrowserAPI DATA-CMD=requestMemoryDump>
     * @see Tracing#requestMemoryDump
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_CMD_JDHBI")
    public static class requestMemoryDump$$RET
        extends BaseType<requestMemoryDump$$RET>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Tracing.requestMemoryDump$$RET> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.CmdReturns.
                Tracing$$requestMemoryDump$$RET.singleton;

        /** GUID of the resulting global memory dump. */
        public final String dumpGuid;

        /** True iff the global memory dump succeeded. */
        public final boolean success;

        /** Constructor.  Please review this class' fields for documentation. */
        public requestMemoryDump$$RET
            (ReadOnlyList<Boolean> isPresent, String dumpGuid, boolean success)
        {
            super(singleton, Domains.Tracing, "requestMemoryDump", 2);

            this.dumpGuid   = dumpGuid;
            this.success    = success;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 2, "Tracing.requestMemoryDump$$RET");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static requestMemoryDump$$RET fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<requestMemoryDump$$RET> descriptor()
        { return singleton.descriptor(); }
    }


    // ********************************************************************************************
    // ********************************************************************************************
    // Event Types
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * <CODE>[No Description Provided by Google]</CODE>
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Tracing DATA-API=BrowserAPI>
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
    public static class bufferUsage
        extends BrowserEvent<bufferUsage>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Tracing.bufferUsage> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.Events.
                Tracing$$bufferUsage$$.singleton;

        /**
         * A number in range [0..1] that indicates the used size of event buffer as a fraction of its
         * total size.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final Number percentFull;

        /**
         * An approximate number of events in the trace log.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final Number eventCount;

        /**
         * A number in range [0..1] that indicates the used size of event buffer as a fraction of its
         * total size.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final Number value;

        /** Constructor.  Please review this class' fields for documentation. */
        public bufferUsage
            (ReadOnlyList<Boolean> isPresent, Number percentFull, Number eventCount, Number value)
        {
            super(singleton, Domains.Tracing, "bufferUsage", 3);

            this.percentFull    = percentFull;
            this.eventCount     = eventCount;
            this.value          = value;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 3, "Tracing.bufferUsage");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static bufferUsage fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<bufferUsage> descriptor()
        { return singleton.descriptor(); }
    }

    /**
     * Contains a bucket of collected trace events. When tracing is stopped collected events will be
     * sent as a sequence of dataCollected events followed by tracingComplete event.
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Tracing DATA-API=BrowserAPI>
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
    public static class dataCollected
        extends BrowserEvent<dataCollected>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Tracing.dataCollected> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.Events.
                Tracing$$dataCollected$$.singleton;

        /** <CODE>[No Description Provided by Google]</CODE> */
        public final JsonValue value;

        /** Constructor.  Please review this class' fields for documentation. */
        public dataCollected(ReadOnlyList<Boolean> isPresent, JsonValue value)
        {
            super(singleton, Domains.Tracing, "dataCollected", 1);

            this.value = value;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 1, "Tracing.dataCollected");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static dataCollected fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<dataCollected> descriptor()
        { return singleton.descriptor(); }
    }

    /**
     * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
     * delivered via dataCollected events.
     * 
     * <EMBED CLASS=globalDefs DATA-DOMAIN=Tracing DATA-API=BrowserAPI>
     */
    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
    public static class tracingComplete
        extends BrowserEvent<tracingComplete>
        implements java.io.Serializable
    {
        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
        protected static final long serialVersionUID = 1;

        private static final NestedHelper<Tracing.tracingComplete> singleton =
            Torello.Browser.BrowserAPI.NestedHelpers.Events.
                Tracing$$tracingComplete$$.singleton;

        /**
         * Indicates whether some trace data is known to have been lost, e.g. because the trace ring
         * buffer wrapped around.
         */
        public final boolean dataLossOccurred;

        /**
         * A handle of the stream that holds resulting trace data.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         */
        public final String stream;

        /**
         * Trace data format of returned stream.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         * <EMBED CLASS='external-html' DATA-D=Tracing DATA-C=StreamFormat DATA-F=traceFormat DATA-FILE-ID=CDP.EL2>
         * @see BaseType#enumStrList(String)
         */
        public final String traceFormat;

        /**
         * Compression format of returned stream.
         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
         * <EMBED CLASS='external-html' DATA-D=Tracing DATA-C=StreamCompression DATA-F=streamCompression DATA-FILE-ID=CDP.EL2>
         * @see BaseType#enumStrList(String)
         */
        public final String streamCompression;

        /** Constructor.  Please review this class' fields for documentation. */
        public tracingComplete(
                ReadOnlyList<Boolean> isPresent, boolean dataLossOccurred, String stream,
                String traceFormat, String streamCompression
            )
        {
            super(singleton, Domains.Tracing, "tracingComplete", 4);

            this.dataLossOccurred   = dataLossOccurred;
            this.stream             = stream;
            this.traceFormat        = traceFormat;
            this.streamCompression  = streamCompression;

            this.isPresent = (isPresent == null)
                ? singleton.generateIsPresentList(this)
                : THROWS.check(isPresent, 4, "Tracing.tracingComplete");
        }

        /** Creates an instance of this class from a {@link JsonObject}.*/
        public static tracingComplete fromJSON(JsonObject jo)
        { return singleton.fromJSON(jo); }

        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
        public static NestedDescriptor<tracingComplete> descriptor()
        { return singleton.descriptor(); }
    }




    // ********************************************************************************************
    // ********************************************************************************************
    // Commands
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * Stop trace events collection.
     * 
     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
     *
     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
     * browser receives the invocation-request.
     *
     * <BR /><BR /><DIV CLASS=JDHint>
     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
     * the Browser Function has run to completion.
     * </DIV>
     */
    public static Script<Void> end()
    {
        // Ultra-Simple Request JSON - Because this method has no parameters
        final String requestJSON = "{\"method\":\"Tracing.end\"}";

        return Script.NO_RET(Domains.Tracing, "end", requestJSON);
    }

    /**
     * Gets supported tracing categories.
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * 
     * @return An instance of <CODE>{@link Script}&lt;String[]&gt;</CODE>
     * 
     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
     * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise}
     * <CODE>&lt;String[]&gt;</CODE> will be returned
     *
     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
     * be retrieved.</I>
     *
     * <BR /><BR /><DIV CLASS=JDHint>
     * This Browser Function's {@code Promise} returns:
     * <CODE>String[] (<B>categories</B>)</CODE>
     * <BR />
     * A list of supported tracing categories.
     * </DIV>
     */
    public static Script<String[]> getCategories()
    {
        // Ultra-Simple Request JSON - Because this method has no parameters
        final String requestJSON = "{\"method\":\"Tracing.getCategories\"}";

        return new Script<>(
            Domains.Tracing, "getCategories", requestJSON,
            Tracing$$Commands::getCategories,
            String[].class
        );
    }

    /**
     * Record a clock sync marker in the trace.
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * 
     * @param syncId The ID of this clock sync marker
     * 
     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
     *
     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
     * browser receives the invocation-request.
     *
     * <BR /><BR /><DIV CLASS=JDHint>
     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
     * the Browser Function has run to completion.
     * </DIV>
     */
    public static Script<Void> recordClockSyncMarker(String syncId)
    {
        // Build the JSON Request-Object (as a String); only 1 Parameter is passed
        final String requestJSON = WriteJSON.get
            (CDPTypes.STRING, "syncId", false, "Tracing.recordClockSyncMarker", syncId);

        return Script.NO_RET(Domains.Tracing, "recordClockSyncMarker", requestJSON);
    }

    /**
     * Request a global memory dump.
     * 
     * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * 
     * @param deterministic Enables more deterministic results by forcing garbage collection
     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
     * 
     * @param levelOfDetail Specifies level of details in memory dump. Defaults to "detailed".
     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
     * 
     * @return An instance of <CODE>{@link Script}&lt;{@link requestMemoryDump$$RET}&gt;</CODE>
     * 
     * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using
     * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise}
     * <CODE>&lt;{@link requestMemoryDump$$RET}&gt;</CODE> will be returned
     *
     * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>,
     * using {@link Promise#await()}, <I>and the returned result of this Browser Function may
     * be retrieved.</I>
     *
     * <BR /><BR /><DIV CLASS=JDHint>
     * This Browser Function's {@code Promise} returns:{@link requestMemoryDump$$RET}
     * A dedicated return type implies that the browser may return more than 1 datum
     * </DIV>
     */
    public static Script<requestMemoryDump$$RET> requestMemoryDump
        (Boolean deterministic, String levelOfDetail)
    {
        // Convert all Method Parameters into a JSON Request-Object (as a String)
        final String requestJSON = WriteJSON.get(
            Tracing$$Commands.requestMemoryDump$$, "Tracing.requestMemoryDump",
            deterministic, levelOfDetail
        );

        return new Script<>(
            Domains.Tracing, "requestMemoryDump", requestJSON,
            requestMemoryDump$$RET::fromJSON,
            requestMemoryDump$$RET.class
        );
    }

    /**
     * Start trace events collection.
     * 
     * <BR /><BR /><DIV CLASS=JDHint>
     * 👍 Because of the sheer number of input parameters to this method, there is a
     * a {@link CommandBuilder} variant to this method which may be invoked instead.
     * 
     * <BR /><BR />
     * Please View: {@link #start()}
     * </DIV>
     * 
     * @param categories Category/tag filter
     * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B>
     * 
     * @param options Tracing options
     * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B>
     * 
     * @param bufferUsageReportingInterval If set, the agent will issue bufferUsage events at this interval, specified in milliseconds
     * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * 
     * @param transferMode 
     * Whether to report trace events as series of dataCollected events or to save trace to a
     * stream (defaults to <CODE>ReportEvents</CODE>).
     * <BR />Acceptable Values: ["ReportEvents", "ReturnAsStream"]
     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
     * 
     * @param streamFormat 
     * Trace data format to use. This only applies when using <CODE>ReturnAsStream</CODE>
     * transfer mode (defaults to <CODE>json</CODE>).
     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
     * 
     * @param streamCompression 
     * Compression format to use. This only applies when using <CODE>ReturnAsStream</CODE>
     * transfer mode (defaults to <CODE>none</CODE>)
     * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * 
     * @param traceConfig -
     * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
     * 
     * @param perfettoConfig 
     * Base64-encoded serialized perfetto.protos.TraceConfig protobuf message
     * When specified, the parameters <CODE>categories</CODE>, <CODE>options</CODE>, <CODE>traceConfig</CODE>
     * are ignored. (Encoded as a base64 string when passed over JSON)
     * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * 
     * @param tracingBackend Backend type (defaults to <CODE>auto</CODE>)
     * <BR /><B CLASS=Opt-Top>OPTIONAL</B><B CLASS=Exp-Top>EXPERIMENTAL</B>
     * 
     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
     *
     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
     * browser receives the invocation-request.
     *
     * <BR /><BR /><DIV CLASS=JDHint>
     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
     * the Browser Function has run to completion.
     * </DIV>
     */
    public static Script<Void> start(
            String categories, String options, Number bufferUsageReportingInterval,
            String transferMode, String streamFormat, String streamCompression,
            TraceConfig traceConfig, String perfettoConfig, String tracingBackend
        )
    {
        // Convert all Method Parameters into a JSON Request-Object (as a String)
        final String requestJSON = WriteJSON.get(
            Tracing$$Commands.start$$, "Tracing.start",
            categories, options, bufferUsageReportingInterval, transferMode, streamFormat,
            streamCompression, traceConfig, perfettoConfig, tracingBackend
        );

        return Script.NO_RET(Domains.Tracing, "start", requestJSON);
    }


    // ********************************************************************************************
    // ********************************************************************************************
    // CommandBuilder Getter-Methods
    // ********************************************************************************************
    // ********************************************************************************************


    /**
     * Creates a buider for conveniently assigning parameters to this method.
     * 
     * <BR /><BR /><DIV CLASS=JDHint>
     * Note that the original method expects 9 parameters, and can be cumbersome.
     * </DIV>
     * 
     * @return {@link CommandBuilder} instance, for assigning parameter values, one by one.
     * @see #start
     */
    public static CommandBuilder<Void> start()
    { return CommandBuilder.builder(Tracing$$Commands.start$$); }


}