]> git.cworth.org Git - apitrace/blob - cli/trace_analyzer.cpp
48153f02a50cdd831861dd7c064b0c2899368cd8
[apitrace] / cli / trace_analyzer.cpp
1 /**************************************************************************
2  * Copyright 2012 Intel corporation
3  *
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  *
24  **************************************************************************/
25
26 #include <sstream>
27
28 #include "trace_analyzer.hpp"
29
30 #define MAX(a, b) ((a) > (b) ? (a) : (b))
31 #define STRNCMP_LITERAL(var, literal) strncmp((var), (literal), sizeof (literal) -1)
32
33 /* Rendering often has no side effects, but it can in some cases,
34 * (such as when transform feedback is active, or when rendering
35 * targets a framebuffer object). */
36 bool
37 TraceAnalyzer::renderingHasSideEffect(void)
38 {
39     return transformFeedbackActive || framebufferObjectActive;
40 }
41
42 /* Provide: Record that the given call affects the given resource
43  * as a side effect. */
44 void
45 TraceAnalyzer::provide(std::string resource, trace::CallNo call_no)
46 {
47     resources[resource].insert(call_no);
48 }
49
50 /* Like provide, but with a simply-formatted string, (appending an
51  * integer to the given string). */
52 void
53 TraceAnalyzer::providef(std::string resource,
54                         int resource_no,
55                         trace::CallNo call_no)
56 {
57     std::stringstream ss;
58     ss << resource << resource_no;
59     provide(ss.str(), call_no);
60 }
61
62 /* Link: Establish a dependency between resource 'resource' and
63  * resource 'dependency'. This dependency is captured by name so
64  * that if the list of calls that provide 'dependency' grows
65  * before 'resource' is consumed, those calls will still be
66  * captured. */
67 void
68 TraceAnalyzer::link(std::string resource, std::string dependency)
69 {
70     dependencies[resource].insert(dependency);
71 }
72
73 /* Like link, but with a simply-formatted string, (appending an
74  * integer to the given string). */
75 void
76 TraceAnalyzer::linkf(std::string resource, std::string dependency, int dep_no)
77 {
78
79     std::stringstream ss;
80     ss << dependency << dep_no;
81     link(resource, ss.str());
82 }
83
84 /* Unlink: Remove dependency from 'resource' on 'dependency'. */
85 void
86 TraceAnalyzer::unlink(std::string resource, std::string dependency)
87 {
88     dependencies[resource].erase(dependency);
89     if (dependencies[resource].size() == 0) {
90         dependencies.erase(resource);
91     }
92 }
93
94 /* Like unlink, but with a simply-formated string, (appending an
95  * integer to the given string). */
96 void
97 TraceAnalyzer::unlinkf(std::string resource, std::string dependency, int dep_no)
98 {
99
100     std::stringstream ss;
101     ss << dependency << dep_no;
102     unlink(resource, ss.str());
103 }
104
105 /* Unlink all: Remove dependencies from 'resource' to all other
106  * resources. */
107 void
108 TraceAnalyzer::unlinkAll(std::string resource)
109 {
110     dependencies.erase(resource);
111 }
112
113 /* Resolve: Recursively compute all calls providing 'resource',
114  * (including linked dependencies of 'resource' on other
115  * resources). */
116 std::set<unsigned>
117 TraceAnalyzer::resolve(std::string resource)
118 {
119     std::set<std::string> *deps;
120     std::set<std::string>::iterator dep;
121
122     std::set<unsigned> *calls;
123     std::set<unsigned>::iterator call;
124
125     std::set<unsigned> result, deps_set;
126
127     /* Recursively chase dependencies. */
128     if (dependencies.count(resource)) {
129         deps = &dependencies[resource];
130         for (dep = deps->begin(); dep != deps->end(); dep++) {
131             deps_set = resolve(*dep);
132             for (call = deps_set.begin(); call != deps_set.end(); call++) {
133                 result.insert(*call);
134             }
135         }
136     }
137
138     /* Also look for calls that directly provide 'resource' */
139     if (resources.count(resource)) {
140         calls = &resources[resource];
141         for (call = calls->begin(); call != calls->end(); call++) {
142             result.insert(*call);
143         }
144     }
145
146     return result;
147 }
148
149 /* Consume: Resolve all calls that provide the given resource, and
150  * add them to the required list. Then clear the call list for
151  * 'resource' along with any dependencies. */
152 void
153 TraceAnalyzer::consume(std::string resource)
154 {
155
156     std::set<unsigned> calls;
157     std::set<unsigned>::iterator call;
158
159     calls = resolve(resource);
160
161     dependencies.erase(resource);
162     resources.erase(resource);
163
164     for (call = calls.begin(); call != calls.end(); call++) {
165         required.insert(*call);
166     }
167 }
168
169 void
170 TraceAnalyzer::stateTrackPreCall(trace::Call *call)
171 {
172
173     const char *name = call->name();
174
175     if (strcmp(name, "glBegin") == 0) {
176         insideBeginEnd = true;
177         return;
178     }
179
180     if (strcmp(name, "glBeginTransformFeedback") == 0) {
181         transformFeedbackActive = true;
182         return;
183     }
184
185     if (strcmp(name, "glActiveTexture") == 0) {
186         activeTextureUnit = static_cast<GLenum>(call->arg(0).toSInt());
187         return;
188     }
189
190     if (strcmp(name, "glBindTexture") == 0) {
191         GLenum target;
192         GLuint texture;
193
194         target = static_cast<GLenum>(call->arg(0).toSInt());
195         texture = call->arg(1).toUInt();
196
197         if (texture == 0) {
198             texture_map.erase(target);
199         } else {
200             texture_map[target] = texture;
201         }
202
203         return;
204     }
205
206     if (strcmp(name, "glUseProgram") == 0) {
207         activeProgram = call->arg(0).toUInt();
208     }
209
210     if (strcmp(name, "glBindFramebuffer") == 0) {
211         GLenum target;
212         GLuint framebuffer;
213
214         target = static_cast<GLenum>(call->arg(0).toSInt());
215         framebuffer = call->arg(1).toUInt();
216
217         if (target == GL_FRAMEBUFFER || target == GL_DRAW_FRAMEBUFFER) {
218             if (framebuffer == 0) {
219                 framebufferObjectActive = false;
220             } else {
221                 framebufferObjectActive = true;
222             }
223         }
224         return;
225     }
226
227     if (strcmp(name, "glNewList") == 0) {
228         GLuint list = call->arg(0).toUInt();
229
230         insideNewEndList = list;
231     }
232 }
233
234 void
235 TraceAnalyzer::stateTrackPostCall(trace::Call *call)
236 {
237
238     const char *name = call->name();
239
240     if (strcmp(name, "glEnd") == 0) {
241         insideBeginEnd = false;
242         return;
243     }
244
245     if (strcmp(name, "glEndTransformFeedback") == 0) {
246         transformFeedbackActive = false;
247         return;
248     }
249
250     /* If this swapbuffers was included in the trace then it will
251      * have already consumed all framebuffer dependencies. If not,
252      * then clear them now so that they don't carry over into the
253      * next frame. */
254     if (call->flags & trace::CALL_FLAG_SWAP_RENDERTARGET &&
255         call->flags & trace::CALL_FLAG_END_FRAME) {
256         dependencies.erase("framebuffer");
257         resources.erase("framebuffer");
258         return;
259     }
260
261     if (strcmp(name, "glEndList") == 0) {
262         insideNewEndList = 0;
263     }
264 }
265
266 bool
267 TraceAnalyzer::callHasNoSideEffects(trace::Call *call, const char *name)
268 {
269     /* If call is flagged as no side effects, then we are done here. */
270     if (call->flags & trace::CALL_FLAG_NO_SIDE_EFFECTS) {
271         return true;
272     }
273
274     /* Similarly, swap-buffers calls don't have interesting side effects. */
275     if (call->flags & trace::CALL_FLAG_SWAP_RENDERTARGET &&
276         call->flags & trace::CALL_FLAG_END_FRAME) {
277         return true;
278     }
279
280     /* Not known as a no-side-effect call. Return false for more analysis. */
281     return false;
282 }
283
284 bool
285 TraceAnalyzer::recordTextureSideEffects(trace::Call *call, const char *name)
286 {
287     if (strcmp(name, "glGenTextures") == 0) {
288         const trace::Array *textures = dynamic_cast<const trace::Array *>(&call->arg(1));
289         size_t i;
290         GLuint texture;
291
292         if (textures) {
293             for (i = 0; i < textures->size(); i++) {
294                 texture = textures->values[i]->toUInt();
295                 providef("texture-", texture, call->no);
296             }
297         }
298         return true;
299     }
300
301     /* FIXME: When we start tracking framebuffer objects as their own
302      * resources, we will want to link the FBO to the given texture
303      * resource, (and to this call). For now, just link render state
304      * to the texture, and force this call to be required. */
305     if (strcmp(name, "glFramebufferTexture2D") == 0) {
306         GLuint texture;
307
308         texture = call->arg(3).toUInt();
309
310         linkf("render-state", "texture-", texture);
311
312         provide("state", call->no);
313     }
314
315     if (strcmp(name, "glBindTexture") == 0) {
316         GLenum target;
317         GLuint texture;
318
319         std::stringstream ss_target, ss_texture;
320
321         target = static_cast<GLenum>(call->arg(0).toSInt());
322         texture = call->arg(1).toUInt();
323
324         ss_target << "texture-unit-" << activeTextureUnit << "-target-" << target;
325         ss_texture << "texture-" << texture;
326
327         resources.erase(ss_target.str());
328         provide(ss_target.str(), call->no);
329
330         unlinkAll(ss_target.str());
331         link(ss_target.str(), ss_texture.str());
332
333         /* FIXME: This really shouldn't be necessary. The effect
334          * this provide() has is that all glBindTexture calls will
335          * be preserved in the output trace (never trimmed). Carl
336          * has a trace ("btr") where a glBindTexture call should
337          * not be necessary at all, (it's immediately followed
338          * with a glBindTexture to a different texture and no
339          * intervening texture-related calls), yet this 'provide'
340          * makes the difference between a trim_stress test failing
341          * and passing.
342          *
343          * More investigation is necessary, but for now, be
344          * conservative and don't trim. */
345         provide("state", call->no);
346
347         return true;
348     }
349
350     /* FIXME: Need to handle glMultiTexImage and friends. */
351     if (STRNCMP_LITERAL(name, "glTexImage") == 0 ||
352         STRNCMP_LITERAL(name, "glTexSubImage") == 0 ||
353         STRNCMP_LITERAL(name, "glCopyTexImage") == 0 ||
354         STRNCMP_LITERAL(name, "glCopyTexSubImage") == 0 ||
355         STRNCMP_LITERAL(name, "glCompressedTexImage") == 0 ||
356         STRNCMP_LITERAL(name, "glCompressedTexSubImage") == 0 ||
357         strcmp(name, "glInvalidateTexImage") == 0 ||
358         strcmp(name, "glInvalidateTexSubImage") == 0) {
359
360         std::set<unsigned> *calls;
361         std::set<unsigned>::iterator c;
362         std::stringstream ss_target, ss_texture;
363
364         GLenum target = static_cast<GLenum>(call->arg(0).toSInt());
365
366         ss_target << "texture-unit-" << activeTextureUnit << "-target-" << target;
367         ss_texture << "texture-" << texture_map[target];
368
369         /* The texture resource depends on this call and any calls
370          * providing the given texture target. */
371         provide(ss_texture.str(), call->no);
372
373         if (resources.count(ss_target.str())) {
374             calls = &resources[ss_target.str()];
375             for (c = calls->begin(); c != calls->end(); c++) {
376                 provide(ss_texture.str(), *c);
377             }
378         }
379
380         return true;
381     }
382
383     if (strcmp(name, "glEnable") == 0) {
384         GLenum cap;
385
386         cap = static_cast<GLenum>(call->arg(0).toSInt());
387
388         if (cap == GL_TEXTURE_1D ||
389             cap == GL_TEXTURE_2D ||
390             cap == GL_TEXTURE_3D ||
391             cap == GL_TEXTURE_CUBE_MAP)
392         {
393             std::stringstream ss;
394
395             ss << "texture-unit-" << activeTextureUnit << "-target-" << cap;
396
397             link("render-state", ss.str());
398         }
399
400         provide("state", call->no);
401         return true;
402     }
403
404     if (strcmp(name, "glDisable") == 0) {
405         GLenum cap;
406
407         cap = static_cast<GLenum>(call->arg(0).toSInt());
408
409         if (cap == GL_TEXTURE_1D ||
410             cap == GL_TEXTURE_2D ||
411             cap == GL_TEXTURE_3D ||
412             cap == GL_TEXTURE_CUBE_MAP)
413         {
414             std::stringstream ss;
415
416             ss << "texture-unit-" << activeTextureUnit << "-target-" << cap;
417
418             unlink("render-state", ss.str());
419         }
420
421         provide("state", call->no);
422         return true;
423     }
424
425     /* No known texture-related side effects. Return false for more analysis. */
426     return false;
427 }
428
429 bool
430 TraceAnalyzer::recordShaderSideEffects(trace::Call *call, const char *name)
431 {
432     if (strcmp(name, "glCreateShader") == 0 ||
433         strcmp(name, "glCreateShaderObjectARB") == 0) {
434
435         GLuint shader = call->ret->toUInt();
436         providef("shader-", shader, call->no);
437         return true;
438     }
439
440     if (strcmp(name, "glShaderSource") == 0 ||
441         strcmp(name, "glShaderSourceARB") == 0 ||
442         strcmp(name, "glCompileShader") == 0 ||
443         strcmp(name, "glCompileShaderARB") == 0 ||
444         strcmp(name, "glGetShaderiv") == 0 ||
445         strcmp(name, "glGetShaderInfoLog") == 0) {
446
447         GLuint shader = call->arg(0).toUInt();
448         providef("shader-", shader, call->no);
449         return true;
450     }
451
452     if (strcmp(name, "glCreateProgram") == 0 ||
453         strcmp(name, "glCreateProgramObjectARB") == 0) {
454
455         GLuint program = call->ret->toUInt();
456         providef("program-", program, call->no);
457         return true;
458     }
459
460     if (strcmp(name, "glAttachShader") == 0 ||
461         strcmp(name, "glAttachObjectARB") == 0) {
462
463         GLuint program, shader;
464         std::stringstream ss_program, ss_shader;
465
466         program = call->arg(0).toUInt();
467         shader = call->arg(1).toUInt();
468
469         ss_program << "program-" << program;
470         ss_shader << "shader-" << shader;
471
472         link(ss_program.str(), ss_shader.str());
473         provide(ss_program.str(), call->no);
474
475         return true;
476     }
477
478     if (strcmp(name, "glDetachShader") == 0 ||
479         strcmp(name, "glDetachObjectARB") == 0) {
480
481         GLuint program, shader;
482         std::stringstream ss_program, ss_shader;
483
484         program = call->arg(0).toUInt();
485         shader = call->arg(1).toUInt();
486
487         ss_program << "program-" << program;
488         ss_shader << "shader-" << shader;
489
490         unlink(ss_program.str(), ss_shader.str());
491
492         return true;
493     }
494
495     if (strcmp(name, "glUseProgram") == 0 ||
496         strcmp(name, "glUseProgramObjectARB") == 0) {
497
498         GLuint program;
499
500         program = call->arg(0).toUInt();
501
502         unlinkAll("render-program-state");
503
504         if (program == 0) {
505             unlink("render-state", "render-program-state");
506             provide("state", call->no);
507         } else {
508             std::stringstream ss;
509
510             ss << "program-" << program;
511
512             link("render-state", "render-program-state");
513             link("render-program-state", ss.str());
514
515             provide(ss.str(), call->no);
516         }
517
518         return true;
519     }
520
521     if (strcmp(name, "glGetUniformLocation") == 0 ||
522         strcmp(name, "glGetUniformLocationARB") == 0 ||
523         strcmp(name, "glGetFragDataLocation") == 0 ||
524         strcmp(name, "glGetFragDataLocationEXT") == 0 ||
525         strcmp(name, "glGetSubroutineUniformLocation") == 0 ||
526         strcmp(name, "glGetProgramResourceLocation") == 0 ||
527         strcmp(name, "glGetProgramResourceLocationIndex") == 0 ||
528         strcmp(name, "glGetVaryingLocationNV") == 0) {
529
530         GLuint program = call->arg(0).toUInt();
531
532         providef("program-", program, call->no);
533
534         return true;
535     }
536
537     /* For any call that accepts 'location' as its first argument,
538      * perform a lookup in our location->program map and add a
539      * dependence on the program we find there. */
540     if (call->sig->num_args > 0 &&
541         strcmp(call->sig->arg_names[0], "location") == 0) {
542
543         providef("program-", activeProgram, call->no);
544
545         /* We can't easily tell if this uniform is being used to
546          * associate a sampler in the shader with a texture
547          * unit. The conservative option is to assume that it is
548          * and create a link from the active program to any bound
549          * textures for the given unit number.
550          *
551          * FIXME: We should be doing the same thing for calls to
552          * glUniform1iv. */
553         if (strcmp(name, "glUniform1i") == 0 ||
554             strcmp(name, "glUniform1iARB") == 0) {
555
556             GLint max_unit = MAX(GL_MAX_TEXTURE_COORDS, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS);
557
558             GLint unit = call->arg(1).toSInt();
559             std::stringstream ss_program;
560             std::stringstream ss_texture;
561
562             if (unit < max_unit) {
563
564                 ss_program << "program-" << activeProgram;
565
566                 ss_texture << "texture-unit-" << GL_TEXTURE0 + unit << "-target-";
567
568                 /* We don't know what target(s) might get bound to
569                  * this texture unit, so conservatively link to
570                  * all. Only bound textures will actually get inserted
571                  * into the output call stream. */
572                 linkf(ss_program.str(), ss_texture.str(), GL_TEXTURE_1D);
573                 linkf(ss_program.str(), ss_texture.str(), GL_TEXTURE_2D);
574                 linkf(ss_program.str(), ss_texture.str(), GL_TEXTURE_3D);
575                 linkf(ss_program.str(), ss_texture.str(), GL_TEXTURE_CUBE_MAP);
576             }
577         }
578
579         return true;
580     }
581
582     /* FIXME: We cut a huge swath by assuming that any unhandled
583      * call that has a first argument named "program" should not
584      * be included in the trimmed output unless the program of
585      * that number is also included.
586      *
587      * This heuristic is correct for many cases, but we should
588      * actually carefully verify if this includes some calls
589      * inappropriately, or if it misses some.
590      */
591     if (strcmp(name, "glLinkProgram") == 0 ||
592         strcmp(name, "glLinkProgramARB") == 0 ||
593         (call->sig->num_args > 0 &&
594          (strcmp(call->sig->arg_names[0], "program") == 0 ||
595           strcmp(call->sig->arg_names[0], "programObj") == 0))) {
596
597         GLuint program = call->arg(0).toUInt();
598         providef("program-", program, call->no);
599         return true;
600     }
601
602     /* No known shader-related side effects. Return false for more analysis. */
603     return false;
604 }
605
606 bool
607 TraceAnalyzer::recordDrawingSideEffects(trace::Call *call, const char *name)
608 {
609     /* Handle all rendering operations, (even though only glEnd is
610      * flagged as a rendering operation we treat everything from
611      * glBegin through glEnd as a rendering operation). */
612     if (call->flags & trace::CALL_FLAG_RENDER ||
613         insideBeginEnd) {
614
615         std::set<unsigned> calls;
616         std::set<unsigned>::iterator c;
617
618         provide("framebuffer", call->no);
619
620         calls = resolve("render-state");
621
622         for (c = calls.begin(); c != calls.end(); c++) {
623             provide("framebuffer", *c);
624         }
625
626         /* In some cases, rendering has side effects beyond the
627          * framebuffer update. */
628         if (renderingHasSideEffect()) {
629             provide("state", call->no);
630             for (c = calls.begin(); c != calls.end(); c++) {
631                 provide("state", *c);
632             }
633         }
634
635         return true;
636     }
637
638     /* No known drawing-related side effects. Return false for more analysis. */
639     return false;
640 }
641
642 void
643 TraceAnalyzer::recordSideEffects(trace::Call *call)
644 {
645
646     const char *name = call->name();
647
648     /* FIXME: If we encode the list of commands that are executed
649      * immediately (as opposed to those that are compiled into a
650      * display list) then we could generate a "display-list-X"
651      * resource just as we do for "texture-X" resources and only
652      * emit it in the trace if a glCallList(X) is emitted. For
653      * now, simply punt and include anything within glNewList and
654      * glEndList in the trim output. This guarantees that display
655      * lists will work, but does not trim out unused display
656      * lists. */
657     if (insideNewEndList != 0) {
658         provide("state", call->no);
659
660         /* Also, any texture bound inside a display list is
661          * conservatively considered required. */
662         if (strcmp(name, "glBindTexture") == 0) {
663             GLuint texture = call->arg(1).toUInt();
664
665             linkf("state", "texture-", texture);
666         }
667
668         return;
669     }
670
671     if (trimFlags & TRIM_FLAG_NO_SIDE_EFFECTS) {
672
673         if (callHasNoSideEffects(call, name)) {
674             return;
675         }
676     }
677
678     if (trimFlags & TRIM_FLAG_TEXTURES) {
679         
680         if (recordTextureSideEffects(call, name)) {
681             return;
682         }
683     }
684
685     if (trimFlags & TRIM_FLAG_SHADERS) {
686
687         if (recordShaderSideEffects(call, name)) {
688             return;
689         }
690     }
691
692     if (trimFlags & TRIM_FLAG_DRAWING) {
693
694         if (recordDrawingSideEffects(call, name)) {
695             return;
696         }
697     }
698
699     /* By default, assume this call affects the state somehow. */
700     resources["state"].insert(call->no);
701 }
702
703 void
704 TraceAnalyzer::requireDependencies(trace::Call *call)
705 {
706
707     /* Swap-buffers calls depend on framebuffer state. */
708     if (call->flags & trace::CALL_FLAG_SWAP_RENDERTARGET &&
709         call->flags & trace::CALL_FLAG_END_FRAME) {
710         consume("framebuffer");
711     }
712
713     /* By default, just assume this call depends on generic state. */
714     consume("state");
715 }
716
717 TraceAnalyzer::TraceAnalyzer(TrimFlags trimFlagsOpt = -1):
718     transformFeedbackActive(false),
719     framebufferObjectActive(false),
720     insideBeginEnd(false),
721     insideNewEndList(0),
722     activeTextureUnit(GL_TEXTURE0),
723     trimFlags(trimFlagsOpt)
724 {
725     /* Nothing needed. */
726 }
727
728 TraceAnalyzer::~TraceAnalyzer()
729 {
730     /* Nothing needed. */
731 }
732
733 /* Analyze this call by tracking state and recording all the
734  * resources provided by this call as side effects.. */
735 void
736 TraceAnalyzer::analyze(trace::Call *call)
737 {
738
739     stateTrackPreCall(call);
740
741     recordSideEffects(call);
742
743     stateTrackPostCall(call);
744 }
745
746 /* Require this call and all of its dependencies to be included in
747  * the final trace. */
748 void
749 TraceAnalyzer::require(trace::Call *call)
750 {
751
752     /* First, find and insert all calls that this call depends on. */
753     requireDependencies(call);
754
755     /* Then insert this call itself. */
756     required.insert(call->no);
757 }
758
759 /* Return a set of all the required calls, (both those calls added
760  * explicitly with require() and those implicitly depended
761  * upon. */
762 std::set<unsigned>  *
763 TraceAnalyzer::get_required(void)
764 {
765     return &required;
766 }