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. */
28 #include <lttv/lttv.h>
29 #include <lttv/attribute.h>
30 #include <lttv/hook.h>
31 #include <lttv/option.h>
32 #include <lttv/module.h>
33 #include <lttv/tracecontext.h>
34 #include <lttv/state.h>
35 #include <lttv/stats.h>
36 #include <ltt/trace.h>
37 #include <ltt/event.h>
39 #include <ltt/facility.h>
41 #define __UNUSED__ __attribute__((__unused__))
43 static LttvTraceset
*traceset
;
59 static char *a_dump_tracefiles
;
61 static char *a_save_sample
;
81 LttEventPosition
*a_event_position
;
83 typedef struct _save_state
{
94 static void lttv_trace_option(void __UNUSED__
*hook_data
)
98 trace
= ltt_trace_open(a_trace
);
99 if(trace
== NULL
) g_critical("cannot open trace %s", a_trace
);
100 lttv_traceset_add(traceset
, lttv_trace_new(trace
));
103 static double get_time()
107 g_get_current_time(>
);
108 return gt
.tv_sec
+ (double)gt
.tv_usec
/ (double)1000000.0;
111 static double run_one_test(LttvTracesetState
*ts
, LttTime start
, LttTime end
)
117 //lttv_traceset_context_add_hooks(&ts->parent,
118 //before_traceset, after_traceset, NULL, before_trace, after_trace,
119 //NULL, before_tracefile, after_tracefile, NULL, before_event, after_event);
120 lttv_process_traceset_begin(&ts
->parent
,
127 for(i
= 0 ; i
< lttv_traceset_number(traceset
) ; i
++) {
128 ((LttvTraceState
*)(ts
->parent
.traces
[i
]))->save_interval
=a_save_interval
;
132 lttv_state_traceset_seek_time_closest(ts
, start
);
133 //lttv_process_traceset(&ts->parent, end, G_MAXULONG);
134 lttv_process_traceset_middle(&ts
->parent
,
140 //lttv_traceset_context_remove_hooks(&ts->parent,
141 //before_traceset, after_traceset, NULL, before_trace, after_trace,
142 //NULL, before_tracefile, after_tracefile, NULL, before_event, after_event);
143 lttv_process_traceset_end(&ts
->parent
,
154 gboolean
trace_event(void __UNUSED__
*hook_data
, void *call_data
)
156 LttvTracefileState
*tfs
= (LttvTracefileState
*)call_data
;
158 guint nb_block
, nb_event
;
162 ltt_event_position(tfs
->parent
.e
, a_event_position
);
163 ltt_event_position_get(a_event_position
, &nb_block
, &nb_event
, &tf
);
164 fprintf(stderr
,"Event %s %lu.%09lu [%u %u]\n",
165 ltt_eventtype_name(ltt_event_eventtype(tfs
->parent
.e
)),
166 tfs
->parent
.timestamp
.tv_sec
, tfs
->parent
.timestamp
.tv_nsec
,
172 gboolean
count_event(void *hook_data
, void __UNUSED__
*call_data
)
174 guint
*pcount
= (guint
*)hook_data
;
181 gboolean
save_state_copy_event(void *hook_data
, void *call_data
)
183 SaveState __UNUSED__
*save_state
= (SaveState
*)hook_data
;
185 LttvTracefileState
*tfs
= (LttvTracefileState
*)call_data
;
187 LttvTraceState
*ts
= (LttvTraceState
*)tfs
->parent
.t_context
;
193 if(ts
->nb_event
== 0 && strcmp(ltt_eventtype_name(
194 ltt_event_eventtype(tfs
->parent
.e
)), "block_start") == 0) {
195 if(a_save_sample
!= NULL
) {
196 filename
= g_string_new("");
197 g_string_printf(filename
, "%s.copy.%lu.%09lu.xml", a_save_sample
,
198 tfs
->parent
.timestamp
.tv_sec
, tfs
->parent
.timestamp
.tv_nsec
);
199 fp
= fopen(filename
->str
, "w");
200 if(fp
== NULL
) g_error("Cannot open %s", filename
->str
);
201 g_string_free(filename
, TRUE
);
202 lttv_state_write(ts
, tfs
->parent
.timestamp
, fp
);
204 } //else lttv_state_write(ts, tfs->parent.timestamp, save_state->fp);
210 gboolean
save_state_event(void *hook_data
, void *call_data
)
212 SaveState
*save_state
= (SaveState
*)hook_data
;
214 LttvTracefileState
*tfs
= (LttvTracefileState
*)call_data
;
216 LttvTraceState
*ts
= (LttvTraceState
*)tfs
->parent
.t_context
;
222 (save_state
->count
)++;
223 if(save_state
->count
% save_state
->interval
== 0 &&
224 save_state
->position
< save_state
->size
) {
225 if(a_save_sample
!= NULL
) {
226 filename
= g_string_new("");
227 g_string_printf(filename
, "%s.%u.xml.%u", a_save_sample
,
228 save_state
->position
, save_state
->version
);
229 fp
= fopen(filename
->str
, "w");
230 if(fp
== NULL
) g_error("Cannot open %s", filename
->str
);
231 g_string_free(filename
, TRUE
);
232 lttv_state_write(ts
, tfs
->parent
.timestamp
, fp
);
234 } //else lttv_state_write(ts, tfs->parent.timestamp, save_state->fp);
236 save_state
->write_time
[save_state
->position
] = tfs
->parent
.timestamp
;
237 save_state
->position
++;
243 static gboolean
process_traceset(void __UNUSED__
*hook_data
,
244 void __UNUSED__
*call_data
)
246 LttvTracesetStats
*tscs
;
248 LttvTracesetState
*ts
;
250 LttvTracesetContext
*tc
;
258 guint i
, j
, count
, nb_control
, nb_tracefile
, nb_block
, nb_event
, nb_equal
;
262 LttTracefile
*tracefile
, *tf
;
264 LttEvent
*event
= ltt_event_new();
266 LttFacility
*facility
;
268 LttEventType
*event_type
;
270 LttTime time
, previous_time
;
272 /* start_count is always initialized in this function _if_ there is always
273 * a block_start before a block_end.
275 long long unsigned cycle_count
, start_count
=0, delta_cycle
;
277 long long unsigned start_nsec
, end_nsec
, delta_nsec
, added_nsec
, added_nsec2
;
279 double cycle_per_nsec
, nsec_per_cycle
;
281 long long interpolated_nsec
, interpolated_nsec2
, end_nsec_sec
, end_nsec_nsec
;
285 LttTime zero_time
= ltt_time_zero
;
287 LttTime max_time
= { G_MAXULONG
, G_MAXULONG
};
289 a_event_position
= ltt_event_position_new();
291 if(a_dump_tracefiles
!= NULL
) {
292 for(i
= 0 ; i
< lttv_traceset_number(traceset
) ; i
++) {
293 trace
= lttv_trace(lttv_traceset_get(traceset
, i
));
294 nb_control
= ltt_trace_control_tracefile_number(trace
);
295 nb_tracefile
= nb_control
+ ltt_trace_per_cpu_tracefile_number(trace
);
296 for(j
= 0 ; j
< nb_tracefile
; j
++) {
298 tracefile
= ltt_trace_control_tracefile_get(trace
,j
);
301 tracefile
= ltt_trace_per_cpu_tracefile_get(trace
,j
- nb_control
);
304 filename
= g_string_new("");
305 g_string_printf(filename
, "%s.%u.%u.trace", a_dump_tracefiles
, i
, j
);
306 fp
= fopen(filename
->str
, "w");
307 if(fp
== NULL
) g_error("Cannot open %s", filename
->str
);
308 g_string_free(filename
, TRUE
);
309 ltt_tracefile_seek_time(tracefile
, zero_time
);
310 previous_time
= zero_time
;
312 while((ltt_tracefile_read(tracefile
, event
)) != NULL
) {
313 facility
= ltt_event_facility(event
);
314 event_type
= ltt_event_eventtype(event
);
315 time
= ltt_event_time(event
);
316 cycle_count
= ltt_event_cycle_count(event
);
317 ltt_event_position(event
, a_event_position
);
318 ltt_event_position_get(a_event_position
, &nb_block
, &nb_event
, &tf
);
319 fprintf(fp
,"%s.%s: %llu %lu.%09lu position %u/%u\n",
320 ltt_facility_name(facility
), ltt_eventtype_name(event_type
),
321 cycle_count
, (unsigned long)time
.tv_sec
,
322 (unsigned long)time
.tv_nsec
,
325 if(ltt_time_compare(time
, previous_time
) < 0) {
326 g_warning("Time decreasing trace %d tracefile %d position %u/%u",
327 i
, j
, nb_block
, nb_event
);
330 if(strcmp(ltt_eventtype_name(event_type
),"block_start") == 0) {
331 start_count
= cycle_count
;
334 else if(strcmp(ltt_eventtype_name(event_type
),"block_end") == 0) {
335 delta_cycle
= cycle_count
- start_count
;
336 end_nsec_sec
= (long long unsigned)time
.tv_sec
* (long long unsigned)1000000000;
337 end_nsec_nsec
= time
.tv_nsec
;
338 end_nsec
= end_nsec_sec
+ end_nsec_nsec
;
339 start_nsec
= (long long unsigned)start_time
.tv_sec
* (long long unsigned)1000000000 + (long long unsigned)start_time
.tv_nsec
;
340 delta_nsec
= end_nsec
- start_nsec
;
341 cycle_per_nsec
= (double)delta_cycle
/ (double)delta_nsec
;
342 nsec_per_cycle
= (double)delta_nsec
/ (double)delta_cycle
;
343 added_nsec
= (double)delta_cycle
* nsec_per_cycle
;
344 interpolated_nsec
= start_nsec
+ added_nsec
;
345 added_nsec2
= (double)delta_cycle
/ cycle_per_nsec
;
346 interpolated_nsec2
= start_nsec
+ added_nsec2
;
348 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
);
351 if(ltt_time_compare(time
, previous_time
) == 0) nb_equal
++;
352 else if(nb_equal
> 0) {
353 g_warning("Consecutive %d events with time %lu.%09lu",
354 nb_equal
+ 1, previous_time
.tv_sec
, previous_time
.tv_nsec
);
357 previous_time
= time
;
365 tscs
= g_object_new(LTTV_TRACESET_STATS_TYPE
, NULL
);
367 tc
= &tscs
->parent
.parent
;
369 lttv_context_init(tc
, traceset
);
371 /* For each case compute and print the elapsed time.
372 The first case is simply to run through all events with a
375 if(a_test1
|| a_test_all
) {
377 lttv_hooks_add(event_hook
, count_event
, &count
, LTTV_PRIO_DEFAULT
);
378 t
= run_one_test(ts
, zero_time
, max_time
);
379 lttv_hooks_remove_data(event_hook
, count_event
, &count
);
381 "Processing trace while counting events (%u events in %g seconds)",
385 /* Run through all events computing the state. */
387 if(a_test2
|| a_test_all
) {
388 lttv_state_add_event_hooks(ts
);
389 t
= run_one_test(ts
, zero_time
, max_time
);
390 lttv_state_remove_event_hooks(ts
);
391 g_warning("Processing trace while updating state (%g seconds)", t
);
394 /* Run through all events computing the state and writing it out
397 SaveState save_state
;
399 save_state
.interval
= a_sample_interval
;
400 save_state
.size
= a_sample_number
;
401 save_state
.fp
= stderr
;
402 save_state
.write_time
= g_new(LttTime
, a_sample_number
);
405 if(a_test3
|| a_test_all
) {
406 for(i
= 0 ; i
< 2 ; i
++) {
407 save_state
.count
= 0;
408 save_state
.position
= 0;
409 save_state
.version
= i
;
410 lttv_state_add_event_hooks(ts
);
411 lttv_hooks_add(event_hook
, save_state_event
, &save_state
,
413 t
= run_one_test(ts
, zero_time
, max_time
);
414 lttv_state_remove_event_hooks(ts
);
415 lttv_hooks_remove_data(event_hook
, save_state_event
, &save_state
);
416 g_warning("Processing while updating/writing state (%g seconds)", t
);
420 /* Run through all events computing the stats. */
422 if(a_test4
|| a_test_all
) {
423 if(lttv_profile_memory
) {
424 g_message("Memory summary before computing stats");
428 lttv_stats_add_event_hooks(tscs
);
429 t
= run_one_test(ts
, zero_time
, max_time
);
430 lttv_stats_remove_event_hooks(tscs
);
431 g_warning("Processing trace while counting stats (%g seconds)", t
);
433 if(lttv_profile_memory
) {
434 g_message("Memory summary after computing stats");
438 lttv_stats_sum_traceset(tscs
);
440 if(lttv_profile_memory
) {
441 g_message("Memory summary after summing stats");
445 lttv_context_fini(tc
);
446 lttv_context_init(tc
, traceset
);
448 if(lttv_profile_memory
) {
449 g_message("Memory summary after cleaning up the stats");
454 /* Run through all events computing the state and stats. */
456 if(a_test5
|| a_test_all
) {
457 if(lttv_profile_memory
) {
458 g_message("Memory summary before computing state and stats");
462 lttv_state_add_event_hooks(ts
);
463 lttv_stats_add_event_hooks(tscs
);
464 t
= run_one_test(ts
, zero_time
, max_time
);
465 lttv_state_remove_event_hooks(ts
);
466 lttv_stats_remove_event_hooks(tscs
);
468 "Processing trace while counting state and stats (%g seconds)", t
);
470 if(lttv_profile_memory
) {
471 g_message("Memory summary after computing and state and stats");
475 lttv_context_fini(tc
);
476 lttv_context_init(tc
, traceset
);
478 if(lttv_profile_memory
) {
479 g_message("Memory summary after cleaning up the stats");
484 /* Run through all events computing and saving the state. */
486 if(a_trace_event
) lttv_hooks_add(event_hook
, trace_event
, NULL
,
489 if(a_test6
|| a_test_all
) {
490 if(lttv_profile_memory
) {
491 g_message("Memory summary before computing and saving state");
495 lttv_state_add_event_hooks(ts
);
496 lttv_state_save_add_event_hooks(ts
);
497 if(a_save_state_copy
)
498 lttv_hooks_add(event_hook
, save_state_copy_event
, &save_state
,
500 t
= run_one_test(ts
, zero_time
, max_time
);
501 lttv_state_remove_event_hooks(ts
);
502 lttv_state_save_remove_event_hooks(ts
);
503 if(a_save_state_copy
)
504 lttv_hooks_remove_data(event_hook
,save_state_copy_event
, &save_state
);
506 g_warning("Processing trace while updating/saving state (%g seconds)", t
);
508 if(lttv_profile_memory
) {
509 g_message("Memory summary after computing/saving state");
514 /* Seek a few times to each saved position */
516 if((a_test7
&& a_test3
) || a_test_all
) {
517 g_assert(a_seek_number
>= 0);
518 for(i
= 0 ; i
< (guint
)a_seek_number
; i
++) {
519 gint reverse_j
; /* just to make sure j is unsigned */
520 for(reverse_j
= save_state
.position
- 1 ; reverse_j
>= 0 ; reverse_j
--) {
521 j
= (guint
)reverse_j
;
522 lttv_state_add_event_hooks(ts
);
523 t
= run_one_test(ts
, save_state
.write_time
[j
],
524 save_state
.write_time
[j
]);
525 lttv_state_remove_event_hooks(ts
);
526 g_warning("Seeking to %lu.%lu (%g seconds)",
527 save_state
.write_time
[j
].tv_sec
, save_state
.write_time
[j
].tv_nsec
,
530 if(a_save_sample
!= NULL
) {
531 filename
= g_string_new("");
532 g_string_printf(filename
, "%s.%d.xml.bak%d", a_save_sample
, j
, i
);
533 fp
= fopen(filename
->str
, "w");
534 if(fp
== NULL
) g_error("Cannot open %s", filename
->str
);
535 g_string_free(filename
, TRUE
);
536 lttv_state_write((LttvTraceState
*)tc
->traces
[0],
537 save_state
.write_time
[j
], fp
);
540 //else lttv_state_write((LttvTraceState *)tc->traces[0],
541 // save_state.write_time[j], save_state.fp);
546 if(a_trace_event
) lttv_hooks_remove_data(event_hook
, trace_event
, NULL
);
548 g_free(save_state
.write_time
);
549 g_free(a_event_position
);
550 lttv_context_fini(tc
);
551 g_object_unref(tscs
);
552 ltt_event_destroy(event
);
554 if(lttv_profile_memory
) {
555 g_message("Memory summary at the end of batchtest");
559 g_info("BatchTest end process traceset");
566 LttvAttributeValue value
;
568 LttvIAttribute
*attributes
= LTTV_IATTRIBUTE(lttv_global_attributes());
570 g_info("Init batchtest.c");
572 lttv_option_add("trace", 't',
573 "add a trace to the trace set to analyse",
574 "pathname of the directory containing the trace",
575 LTTV_OPT_STRING
, &a_trace
, lttv_trace_option
, NULL
);
577 a_trace_event
= FALSE
;
579 a_dump_tracefiles
= NULL
;
580 lttv_option_add("dump-tracefiles", 'D',
581 "Write event by event the content of tracefiles",
582 "basename for the files where to dump events",
583 LTTV_OPT_STRING
, &a_dump_tracefiles
, NULL
, NULL
);
585 a_save_sample
= NULL
;
586 lttv_option_add("save-sample", 's',
587 "Save state samples to multiple files",
588 "basename for the files containing the state samples",
589 LTTV_OPT_STRING
, &a_save_sample
, NULL
, NULL
);
591 a_save_state_copy
= FALSE
;
592 lttv_option_add("save-state-copy", 'S', "Write the state saved for seeking",
593 "", LTTV_OPT_NONE
, &a_save_state_copy
, NULL
, NULL
);
595 a_save_interval
= 100000;
596 lttv_option_add("save-interval", 'i',
597 "Interval between saving state",
598 "number of events before a block start triggers saving state",
599 LTTV_OPT_INT
, &a_save_interval
, NULL
, NULL
);
601 a_sample_interval
= 100000;
602 lttv_option_add("sample-interval", 'S',
603 "Interval between sampling state",
604 "number of events before sampling and writing state",
605 LTTV_OPT_INT
, &a_sample_interval
, NULL
, NULL
);
607 a_sample_number
= 20;
608 lttv_option_add("sample-number", 'N',
609 "Number of state samples",
611 LTTV_OPT_INT
, &a_sample_number
, NULL
, NULL
);
614 lttv_option_add("seek-number", 'K',
617 LTTV_OPT_INT
, &a_seek_number
, NULL
, NULL
);
620 lttv_option_add("test1", '1', "Test just counting events", "",
621 LTTV_OPT_NONE
, &a_test1
, NULL
, NULL
);
624 lttv_option_add("test2", '2', "Test computing the state", "",
625 LTTV_OPT_NONE
, &a_test2
, NULL
, NULL
);
628 lttv_option_add("test3", '3', "Test computing the state, writing out a few",
629 "", LTTV_OPT_NONE
, &a_test3
, NULL
, NULL
);
632 lttv_option_add("test4", '4', "Test computing the stats", "",
633 LTTV_OPT_NONE
, &a_test4
, NULL
, NULL
);
636 lttv_option_add("test5", '5', "Test computing the state and stats", "",
637 LTTV_OPT_NONE
, &a_test5
, NULL
, NULL
);
640 lttv_option_add("test6", '6', "Test computing and saving the state", "",
641 LTTV_OPT_NONE
, &a_test6
, NULL
, NULL
);
644 lttv_option_add("test7", '7', "Test seeking to positions written out in 3",
645 "", LTTV_OPT_NONE
, &a_test7
, NULL
, NULL
);
648 lttv_option_add("testall", 'a', "Run all tests ", "",
649 LTTV_OPT_NONE
, &a_test_all
, NULL
, NULL
);
651 traceset
= lttv_traceset_new();
653 before_traceset
= lttv_hooks_new();
654 after_traceset
= lttv_hooks_new();
655 before_trace
= lttv_hooks_new();
656 after_trace
= lttv_hooks_new();
657 before_tracefile
= lttv_hooks_new();
658 after_tracefile
= lttv_hooks_new();
659 //before_event = lttv_hooks_new();
660 //after_event = lttv_hooks_new();
661 event_hook
= lttv_hooks_new();
664 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/traceset/before",
665 LTTV_POINTER
, &value
));
666 *(value
.v_pointer
) = before_traceset
;
667 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/traceset/after",
668 LTTV_POINTER
, &value
));
669 *(value
.v_pointer
) = after_traceset
;
670 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/trace/before",
671 LTTV_POINTER
, &value
));
672 *(value
.v_pointer
) = before_trace
;
673 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/trace/after",
674 LTTV_POINTER
, &value
));
675 *(value
.v_pointer
) = after_trace
;
676 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/tracefile/before",
677 LTTV_POINTER
, &value
));
678 *(value
.v_pointer
) = before_tracefile
;
679 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/tracefile/after",
680 LTTV_POINTER
, &value
));
681 *(value
.v_pointer
) = after_tracefile
;
682 //g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/before",
683 // LTTV_POINTER, &value));
684 //*(value.v_pointer) = before_event;
685 //g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/after",
686 // LTTV_POINTER, &value));
687 //*(value.v_pointer) = after_event;
688 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/event",
689 LTTV_POINTER
, &value
));
690 *(value
.v_pointer
) = event_hook
;
691 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/main/before",
692 LTTV_POINTER
, &value
));
693 g_assert((main_hooks
= *(value
.v_pointer
)) != NULL
);
694 lttv_hooks_add(main_hooks
, process_traceset
, NULL
, LTTV_PRIO_DEFAULT
);
698 static void destroy()
704 g_info("Destroy batchAnalysis.c");
706 lttv_option_remove("trace");
707 lttv_option_remove("dump-tracefiles");
708 lttv_option_remove("save-sample");
709 lttv_option_remove("save-state-copy");
710 lttv_option_remove("sample-interval");
711 lttv_option_remove("sample-number");
712 lttv_option_remove("seek-number");
713 lttv_option_remove("save-interval");
714 lttv_option_remove("test1");
715 lttv_option_remove("test2");
716 lttv_option_remove("test3");
717 lttv_option_remove("test4");
718 lttv_option_remove("test5");
719 lttv_option_remove("test6");
720 lttv_option_remove("test7");
721 lttv_option_remove("testall");
723 lttv_hooks_destroy(before_traceset
);
724 lttv_hooks_destroy(after_traceset
);
725 lttv_hooks_destroy(before_trace
);
726 lttv_hooks_destroy(after_trace
);
727 lttv_hooks_destroy(before_tracefile
);
728 lttv_hooks_destroy(after_tracefile
);
729 //lttv_hooks_destroy(before_event);
730 //lttv_hooks_destroy(after_event);
731 lttv_hooks_destroy(event_hook
);
732 lttv_hooks_remove_data(main_hooks
, process_traceset
, NULL
);
734 nb
= lttv_traceset_number(traceset
);
735 for(i
= 0 ; i
< nb
; i
++) {
736 trace
= lttv_traceset_get(traceset
, i
);
737 lttv_traceset_remove(traceset
,i
);
738 ltt_trace_close(lttv_trace(trace
));
739 lttv_trace_destroy(trace
);
742 lttv_traceset_destroy(traceset
);
746 LTTV_MODULE("batchtest", "Batch processing of a trace for tests", \
747 "Run through a trace calling all the registered hooks for tests", \
748 init
, destroy
, "state", "stats", "option" )
This page took 0.047655 seconds and 4 git commands to generate.