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 static GQuark QUARK_BLOCK_START
,
84 LttEventPosition
*a_event_position
;
86 typedef struct _save_state
{
97 static void lttv_trace_option(void __UNUSED__
*hook_data
)
101 trace
= ltt_trace_open(a_trace
);
102 if(trace
== NULL
) g_critical("cannot open trace %s", a_trace
);
103 lttv_traceset_add(traceset
, lttv_trace_new(trace
));
106 static double get_time()
110 g_get_current_time(>
);
111 return gt
.tv_sec
+ (double)gt
.tv_usec
/ (double)1000000.0;
114 static double run_one_test(LttvTracesetState
*ts
, LttTime start
, LttTime end
)
120 //lttv_traceset_context_add_hooks(&ts->parent,
121 //before_traceset, after_traceset, NULL, before_trace, after_trace,
122 //NULL, before_tracefile, after_tracefile, NULL, before_event, after_event);
123 lttv_process_traceset_begin(&ts
->parent
,
130 for(i
= 0 ; i
< lttv_traceset_number(traceset
) ; i
++) {
131 ((LttvTraceState
*)(ts
->parent
.traces
[i
]))->save_interval
=a_save_interval
;
135 lttv_state_traceset_seek_time_closest(ts
, start
);
136 //lttv_process_traceset(&ts->parent, end, G_MAXULONG);
137 lttv_process_traceset_middle(&ts
->parent
,
143 //lttv_traceset_context_remove_hooks(&ts->parent,
144 //before_traceset, after_traceset, NULL, before_trace, after_trace,
145 //NULL, before_tracefile, after_tracefile, NULL, before_event, after_event);
146 lttv_process_traceset_end(&ts
->parent
,
157 gboolean
trace_event(void __UNUSED__
*hook_data
, void *call_data
)
159 LttvTracefileState
*tfs
= (LttvTracefileState
*)call_data
;
161 guint nb_block
, offset
;
166 LttEvent
*e
= ltt_tracefile_get_event(tfs
->parent
.tf
);
167 ltt_event_position(e
, a_event_position
);
168 ltt_event_position_get(a_event_position
, &tf
, &nb_block
, &offset
, &tsc
);
169 fprintf(stderr
,"Event %s %lu.%09lu [%u %u tsc %llu]\n",
170 g_quark_to_string(ltt_eventtype_name(ltt_event_eventtype(e
))),
171 tfs
->parent
.timestamp
.tv_sec
, tfs
->parent
.timestamp
.tv_nsec
,
172 nb_block
, offset
, tsc
);
177 gboolean
count_event(void *hook_data
, void __UNUSED__
*call_data
)
179 guint
*pcount
= (guint
*)hook_data
;
186 gboolean
save_state_copy_event(void *hook_data
, void *call_data
)
188 SaveState __UNUSED__
*save_state
= (SaveState
*)hook_data
;
190 LttvTracefileState
*tfs
= (LttvTracefileState
*)call_data
;
192 LttvTraceState
*ts
= (LttvTraceState
*)tfs
->parent
.t_context
;
194 LttEvent
*e
= ltt_tracefile_get_event(tfs
->parent
.tf
);
200 if(ts
->nb_event
== 0 &&
201 ltt_eventtype_name(ltt_event_eventtype(e
))
202 == QUARK_BLOCK_START
) {
203 if(a_save_sample
!= NULL
) {
204 filename
= g_string_new("");
205 g_string_printf(filename
, "%s.copy.%lu.%09lu.xml", a_save_sample
,
206 tfs
->parent
.timestamp
.tv_sec
, tfs
->parent
.timestamp
.tv_nsec
);
207 fp
= fopen(filename
->str
, "w");
208 if(fp
== NULL
) g_error("Cannot open %s", filename
->str
);
209 g_string_free(filename
, TRUE
);
210 lttv_state_write(ts
, tfs
->parent
.timestamp
, fp
);
212 } //else lttv_state_write(ts, tfs->parent.timestamp, save_state->fp);
218 gboolean
save_state_event(void *hook_data
, void *call_data
)
220 SaveState
*save_state
= (SaveState
*)hook_data
;
222 LttvTracefileState
*tfs
= (LttvTracefileState
*)call_data
;
224 LttvTraceState
*ts
= (LttvTraceState
*)tfs
->parent
.t_context
;
230 (save_state
->count
)++;
231 if(save_state
->count
% save_state
->interval
== 0 &&
232 save_state
->position
< save_state
->size
) {
233 if(a_save_sample
!= NULL
) {
234 filename
= g_string_new("");
235 g_string_printf(filename
, "%s.%u.xml.%u", a_save_sample
,
236 save_state
->position
, save_state
->version
);
237 fp
= fopen(filename
->str
, "w");
238 if(fp
== NULL
) g_error("Cannot open %s", filename
->str
);
239 g_string_free(filename
, TRUE
);
240 lttv_state_write(ts
, tfs
->parent
.timestamp
, fp
);
242 } //else lttv_state_write(ts, tfs->parent.timestamp, save_state->fp);
244 save_state
->write_time
[save_state
->position
] = tfs
->parent
.timestamp
;
245 save_state
->position
++;
252 static void compute_tracefile(LttTracefile
*tracefile
)
255 guint i
, j
, nb_equal
, nb_block
, offset
;
258 LttTime time
, previous_time
;
259 LttEvent
*event
= ltt_event_new();
260 LttFacility
*facility
;
261 LttEventType
*event_type
;
264 /* start_count is always initialized in this function _if_ there is always
265 * a block_start before a block_end.
267 long long unsigned cycle_count
, start_count
=0, delta_cycle
;
270 filename
= g_string_new("");
271 g_string_printf(filename
, "%s.%u.%u.trace", a_dump_tracefiles
, i
, j
);
272 fp
= fopen(filename
->str
, "w");
273 if(fp
== NULL
) g_error("Cannot open %s", filename
->str
);
274 g_string_free(filename
, TRUE
);
275 err
= ltt_tracefile_seek_time(tracefile
, ltt_time_zero
);
278 previous_time
= ltt_time_zero
;
282 LttTracefile
*tf_pos
;
283 facility
= ltt_event_facility(event
);
284 event_type
= ltt_event_eventtype(event
);
285 time
= ltt_event_time(event
);
286 ltt_event_position(event
, a_event_position
);
287 ltt_event_position_get(a_event_position
, &tf_pos
, &nb_block
, &offset
, &tsc
);
288 fprintf(fp
,"%s.%s: %llu %lu.%09lu position %u/%u\n",
289 ltt_facility_name(facility
), ltt_eventtype_name(event_type
),
290 tsc
, (unsigned long)time
.tv_sec
,
291 (unsigned long)time
.tv_nsec
,
294 if(ltt_time_compare(time
, previous_time
) < 0) {
295 g_warning("Time decreasing trace %d tracefile %d position %u/%u",
296 i
, j
, nb_block
, offset
);
300 if(ltt_eventtype_name(event_type
) == QUARK_BLOCK_START
) {
301 start_count
= cycle_count
;
304 else if(ltt_eventtype_name(event_type
) == QUARK_BLOCK_END
) {
305 delta_cycle
= cycle_count
- start_count
;
306 end_nsec_sec
= (long long unsigned)time
.tv_sec
* (long long unsigned)1000000000;
307 end_nsec_nsec
= time
.tv_nsec
;
308 end_nsec
= end_nsec_sec
+ end_nsec_nsec
;
309 start_nsec
= (long long unsigned)start_time
.tv_sec
* (long long unsigned)1000000000 + (long long unsigned)start_time
.tv_nsec
;
310 delta_nsec
= end_nsec
- start_nsec
;
311 cycle_per_nsec
= (double)delta_cycle
/ (double)delta_nsec
;
312 nsec_per_cycle
= (double)delta_nsec
/ (double)delta_cycle
;
313 added_nsec
= (double)delta_cycle
* nsec_per_cycle
;
314 interpolated_nsec
= start_nsec
+ added_nsec
;
315 added_nsec2
= (double)delta_cycle
/ cycle_per_nsec
;
316 interpolated_nsec2
= start_nsec
+ added_nsec2
;
318 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
);
322 if(ltt_time_compare(time
, previous_time
) == 0) nb_equal
++;
323 else if(nb_equal
> 0) {
324 g_warning("Consecutive %d events with time %lu.%09lu",
325 nb_equal
+ 1, previous_time
.tv_sec
, previous_time
.tv_nsec
);
328 previous_time
= time
;
330 } while((!ltt_tracefile_read(tracefile
)));
334 ltt_event_destroy(event
);
337 static gboolean
process_traceset(void __UNUSED__
*hook_data
,
338 void __UNUSED__
*call_data
)
341 LttvTracesetStats
*tscs
;
343 LttvTracesetState
*ts
;
345 LttvTracesetContext
*tc
;
351 //guint count, nb_control, nb_tracefile, nb_block, nb_event;
352 //guint i, j, count, nb_control, nb_tracefile, nb_block, nb_event, nb_equal;
357 long long unsigned start_nsec
, end_nsec
, delta_nsec
, added_nsec
, added_nsec2
;
359 double cycle_per_nsec
, nsec_per_cycle
;
361 long long interpolated_nsec
, interpolated_nsec2
, end_nsec_sec
, end_nsec_nsec
;
365 LttTime max_time
= { G_MAXULONG
, G_MAXULONG
};
367 a_event_position
= ltt_event_position_new();
369 GData
*tracefiles_groups
;
371 if(a_dump_tracefiles
!= NULL
) {
372 for(i
= 0 ; i
< lttv_traceset_number(traceset
) ; i
++) {
373 trace
= lttv_trace(lttv_traceset_get(traceset
, i
));
374 tracefiles_groups
= ltt_trace_get_tracefiles_groups(trace
);
376 g_datalist_foreach(&tracefiles_groups
,
377 (GDataForeachFunc
)compute_tracefile_group
,
383 tscs
= g_object_new(LTTV_TRACESET_STATS_TYPE
, NULL
);
385 tc
= &tscs
->parent
.parent
;
387 lttv_context_init(tc
, traceset
);
389 /* For each case compute and print the elapsed time.
390 The first case is simply to run through all events with a
393 if(a_test1
|| a_test_all
) {
395 lttv_hooks_add(event_hook
, count_event
, &count
, LTTV_PRIO_DEFAULT
);
396 t
= run_one_test(ts
, ltt_time_zero
, max_time
);
397 lttv_hooks_remove_data(event_hook
, count_event
, &count
);
399 "Processing trace while counting events (%u events in %g seconds)",
403 /* Run through all events computing the state. */
405 if(a_test2
|| a_test_all
) {
406 lttv_state_add_event_hooks(ts
);
407 t
= run_one_test(ts
, ltt_time_zero
, max_time
);
408 lttv_state_remove_event_hooks(ts
);
409 g_warning("Processing trace while updating state (%g seconds)", t
);
412 /* Run through all events computing the state and writing it out
415 SaveState save_state
;
417 save_state
.interval
= a_sample_interval
;
418 save_state
.size
= a_sample_number
;
419 save_state
.fp
= stderr
;
420 save_state
.write_time
= g_new(LttTime
, a_sample_number
);
423 if(a_test3
|| a_test_all
) {
424 for(i
= 0 ; i
< 2 ; i
++) {
425 save_state
.count
= 0;
426 save_state
.position
= 0;
427 save_state
.version
= i
;
428 lttv_state_add_event_hooks(ts
);
429 lttv_hooks_add(event_hook
, save_state_event
, &save_state
,
431 t
= run_one_test(ts
, ltt_time_zero
, max_time
);
432 lttv_state_remove_event_hooks(ts
);
433 lttv_hooks_remove_data(event_hook
, save_state_event
, &save_state
);
434 g_warning("Processing while updating/writing state (%g seconds)", t
);
438 /* Run through all events computing the stats. */
440 if(a_test4
|| a_test_all
) {
441 if(lttv_profile_memory
) {
442 g_message("Memory summary before computing stats");
446 lttv_stats_add_event_hooks(tscs
);
447 t
= run_one_test(ts
, ltt_time_zero
, max_time
);
448 lttv_stats_remove_event_hooks(tscs
);
449 g_warning("Processing trace while counting stats (%g seconds)", t
);
451 if(lttv_profile_memory
) {
452 g_message("Memory summary after computing stats");
456 lttv_stats_sum_traceset(tscs
);
458 if(lttv_profile_memory
) {
459 g_message("Memory summary after summing stats");
463 lttv_context_fini(tc
);
464 lttv_context_init(tc
, traceset
);
466 if(lttv_profile_memory
) {
467 g_message("Memory summary after cleaning up the stats");
472 /* Run through all events computing the state and stats. */
474 if(a_test5
|| a_test_all
) {
475 if(lttv_profile_memory
) {
476 g_message("Memory summary before computing state and stats");
480 lttv_state_add_event_hooks(ts
);
481 lttv_stats_add_event_hooks(tscs
);
482 t
= run_one_test(ts
, ltt_time_zero
, max_time
);
483 lttv_state_remove_event_hooks(ts
);
484 lttv_stats_remove_event_hooks(tscs
);
486 "Processing trace while counting state and stats (%g seconds)", t
);
488 if(lttv_profile_memory
) {
489 g_message("Memory summary after computing and state and stats");
493 lttv_context_fini(tc
);
494 lttv_context_init(tc
, traceset
);
496 if(lttv_profile_memory
) {
497 g_message("Memory summary after cleaning up the stats");
502 /* Run through all events computing and saving the state. */
504 if(a_trace_event
) lttv_hooks_add(event_hook
, trace_event
, NULL
,
507 if(a_test6
|| a_test_all
) {
508 if(lttv_profile_memory
) {
509 g_message("Memory summary before computing and saving state");
513 lttv_state_add_event_hooks(ts
);
514 lttv_state_save_add_event_hooks(ts
);
515 if(a_save_state_copy
)
516 lttv_hooks_add(event_hook
, save_state_copy_event
, &save_state
,
518 t
= run_one_test(ts
, ltt_time_zero
, max_time
);
519 lttv_state_remove_event_hooks(ts
);
520 lttv_state_save_remove_event_hooks(ts
);
521 if(a_save_state_copy
)
522 lttv_hooks_remove_data(event_hook
,save_state_copy_event
, &save_state
);
524 g_warning("Processing trace while updating/saving state (%g seconds)", t
);
526 if(lttv_profile_memory
) {
527 g_message("Memory summary after computing/saving state");
532 /* Seek a few times to each saved position */
534 if((a_test7
&& a_test3
) || a_test_all
) {
535 g_assert(a_seek_number
>= 0);
536 for(i
= 0 ; i
< (guint
)a_seek_number
; i
++) {
537 gint reverse_j
; /* just to make sure j is unsigned */
538 for(reverse_j
= save_state
.position
- 1 ; reverse_j
>= 0 ; reverse_j
--) {
539 j
= (guint
)reverse_j
;
540 lttv_state_add_event_hooks(ts
);
541 t
= run_one_test(ts
, save_state
.write_time
[j
],
542 save_state
.write_time
[j
]);
543 lttv_state_remove_event_hooks(ts
);
544 g_warning("Seeking to %lu.%lu (%g seconds)",
545 save_state
.write_time
[j
].tv_sec
, save_state
.write_time
[j
].tv_nsec
,
548 if(a_save_sample
!= NULL
) {
549 filename
= g_string_new("");
550 g_string_printf(filename
, "%s.%d.xml.bak%d", a_save_sample
, j
, i
);
551 fp
= fopen(filename
->str
, "w");
552 if(fp
== NULL
) g_error("Cannot open %s", filename
->str
);
553 g_string_free(filename
, TRUE
);
554 lttv_state_write((LttvTraceState
*)tc
->traces
[0],
555 save_state
.write_time
[j
], fp
);
558 //else lttv_state_write((LttvTraceState *)tc->traces[0],
559 // save_state.write_time[j], save_state.fp);
564 if(a_trace_event
) lttv_hooks_remove_data(event_hook
, trace_event
, NULL
);
566 g_free(save_state
.write_time
);
567 g_free(a_event_position
);
568 lttv_context_fini(tc
);
569 g_object_unref(tscs
);
571 if(lttv_profile_memory
) {
572 g_message("Memory summary at the end of batchtest");
576 g_info("BatchTest end process traceset");
583 LttvAttributeValue value
;
585 LttvIAttribute
*attributes
= LTTV_IATTRIBUTE(lttv_global_attributes());
587 g_info("Init batchtest.c");
590 QUARK_BLOCK_START
= g_quark_from_string("block_start");
591 QUARK_BLOCK_END
= g_quark_from_string("block_end");
594 lttv_option_add("trace", 't',
595 "add a trace to the trace set to analyse",
596 "pathname of the directory containing the trace",
597 LTTV_OPT_STRING
, &a_trace
, lttv_trace_option
, NULL
);
599 a_trace_event
= FALSE
;
601 a_dump_tracefiles
= NULL
;
602 lttv_option_add("dump-tracefiles", 'D',
603 "Write event by event the content of tracefiles",
604 "basename for the files where to dump events",
605 LTTV_OPT_STRING
, &a_dump_tracefiles
, NULL
, NULL
);
607 a_save_sample
= NULL
;
608 lttv_option_add("save-sample", 's',
609 "Save state samples to multiple files",
610 "basename for the files containing the state samples",
611 LTTV_OPT_STRING
, &a_save_sample
, NULL
, NULL
);
613 a_save_state_copy
= FALSE
;
614 lttv_option_add("save-state-copy", 'S', "Write the state saved for seeking",
615 "", LTTV_OPT_NONE
, &a_save_state_copy
, NULL
, NULL
);
617 a_save_interval
= 100000;
618 lttv_option_add("save-interval", 'i',
619 "Interval between saving state",
620 "number of events before a block start triggers saving state",
621 LTTV_OPT_INT
, &a_save_interval
, NULL
, NULL
);
623 a_sample_interval
= 100000;
624 lttv_option_add("sample-interval", 'S',
625 "Interval between sampling state",
626 "number of events before sampling and writing state",
627 LTTV_OPT_INT
, &a_sample_interval
, NULL
, NULL
);
629 a_sample_number
= 20;
630 lttv_option_add("sample-number", 'N',
631 "Number of state samples",
633 LTTV_OPT_INT
, &a_sample_number
, NULL
, NULL
);
636 lttv_option_add("seek-number", 'K',
639 LTTV_OPT_INT
, &a_seek_number
, NULL
, NULL
);
642 lttv_option_add("test1", '1', "Test just counting events", "",
643 LTTV_OPT_NONE
, &a_test1
, NULL
, NULL
);
646 lttv_option_add("test2", '2', "Test computing the state", "",
647 LTTV_OPT_NONE
, &a_test2
, NULL
, NULL
);
650 lttv_option_add("test3", '3', "Test computing the state, writing out a few",
651 "", LTTV_OPT_NONE
, &a_test3
, NULL
, NULL
);
654 lttv_option_add("test4", '4', "Test computing the stats", "",
655 LTTV_OPT_NONE
, &a_test4
, NULL
, NULL
);
658 lttv_option_add("test5", '5', "Test computing the state and stats", "",
659 LTTV_OPT_NONE
, &a_test5
, NULL
, NULL
);
662 lttv_option_add("test6", '6', "Test computing and saving the state", "",
663 LTTV_OPT_NONE
, &a_test6
, NULL
, NULL
);
666 lttv_option_add("test7", '7', "Test seeking to positions written out in 3",
667 "", LTTV_OPT_NONE
, &a_test7
, NULL
, NULL
);
670 lttv_option_add("testall", 'a', "Run all tests ", "",
671 LTTV_OPT_NONE
, &a_test_all
, NULL
, NULL
);
673 traceset
= lttv_traceset_new();
675 before_traceset
= lttv_hooks_new();
676 after_traceset
= lttv_hooks_new();
677 before_trace
= lttv_hooks_new();
678 after_trace
= lttv_hooks_new();
679 before_tracefile
= lttv_hooks_new();
680 after_tracefile
= lttv_hooks_new();
681 //before_event = lttv_hooks_new();
682 //after_event = lttv_hooks_new();
683 event_hook
= lttv_hooks_new();
686 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/traceset/before",
687 LTTV_POINTER
, &value
));
688 *(value
.v_pointer
) = before_traceset
;
689 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/traceset/after",
690 LTTV_POINTER
, &value
));
691 *(value
.v_pointer
) = after_traceset
;
692 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/trace/before",
693 LTTV_POINTER
, &value
));
694 *(value
.v_pointer
) = before_trace
;
695 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/trace/after",
696 LTTV_POINTER
, &value
));
697 *(value
.v_pointer
) = after_trace
;
698 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/tracefile/before",
699 LTTV_POINTER
, &value
));
700 *(value
.v_pointer
) = before_tracefile
;
701 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/tracefile/after",
702 LTTV_POINTER
, &value
));
703 *(value
.v_pointer
) = after_tracefile
;
704 //g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/before",
705 // LTTV_POINTER, &value));
706 //*(value.v_pointer) = before_event;
707 //g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event/after",
708 // LTTV_POINTER, &value));
709 //*(value.v_pointer) = after_event;
710 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/event",
711 LTTV_POINTER
, &value
));
712 *(value
.v_pointer
) = event_hook
;
713 g_assert(lttv_iattribute_find_by_path(attributes
, "hooks/main/before",
714 LTTV_POINTER
, &value
));
715 g_assert((main_hooks
= *(value
.v_pointer
)) != NULL
);
716 lttv_hooks_add(main_hooks
, process_traceset
, NULL
, LTTV_PRIO_DEFAULT
);
720 static void destroy()
726 g_info("Destroy batchAnalysis.c");
728 lttv_option_remove("trace");
729 lttv_option_remove("dump-tracefiles");
730 lttv_option_remove("save-sample");
731 lttv_option_remove("save-state-copy");
732 lttv_option_remove("sample-interval");
733 lttv_option_remove("sample-number");
734 lttv_option_remove("seek-number");
735 lttv_option_remove("save-interval");
736 lttv_option_remove("test1");
737 lttv_option_remove("test2");
738 lttv_option_remove("test3");
739 lttv_option_remove("test4");
740 lttv_option_remove("test5");
741 lttv_option_remove("test6");
742 lttv_option_remove("test7");
743 lttv_option_remove("testall");
745 lttv_hooks_destroy(before_traceset
);
746 lttv_hooks_destroy(after_traceset
);
747 lttv_hooks_destroy(before_trace
);
748 lttv_hooks_destroy(after_trace
);
749 lttv_hooks_destroy(before_tracefile
);
750 lttv_hooks_destroy(after_tracefile
);
751 //lttv_hooks_destroy(before_event);
752 //lttv_hooks_destroy(after_event);
753 lttv_hooks_destroy(event_hook
);
754 lttv_hooks_remove_data(main_hooks
, process_traceset
, NULL
);
756 nb
= lttv_traceset_number(traceset
);
757 for(i
= 0 ; i
< nb
; i
++) {
758 trace
= lttv_traceset_get(traceset
, i
);
759 lttv_traceset_remove(traceset
,i
);
760 ltt_trace_close(lttv_trace(trace
));
761 lttv_trace_destroy(trace
);
764 lttv_traceset_destroy(traceset
);
768 LTTV_MODULE("batchtest", "Batch processing of a trace for tests", \
769 "Run through a trace calling all the registered hooks for tests", \
770 init
, destroy
, "state", "stats", "option" )
This page took 0.058189 seconds and 4 git commands to generate.