X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Fbatchtest.c;h=bc68f3730307d6480c976d6b6848dbee87128dee;hb=235c78f0716f71ac54fb6ffe7f9803e86d96bdaa;hp=865a4cb9e8184641eb7e315c6a1e6b27e208060e;hpb=b139ad2a3bd7c28ad16f0c3faed4c62c5cb2c22b;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/batchtest.c b/ltt/branches/poly/lttv/lttv/batchtest.c index 865a4cb9..bc68f373 100644 --- a/ltt/branches/poly/lttv/lttv/batchtest.c +++ b/ltt/branches/poly/lttv/lttv/batchtest.c @@ -35,8 +35,6 @@ #include #include #include -#include -#include #define __UNUSED__ __attribute__((__unused__)) @@ -173,7 +171,8 @@ gboolean trace_event(void __UNUSED__ *hook_data, void *call_data) ltt_event_position(e, a_event_position); ltt_event_position_get(a_event_position, &tf, &nb_block, &offset, &tsc); fprintf(stderr,"Event %s %lu.%09lu [%u 0x%x tsc %llu]\n", - g_quark_to_string(ltt_eventtype_name(ltt_event_eventtype(e))), + g_quark_to_string(marker_get_info_from_id(ltt_tracefile_get_trace(tf), + ltt_event_id(e))->name), tfs->parent.timestamp.tv_sec, tfs->parent.timestamp.tv_nsec, nb_block, offset, tsc); return FALSE; @@ -229,8 +228,10 @@ gboolean save_state_copy_event(void *hook_data, void *call_data) FILE *fp; + LttTrace *trace = ((LttvTracefileContext *)tfs)->t_context->t; + if(ts->nb_event == 0 && - ltt_eventtype_name(ltt_event_eventtype(e)) + marker_get_info_from_id(trace, e->event_id)->name == QUARK_BLOCK_START) { if(a_save_sample != NULL) { filename = g_string_new(""); @@ -298,15 +299,15 @@ static void compute_tracefile(LttTracefile *tracefile, void *hook_data) FILE *fp; LttTime time, previous_time; LttEvent *event = ltt_tracefile_get_event(tracefile); - LttFacility *facility; - LttEventType *event_type; + //LttEventType *event_type; + struct marker_info *minfo; int err; gchar mod_name[PATH_MAX]; /* start_count is always initialized in this function _if_ there is always * a block_start before a block_end. */ - long long unsigned cycle_count, start_count=0, delta_cycle; + //long long unsigned cycle_count, start_count=0, delta_cycle; filename = g_string_new(""); @@ -328,15 +329,15 @@ static void compute_tracefile(LttTracefile *tracefile, void *hook_data) do { LttTracefile *tf_pos; - facility = ltt_event_facility(event); - event_type = ltt_event_eventtype(event); + //event_type = ltt_event_eventtype(event); + minfo = marker_get_info_from_id(ltt_tracefile_get_trace(tracefile), + ltt_event_id(event)); time = ltt_event_time(event); ltt_event_position(event, a_event_position); ltt_event_position_get(a_event_position, &tf_pos, &nb_block, &offset, &tsc); //fprintf(fp,"%s.%s: %llu %lu.%09lu position %u/%u\n", - fprintf(fp, "%s.%s: %llu %lu.%09lu position %u/%u, tracefile %s\n", - g_quark_to_string(ltt_facility_name(facility)), - g_quark_to_string(ltt_eventtype_name(event_type)), + fprintf(fp, "%s: %llu %lu.%09lu position %u/%u, tracefile %s\n", + g_quark_to_string(minfo->name), tsc, (unsigned long)time.tv_sec, (unsigned long)time.tv_nsec, nb_block, offset, @@ -375,7 +376,8 @@ static void compute_tracefile(LttTracefile *tracefile, void *hook_data) } else { #endif //0 - if(ltt_time_compare(time, previous_time) == 0) nb_equal++; + if(ltt_time_compare(time, previous_time) == 0) + nb_equal++; else if(nb_equal > 0) { g_warning("Consecutive %d events with time %lu.%09lu", nb_equal + 1, previous_time.tv_sec, previous_time.tv_nsec); @@ -409,14 +411,6 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, LttTrace *trace; - long long unsigned start_nsec, end_nsec, delta_nsec, added_nsec, added_nsec2; - - double cycle_per_nsec, nsec_per_cycle; - - long long interpolated_nsec, interpolated_nsec2, end_nsec_sec, end_nsec_nsec; - - LttTime start_time; - LttTime max_time = { G_MAXULONG, G_MAXULONG }; a_event_position = ltt_event_position_new(); @@ -513,7 +507,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, g_mem_profile(); } - lttv_stats_sum_traceset(tscs); + lttv_stats_sum_traceset(tscs, ltt_time_infinite); if(lttv_profile_memory) { g_message("Memory summary after summing stats"); @@ -661,18 +655,18 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, g_message("Running test 9 : seek_forward and seek_backward"); lttv_process_traceset_seek_time(tsc, ltt_time_zero); - count = lttv_process_traceset_seek_n_forward(tsc, 500, NULL, NULL, NULL, NULL, NULL); + count = lttv_process_traceset_seek_n_forward(tsc, 500, NULL, NULL, NULL, NULL, NULL, NULL); g_assert(count == 500); lttv_traceset_context_position_save(tsc, saved_pos); t0 = get_time(); - count = lttv_process_traceset_seek_n_forward(tsc, 150000, NULL, NULL, NULL, NULL, NULL); + count = lttv_process_traceset_seek_n_forward(tsc, 150000, NULL, NULL, NULL, NULL, NULL, NULL); t1 = get_time(); g_message("Seek forward 150000 events in %g seconds", t1 - t0); g_assert(count == 150000); t0 = get_time(); count = lttv_process_traceset_seek_n_backward(tsc, 150000, seek_back_default_offset, lttv_process_traceset_seek_time, NULL, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); t1 = get_time(); g_message("Seek backward 150000 events in %g seconds", t1 - t0); g_assert(count == 150000); @@ -680,20 +674,20 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, g_warning("Problem with seek_n ! Positions differ. (1)"); } - lttv_process_traceset_seek_n_forward(tsc, 500, NULL, NULL, NULL, NULL, NULL); + lttv_process_traceset_seek_n_forward(tsc, 500, NULL, NULL, NULL, NULL, NULL, NULL); lttv_traceset_context_position_save(tsc, saved_pos); - lttv_process_traceset_seek_n_forward(tsc, 15000, NULL, NULL, NULL, NULL, NULL); + lttv_process_traceset_seek_n_forward(tsc, 15000, NULL, NULL, NULL, NULL, NULL, NULL); lttv_process_traceset_seek_n_backward(tsc, 15005, seek_back_default_offset, lttv_process_traceset_seek_time, NULL, - NULL, NULL, NULL, NULL); - lttv_process_traceset_seek_n_forward(tsc, 5, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); + lttv_process_traceset_seek_n_forward(tsc, 5, NULL, NULL, NULL, NULL, NULL, NULL); if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos)) { g_warning("Problem with seek_n ! Positions differ. (2)"); } lttv_process_traceset_seek_time(tsc, ltt_time_infinite); - count = lttv_process_traceset_seek_n_forward(tsc, 15000, NULL, NULL, NULL, NULL, NULL); + count = lttv_process_traceset_seek_n_forward(tsc, 15000, NULL, NULL, NULL, NULL, NULL, NULL); if(count > 0) g_warning("Problem with seek_n ! Forward at end of traceset."); @@ -703,11 +697,11 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, t0 = get_time(); lttv_process_traceset_seek_n_backward(tsc, 300, seek_back_default_offset, lttv_process_traceset_seek_time, NULL, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); t1 = get_time(); g_message("Seek backward 300 events in %g seconds", t1 - t0); - count = lttv_process_traceset_seek_n_forward(tsc, 299, NULL, NULL, NULL, NULL, NULL); - count = lttv_process_traceset_seek_n_forward(tsc, 1, NULL, NULL, NULL, NULL, NULL); + count = lttv_process_traceset_seek_n_forward(tsc, 299, NULL, NULL, NULL, NULL, NULL, NULL); + count = lttv_process_traceset_seek_n_forward(tsc, 1, NULL, NULL, NULL, NULL, NULL, NULL); if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos)) { g_warning("Problem with seek_n ! Positions differ. (4)"); @@ -717,11 +711,11 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, t0 = get_time(); lttv_process_traceset_seek_n_backward(tsc, 10, seek_back_default_offset, lttv_process_traceset_seek_time, NULL, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); t1 = get_time(); g_message("Seek backward 10 events in %g seconds", t1 - t0); t0 = get_time(); - count = lttv_process_traceset_seek_n_forward(tsc, 10, NULL, NULL, NULL, NULL, NULL); + count = lttv_process_traceset_seek_n_forward(tsc, 10, NULL, NULL, NULL, NULL, NULL, NULL); t1 = get_time(); g_message("Seek forward 10 events in %g seconds", t1 - t0); @@ -732,9 +726,9 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, lttv_traceset_context_position_save(tsc, saved_pos); lttv_process_traceset_seek_n_backward(tsc, 301, seek_back_default_offset, lttv_process_traceset_seek_time, NULL, - NULL, NULL, NULL, NULL); - count = lttv_process_traceset_seek_n_forward(tsc, 299, NULL, NULL, NULL, NULL, NULL); - count = lttv_process_traceset_seek_n_forward(tsc, 1, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); + count = lttv_process_traceset_seek_n_forward(tsc, 299, NULL, NULL, NULL, NULL, NULL, NULL); + count = lttv_process_traceset_seek_n_forward(tsc, 1, NULL, NULL, NULL, NULL, NULL, NULL); if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos) == 0) { g_warning("Problem with seek_n ! Positions _should_ differ. (5)"); @@ -743,17 +737,17 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, /* Try a seek by closest time : Hint : try this one with and without states * computed. */ lttv_process_traceset_seek_time(tsc, ltt_time_zero); - count = lttv_process_traceset_seek_n_forward(tsc, 200000, NULL, NULL, NULL, NULL, NULL); + count = lttv_process_traceset_seek_n_forward(tsc, 200000, NULL, NULL, NULL, NULL, NULL, NULL); lttv_traceset_context_position_save(tsc, saved_pos); t0 = get_time(); lttv_process_traceset_seek_n_backward(tsc, 100301, seek_back_default_offset, (seek_time_fct)lttv_state_traceset_seek_time_closest, NULL, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); t1 = get_time(); g_message("Seek backward 100301 events (with seek closest) in %g seconds", t1 - t0); - count = lttv_process_traceset_seek_n_forward(tsc, 100301, NULL, NULL, NULL, NULL, NULL); + count = lttv_process_traceset_seek_n_forward(tsc, 100301, NULL, NULL, NULL, NULL, NULL, NULL); if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos)) { g_warning("Problem with seek_n with state seek time! Positions differ. (6)"); @@ -769,7 +763,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, lttv_traceset_context_position_new(tsc); lttv_process_traceset_seek_time(tsc, ltt_time_zero); - lttv_process_traceset_seek_n_forward(tsc, 200000, NULL, NULL, NULL, NULL, NULL); + lttv_process_traceset_seek_n_forward(tsc, 200000, NULL, NULL, NULL, NULL, NULL, NULL); lttv_traceset_context_position_save(tsc, saved_pos); if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos) != 0) g_critical("Error in seek position. (1)"); @@ -777,7 +771,7 @@ static gboolean process_traceset(void __UNUSED__ *hook_data, lttv_process_traceset_seek_time(tsc, ltt_time_infinite); lttv_process_traceset_seek_n_backward(tsc, 500, seek_back_default_offset, lttv_process_traceset_seek_time, NULL, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL); lttv_traceset_context_position_save(tsc, saved_pos); if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos) != 0)