Wireshark mailing list archives
Re: Tips regarding measuring function execution times
From: Pascal Quantin <pascal.quantin () gmail com>
Date: Sun, 15 Oct 2017 22:50:09 +0200
2017-10-15 22:40 GMT+02:00 João Valverde <joao.valverde () tecnico ulisboa pt>:
On 15-10-2017 21:32, Peter Wu wrote:On Sat, Oct 14, 2017 at 02:18:39PM +0000, Paul Offord wrote:I'm investigating a performance problem with the TRANSUM dissector. I'd like to measure the accumulated time taken to execute a function in a Release build. My basic idea is to do something like this: guint32 execute_time_us; . . start_stopwatch(&execute_time_us); function_call_to_be_measured(); pause_stopwatch(&execute_time_us); . . . stop_and_output_stopwatch(&execute_time_us); Is there a standard way to do this in Wireshark? How can I output the accumulated time on, say, the Status Line?Not sure about the Status line question, but you can measure elapsed microseconds with something like: guint64 start_time, end_time; start_time = g_get_monotonic_time(); // ... end_time = g_get_monotonic_time(); // ... g_print("elapsed us: %" G_GUINT64_FORMAT, end_time - start_time); https://developer.gnome.org/glib/stable/glib-Date-and-Time- Functions.html#g-get-monotonic-timeI think console output doesn't work on Windows for graphical applications, or something like that. There isn't a better standard mechanism for debug output in Wireshark, that I know of.
You can make it appear with Edit -> Preferences -> Advanced -> change gui.console_open option to ALWAYS. Pascal.
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: https://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Tips regarding measuring function execution times Paul Offord (Oct 14)
- Re: Tips regarding measuring function execution times Peter Wu (Oct 15)
- Re: Tips regarding measuring function execution times João Valverde (Oct 15)
- Re: Tips regarding measuring function execution times Pascal Quantin (Oct 15)
- Re: Tips regarding measuring function execution times Paul Offord (Oct 15)
- Re: Tips regarding measuring function execution times Roland Knall (Oct 15)
- Re: Tips regarding measuring function execution times Paul Offord (Oct 15)
- Re: Tips regarding measuring function execution times Roland Knall (Oct 15)
- Re: Tips regarding measuring function execution times Guy Harris (Oct 16)
- Re: Tips regarding measuring function execution times Peter Wu (Oct 16)
- Re: Tips regarding measuring function execution times Helge Kruse (Oct 16)
- Re: Tips regarding measuring function execution times João Valverde (Oct 15)
- Re: Tips regarding measuring function execution times Peter Wu (Oct 15)