diff --git a/epan/packet.c b/epan/packet.c index ef7de29..22cf2c0 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -294,6 +294,7 @@ final_registration_all_protocols(void) &call_final_registration_routine, NULL); } +#define ENABLE_PROFILE /* Creates the top-most tvbuff and calls dissect_frame() */ void @@ -325,6 +326,10 @@ dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header, EP_CHECK_CANARY(("before dissecting frame %d",fd->num)); TRY { +#ifdef ENABLE_PROFILE + GTimer *timer = g_timer_new(); + gdouble elapsed; +#endif edt->tvb = tvb_new_real_data(pd, fd->cap_len, fd->pkt_len); /* Add this tvbuffer into the data_src list */ packet_add_new_data_source(&edt->pi, edt->tree, edt->tvb, "Frame"); @@ -335,7 +340,11 @@ dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header, * in this function. */ if(frame_handle != NULL) call_dissector(frame_handle, edt->tvb, &edt->pi, edt->tree); - +#ifdef ENABLE_PROFILE + elapsed = g_timer_elapsed(timer, NULL) * 1000.0; + g_print("%u: %g ms\n", fd->num, elapsed); + g_timer_destroy(timer); +#endif } CATCH(BoundsError) { g_assert_not_reached();