1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2003-2004 Michel Dagenais
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 /* This module inserts a hook in the program main loop. This hook processes
20 all the events in the main tracefile while testing the speed and
21 functionality of the state and stats computations. */
24 #include <lttv/lttv.h>
25 #include <lttv/attribute.h>
26 #include <lttv/hook.h>
27 #include <lttv/option.h>
28 #include <lttv/module.h>
29 #include <lttv/tracecontext.h>
30 #include <lttv/state.h>
31 #include <lttv/stats.h>
32 #include <ltt/trace.h>
33 #include <ltt/event.h>
35 #include <ltt/facility.h>
37 #define __UNUSED__ __attribute__((__unused__))
39 static LttvTraceset
*traceset
;
55 static char *a_dump_tracefiles
;
57 static char *a_save_sample
;
77 LttEventPosition
*a_event_position
;
79 typedef struct _save_state
{
90 static void lttv_trace_option(void __UNUSED__
*hook_data
)
94 trace
= ltt_trace_open(a_trace
);
95 if(trace
== NULL
) g_critical("cannot open trace %s", a_trace
);
96 lttv_traceset_add(traceset
, lttv_trace_new(trace
));
99 static double get_time()
103 g_get_current_time(>
);
104 return gt
.tv_sec
+ (double)gt
.tv_usec
/ (double)1000000.0;
107 static double run_one_test(LttvTracesetState
*ts
, LttTime start
, LttTime end
)
113 //lttv_traceset_context_add_hooks(&ts->parent,
114 //before_traceset, after_traceset, NULL, before_trace, after_trace,
115 //NULL, before_tracefile, after_tracefile, NULL, before_event, after_event);
116 lttv_process_traceset_begin(&ts
->parent
,
123 for(i
= 0 ; i
< lttv_traceset_number(traceset
) ; i
++) {
124 ((LttvTraceState
*)(ts
->parent
.traces
[i
]))->save_interval
=a_save_interval
;
128 lttv_state_traceset_seek_time_closest(ts
, start
);
129 //lttv_process_traceset(&ts->parent, end, G_MAXULONG);
130 lttv_process_traceset_middle(&ts
->parent
,
136 //lttv_traceset_context_remove_hooks(&ts->parent,
137 //before_traceset, after_traceset, NULL, before_trace, after_trace,
138 //NULL, before_tracefile, after_tracefile, NULL, before_event, after_event);
139 lttv_process_traceset_end(&ts
->parent
,
150 gboolean
trace_event(void __UNUSED__
*hook_data
, void *call_data
)
152 LttvTracefileState
*tfs
= (LttvTracefileState
*)call_data
;
154 guint nb_block
, nb_event
;
158 ltt_event_position(tfs
->parent
.e
, a_event_position
);
159 ltt_event_position_get(a_event_position
, &nb_block
, &nb_event
, &tf
);
160 fprintf(stderr
,"Event %s %lu.%09lu [%u %u]\n",
161 ltt_eventtype_name(ltt_event_eventtype(tfs
->parent
.e
)),
162 tfs
->parent
.timestamp
.tv_sec
, tfs
->parent
.timestamp
.tv_nsec
,
168 gboolean
count_event(void *hook_data
, void __UNUSED__
*call_data
)
170 guint
*pcount
= (guint
*)hook_data
;
177 gboolean
save_state_copy_event(void *hook_data
, void *call_data
)
179 SaveState __UNUSED__
*save_state
= (SaveState
*)hook_data
;
181 LttvTracefileState
*tfs
= (LttvTracefileState
*)call_data
;
183 LttvTraceState
*ts
= (LttvTraceState
*)tfs
->parent
.t_context
;
189 if(ts
->nb_event
== 0 && strcmp(ltt_eventtype_name(
190 ltt_event_eventtype(tfs
->parent
.e
)), "block_start") == 0) {
191 if(a_save_sample
!= NULL
) {
192 filename
= g_string_new("");
193 g_string_printf(filename
, "%s.copy.%lu.%09lu.xml", a_save_sample
,
194 tfs
->parent
.timestamp
.tv_sec
, tfs
->parent
.timestamp
.tv_nsec
);
195 fp
= fopen(filename
->str
, "w");
196 if(fp
== NULL
) g_error("Cannot open %s", filename
->str
);
197 g_string_free(filename
, TRUE
);
198 lttv_state_write(ts
, tfs
->parent
.timestamp
, fp
);
200 } //else lttv_state_write(ts, tfs->parent.timestamp, save_state->fp);
206 gboolean
save_state_event(void *hook_data
, void *call_data
)
208 SaveState
*save_state
= (SaveState
*)hook_data
;
210 LttvTracefileState
*tfs
= (LttvTracefileState
*)call_data
;
212 LttvTraceState
*ts
= (LttvTraceState
*)tfs
->parent
.t_context
;
218 (save_state
->count
)++;
219 if(save_state
->count
% save_state
->interval
== 0 &&
220 save_state
->position
< save_state
->size
) {
221 if(a_save_sample
!= NULL
) {
222 filename
= g_string_new("");
223 g_string_printf(filename
, "%s.%u.xml.%u", a_save_sample
,
224 save_state
->position
, save_state
->version
);
225 fp
= fopen(filename
->str
, "w");
226 if(fp
== NULL
) g_error("Cannot open %s", filename
->str
);
227 g_string_free(filename
, TRUE
);
228 lttv_state_write(ts
, tfs
->parent
.timestamp
, fp
);
230 } //else lttv_state_write(ts, tfs->parent.timestamp, save_state->fp);
232 save_state
->write_time
[save_state
->position
] = tfs
->parent
.timestamp
;
233 save_state
->position
++;
239 static gboolean
process_traceset(void __UNUSED__
*hook_data
,
240 void __UNUSED__
*call_data
)
242 LttvTracesetStats
*tscs
;
244 LttvTracesetState
*ts
;
246 LttvTracesetContext
*tc
;
254 guint i
, j
, count
, nb_control
, nb_tracefile
, nb_block
, nb_event
, nb_equal
;
258 LttTracefile
*tracefile
, *tf
;
260 LttEvent
*event
= ltt_event_new();
262 LttFacility
*facility
;
264 LttEventType
*event_type
;
266 LttTime time
, previous_time
;
268 /* start_count is always initialized in this function _if_ there is always
269 * a block_start before a block_end.
271 long long unsigned cycle_count
, start_count
=0, delta_cycle
;
273 long long unsigned start_nsec
, end_nsec
, delta_nsec
, added_nsec
, added_nsec2
;
275 double cycle_per_nsec
, nsec_per_cycle
;
277 long long interpolated_nsec
, interpolated_nsec2
, end_nsec_sec
, end_nsec_nsec
;
281 LttTime zero_time
= ltt_time_zero
;
283 LttTime max_time
= { G_MAXULONG
, G_MAXULONG
};
285 a_event_position
= ltt_event_position_new();
287 if(a_dump_tracefiles
!= NULL
) {
288 for(i
= 0 ; i
< lttv_traceset_number(traceset
) ; i
++) {
289 trace
= lttv_trace(lttv_traceset_get(traceset
, i
));
290 nb_control
= ltt_trace_control_tracefile_number(trace
);
291 nb_tracefile
= nb_control
+ ltt_trace_per_cpu_tracefile_number(trace
);
292 for(j
= 0 ; j
< nb_tracefile
; j
++) {
294 tracefile
= ltt_trace_control_tracefile_get(trace
,j
);
297 tracefile
= ltt_trace_per_cpu_tracefile_get(trace
,j
- nb_control
);
300 filename
= g_string_new("");
301 g_string_printf(filename
, "%s.%u.%u.trace", a_dump_tracefiles
, i
, j
);
302 fp
= fopen(filename
->str
, "w");
303 if(fp
== NULL
) g_error("Cannot open %s", filename
->str
);
304 g_string_free(filename
, TRUE
);
305 ltt_tracefile_seek_time(tracefile
, zero_time
);
306 previous_time
= zero_time
;
308 while((ltt_tracefile_read(tracefile
, event
)) != NULL
) {
309 facility
= ltt_event_facility(event
);
310 event_type
= ltt_event_eventtype(event
);
311 time
= ltt_event_time(event
);
312 cycle_count
= ltt_event_cycle_count(event
);
313 ltt_event_position(event
, a_event_position
);
314 ltt_event_position_get(a_event_position
, &nb_block
, &nb_event
, &tf
);
315 fprintf(fp
,"%s.%s: %llu %lu.%09lu position %u/%u\n",
316 ltt_facility_name(facility
), ltt_eventtype_name(event_type
),
317 cycle_count
, (unsigned long)time
.tv_sec
,
318 (unsigned long)time
.tv_nsec
,
321 if(ltt_time_compare(time
, previous_time
) < 0) {
322 g_warning("Time decreasing trace %d tracefile %d position %u/%u",
323 i
, j
, nb_block
, nb_event
);
326 if(strcmp(ltt_eventtype_name(event_type
),"block_start") == 0) {
327 start_count
= cycle_count
;
330 else if(strcmp(ltt_eventtype_name(event_type
),"block_end") == 0) {
331 delta_cycle
= cycle_count
- start_count
;
332 end_nsec_sec
= (long long unsigned)time
.tv_sec
* (long long unsigned)1000000000;
333 end_nsec_nsec
= time
.tv_nsec
;
334 end_nsec
= end_nsec_sec
+ end_nsec_nsec
;
335 start_nsec
= (long long unsigned)start_time
.tv_sec
* (long long unsigned)1000000000 + (long long unsigned)start_time
.tv_nsec
;
336 delta_nsec
= end_nsec
- start_nsec
;
337 cycle_per_nsec
= (double)delta_cycle
/ (double)delta_nsec
;
338 nsec_per_cycle
= (double)delta_nsec
/ (double)delta_cycle
;
339 added_nsec
= (double)delta_cycle
* nsec_per_cycle
;
340 interpolated_nsec
= start_nsec
+ added_nsec
;
341 added_nsec2
= (double)delta_cycle
/ cycle_per_nsec
;
342 interpolated_nsec2
= start_nsec
+ added_nsec2
;
344 fprintf(fp
,"Time: start_count %llu, end_count %llu, delta_cycle %llu, start_nsec %llu, end_nsec_sec %llu, end_nsec_nsec %llu, end_nsec %llu, delta_nsec %llu, cycle_per_nsec %.25f, nsec_per_cycle %.25f, added_nsec %llu, added_nsec2 %llu, interpolated_nsec %llu, interpolated_nsec2 %llu\n", start_count
, cycle_count
, delta_cycle
, start_nsec
, end_nsec_sec
, end_nsec_nsec
, end_nsec
, delta_nsec
, cycle_per_nsec
, nsec_per_cycle
, added_nsec
, added_nsec2
, interpolated_nsec
, interpolated_nsec2
);
347 if(ltt_time_compare(time
, previous_time
) == 0) nb_equal
++;
348 else if(nb_equal
> 0) {
349 g_warning("Consecutive %d events with time %lu.%09lu",
350 nb_equal
+ 1, previous_time
.tv_sec
, previous_time
.tv_nsec
);
353 previous_time
= time
;
361 tscs
= g_object_new(LTTV_TRACESET_STATS_TYPE
, NULL
);
363 tc
= &tscs
->parent
.parent
;
365 lttv_context_init(tc
, traceset
);
367 /* For each case compute and print the elapsed time.
368 The first case is simply to run through all events with a
371 if(a_test1
|| a_test_all
) {
373 lttv_hooks_add(event_hook
, count_event
, &count
, LTTV_PRIO_DEFAULT
);
374 t
= run_one_test(ts
, zero_time
, max_time
);
375 lttv_hooks_remove_data(event_hook
, count_event
, &count
);
377 "Processing trace while counting events (%u events in %g seconds)",
381 /* Run through all events computing the state. */
383 if(a_test2
|| a_test_all
) {
384 lttv_state_add_event_hooks(ts
);
385 t
= run_one_test(ts
, zero_time
, max_time
);
386 lttv_state_remove_event_hooks(ts
);
387 g_warning("Processing trace while updating state (%g seconds)", t
);
390 /* Run through all events computing the state and writing it out
393 SaveState save_state
;
395 save_state
.interval
= a_sample_interval
;
396 save_state
.size
= a_sample_number
;
397 save_state
.fp
= stderr
;
398 save_state
.write_time
= g_new(LttTime
, a_sample_number
);
401 if(a_test3
|| a_test_all
) {
402 for(i
= 0 ; i
< 2 ; i
++) {
403 save_state
.count
= 0;
404 save_state
.position
= 0;
405 save_state
.version
= i
;
406 lttv_state_add_event_hooks(ts
);
407 lttv_hooks_add(event_hook
, save_state_event
, &save_state
,
409 t
= run_one_test(ts
, zero_time
, max_time
);
410 lttv_state_remove_event_hooks(ts
);
411 lttv_hooks_remove_data(event_hook
, save_state_event
, &save_state
);
412 g_warning("Processing while updating/writing state (%g seconds)", t
);
416 /* Run through all events computing the stats. */
418 if(a_test4
|| a_test_all
) {
419 if(lttv_profile_memory
) {
420 g_message("Memory summary before computing stats");
424 lttv_stats_add_event_hooks(tscs
);
425 t
= run_one_test(ts
, zero_time
, max_time
);
426 lttv_stats_remove_event_hooks(tscs
);
427 g_warning("Processing trace while counting stats (%g seconds)", t
);
429 if(lttv_profile_memory
) {
430 g_message("Memory summary after computing stats");
434 lttv_stats_sum_traceset(tscs
);
436 if(lttv_profile_memory
) {
437 g_message("Memory summary after summing stats");
441 lttv_context_fini(tc
);
442 lttv_context_init(tc
, traceset
);
444 if(lttv_profile_memory
) {
445 g_message("Memory summary after cleaning up the stats");
450 /* Run through all events computing the state and stats. */
452 if(a_test5
|| a_test_all
) {
453 if(lttv_profile_memory
) {
454 g_message("Memory summary before computing state and stats");
458 lttv_state_add_event_hooks(ts
);
459 lttv_stats_add_event_hooks(tscs
);
460 t
= run_one_test(ts
, zero_time
, max_time
);
461 lttv_state_remove_event_hooks(ts
);
462 lttv_stats_remove_event_hooks(tscs
);
464 "Processing trace while counting state and stats (%g seconds)", t
);
466 if(lttv_profile_memory
) {
467 g_message("Memory summary after computing and state and stats");
471 lttv_context_fini(tc
);
472 lttv_context_init(tc
, traceset
);
474 if(lttv_profile_memory
) {
475 g_message("Memory summary after cleaning up the stats");
480 /* Run through all events computing and saving the state. */
482 if(a_trace_event
) lttv_hooks_add(event_hook
, trace_event
, NULL
,
485 if(a_test6
|| a_test_all
) {
486 if(lttv_profile_memory
) {
487 g_message("Memory summary before computing and saving state");
491 lttv_state_add_event_hooks(ts
);
492 lttv_state_save_add_event_hooks(ts
);
493 if(a_save_state_copy
)
494 lttv_hooks_add(event_hook
, save_state_copy_event
, &save_state
,
496 t
= run_one_test(ts
, zero_time
, max_time
);
497 lttv_state_remove_event_hooks(ts
);
498 lttv_state_save_remove_event_hooks(ts
);
499 if(a_save_state_copy
)
500 lttv_hooks_remove_data(event_hook
,save_state_copy_event
, &save_state
);
502 g_warning("Processing trace while updating/saving state (%g seconds)", t
);
504 if(lttv_profile_memory
) {
505 g_message("Memory summary after computing/saving state");
510 /* Seek a few times to each saved position */
512 if((a_test7
&& a_test3
) || a_test_all
) {
513 g_assert(a_seek_number
>= 0);
514 for(i
= 0 ; i
< (guint
)a_seek_number
; i
++) {
515 gint reverse_j
; /* just to make sure j is unsigned */
516 for(reverse_j
= save_state
.position
- 1 ; reverse_j
>= 0 ; reverse_j
--) {
517 j
= (guint
)reverse_j
;
518 lttv_state_add_event_hooks(ts
);
519 t
= run_one_test(ts
, save_state
.write_time
[j
],
520 save_state
.write_time
[j
]);
521 lttv_state_remove_event_hooks(ts
);
522 g_warning("Seeking to %lu.%lu (%g seconds)",
523 save_state
.write_time
[j
].tv_sec
, save_state
.write_time
[j
].tv_nsec
,
526 if(a_save_sample
!= NULL
) {
527 filename
= g_string_new("");
528 g_string_printf(filename
, "%s.%d.xml.bak%d", a_save_sample
, j
, i
);
529 fp
= fopen(filename
->str
, "w");
530 if(fp
== NULL
) g_error("Cannot open %s", filename
->str
);
531 g_string_free(filename
, TRUE
);
532 lttv_state_write((LttvTraceState
*)tc
->traces
[0],
533 save_state
.write_time
[j
], fp
);
536 //else lttv_state_write((LttvTraceState *)tc->traces[0],
537 // save_state.write_time[j], save_state.fp);
542 if(a_trace_event
) lttv_hooks_remove_data(event_hook
, trace_event
, NULL
);
544 g_free(save_state
.write_time
);
545 g_free(a_event_position
);
546 lttv_context_fini(tc
);
547 g_object_unref(tscs
);
548 ltt_event_destroy(event
);
550 if(lttv_profile_memory
) {
551 g_message("Memory summary at the end of batchtest");
555 g_info("BatchTest end process traceset");
562 LttvAttributeValue value
;
564 LttvIAttribute
*attributes
= LTTV_IATTRIBUTE(lttv_global_attributes());
566 g_info("Init batchtest.c");
568 lttv_option_add("trace", 't',
569 "add a trace to the trace set to analyse",
570 "pathname of the directory containing the trace",
571 LTTV_OPT_STRING
, &a_trace
, lttv_trace_option
, NULL
);
573 a_trace_event
= FALSE
;
575 a_dump_tracefiles
= NULL
;
576 lttv_option_add("dump-tracefiles", 'D',
577 "Write event by event the content of tracefiles",
578 "basename for the files where to dump events",
579 LTTV_OPT_STRING
, &a_dump_tracefiles
, NULL
, NULL
);
581 a_save_sample
= NULL
;
582 lttv_option_add("save-sample", 's',
583 "Save state samples to multiple files",
584 "basename for the files containing the state samples",
585 LTTV_OPT_STRING
, &a_save_sample
, NULL
, NULL
);
587 a_save_state_copy
= FALSE
;
588 lttv_option_add("save-state-copy", 'S', "Write the state saved for seeking",
589 "", LTTV_OPT_NONE
, &a_save_state_copy
, NULL
, NULL
);
591 a_save_interval
= 100000;
592 lttv_option_add("save-interval", 'i',
593 "Interval between saving state",
594 "number of events before a block start triggers saving state",
595 LTTV_OPT_INT
, &a_save_interval
, NULL
, NULL
);
597 a_sample_interval
= 100000;
598 lttv_option_add("sample-interval", 'S',
599 "Interval between sampling state",
600 "number of events before sampling and writing state",
601 LTTV_OPT_INT
, &a_sample_interval
, NULL
, NULL
);
603 a_sample_number
= 20;
604 lttv_option_add("sample-number", 'N',
605 "Number of state samples",
607 LTTV_OPT_INT
, &a_sample_number
, NULL
, NULL
);
610 lttv_option_add("seek-number", 'K',
613 LTTV_OPT_INT
, &a_seek_number
, NULL
, NULL
);
616 lttv_option_add("test1", '1', "Test just counting events", "",
617 LTTV_OPT_NONE
, &a_test1
, NULL
, NULL
);
620 lttv_option_add("test2", '2', "Test computing the state", "",
621 LTTV_OPT_NONE
, &a_test2
, NULL
, NULL
);
624 lttv_option_add("test3", '3', "Test computing the state, writing out a few",
625 "", LTTV_OPT_NONE
, &a_test3
, NULL
, NULL
);
628 lttv_option_add("test4", '4', "Test computing the stats", "",
629 LTTV_OPT_NONE
, &a_test4
, NULL
, NULL
);
632 lttv_option_add("test5", '5', "Test computing the state and stats", "",
633 LTTV_OPT_NONE
, &a_test5
, NULL
, NULL
);
636 lttv_option_add("test6", '6', "Test computing and saving the state", "",
637 LTTV_OPT_NONE
, &a_test6
, NULL
, NULL
);
640 lttv_option_add("test7", '7', "Test seeking to positions written out in 3",
641 "", LTTV_OPT_NONE
, &a_test7
, NULL
, NULL
);
644 lttv_option_add("testall", 'a', "Run all tests ", "",
645 LTTV_OPT_NONE
, &a_test_all
, NULL
, NULL
);
647 traceset
= lttv_traceset_new();
649 before_traceset
= lttv_hooks_new();
650 after_traceset
= lttv_hooks_new();
651 before_trace
= lttv_hooks_new();
652 after_trace
= lttv_hooks_new();
653 before_tracefile
= lttv_hooks_new();
654 after_tracefile
= lttv_hooks_new();
655 //before_event = lttv_hooks_new();
656 //after_event = lttv_hooks_new();
657 event_hook
= lttv_hooks_new();
660 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/traceset/before",
661 LTTV_POINTER
, &value
));
662 *(value
.v_pointer
) = before_traceset
;
663 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/traceset/after",
664 LTTV_POINTER
, &value
));
665 *(value
.v_pointer
) = after_traceset
;
666 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/trace/before",
667 LTTV_POINTER
, &value
));
668 *(value
.v_pointer
) = before_trace
;
669 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/trace/after",
670 LTTV_POINTER
, &value
));
671 *(value
.v_pointer
) = after_trace
;
672 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/tracefile/before",
673 LTTV_POINTER
, &value
));
674 *(value
.v_pointer
) = before_tracefile
;
675 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/tracefile/after",
676 LTTV_POINTER
, &value
));
677 *(value
.v_pointer
) = after_tracefile
;
678 //g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/before",
679 // LTTV_POINTER, &value));
680 //*(value.v_pointer) = before_event;
681 //g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/after",
682 // LTTV_POINTER, &value));
683 //*(value.v_pointer) = after_event;
684 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/event",
685 LTTV_POINTER
, &value
));
686 *(value
.v_pointer
) = event_hook
;
687 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/main/before",
688 LTTV_POINTER
, &value
));
689 g_assert((main_hooks
= *(value
.v_pointer
)) != NULL
);
690 lttv_hooks_add(main_hooks
, process_traceset
, NULL
, LTTV_PRIO_DEFAULT
);
694 static void destroy()
700 g_info("Destroy batchAnalysis.c");
702 lttv_option_remove("trace");
703 lttv_option_remove("dump-tracefiles");
704 lttv_option_remove("save-sample");
705 lttv_option_remove("save-state-copy");
706 lttv_option_remove("sample-interval");
707 lttv_option_remove("sample-number");
708 lttv_option_remove("seek-number");
709 lttv_option_remove("save-interval");
710 lttv_option_remove("test1");
711 lttv_option_remove("test2");
712 lttv_option_remove("test3");
713 lttv_option_remove("test4");
714 lttv_option_remove("test5");
715 lttv_option_remove("test6");
716 lttv_option_remove("test7");
717 lttv_option_remove("testall");
719 lttv_hooks_destroy(before_traceset
);
720 lttv_hooks_destroy(after_traceset
);
721 lttv_hooks_destroy(before_trace
);
722 lttv_hooks_destroy(after_trace
);
723 lttv_hooks_destroy(before_tracefile
);
724 lttv_hooks_destroy(after_tracefile
);
725 //lttv_hooks_destroy(before_event);
726 //lttv_hooks_destroy(after_event);
727 lttv_hooks_destroy(event_hook
);
728 lttv_hooks_remove_data(main_hooks
, process_traceset
, NULL
);
730 nb
= lttv_traceset_number(traceset
);
731 for(i
= 0 ; i
< nb
; i
++) {
732 trace
= lttv_traceset_get(traceset
, i
);
733 lttv_traceset_remove(traceset
,i
);
734 ltt_trace_close(lttv_trace(trace
));
735 lttv_trace_destroy(trace
);
738 lttv_traceset_destroy(traceset
);
742 LTTV_MODULE("batchtest", "Batch processing of a trace for tests", \
743 "Run through a trace calling all the registered hooks for tests", \
744 init
, destroy
, "state", "stats", "option" )
This page took 0.044144 seconds and 4 git commands to generate.