From 016449a53c96e157b9b00eddd0b1ba576f9e1697 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Tue, 12 Jan 2016 09:44:17 +0100 Subject: [PATCH] debug-viewer: add more logging and some profiling how-to The port is much slower than the gtk3 version. Try to figure why. --- debug-viewer/GstDebugViewer/Data.py | 2 +- debug-viewer/GstDebugViewer/GUI/window.py | 1 + debug-viewer/README | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/debug-viewer/GstDebugViewer/Data.py b/debug-viewer/GstDebugViewer/Data.py index 1358716a3e..6315dc7f1c 100644 --- a/debug-viewer/GstDebugViewer/Data.py +++ b/debug-viewer/GstDebugViewer/Data.py @@ -460,7 +460,7 @@ class LogFile (Producer): self.have_load_started () def handle_load_finished (self): - + self.logger.debug ("finish loading") self.lines = LogLines (self.fileobj, self.line_cache) # Chain up to our consumers: diff --git a/debug-viewer/GstDebugViewer/GUI/window.py b/debug-viewer/GstDebugViewer/GUI/window.py index a0b267d892..71599b38ca 100644 --- a/debug-viewer/GstDebugViewer/GUI/window.py +++ b/debug-viewer/GstDebugViewer/GUI/window.py @@ -908,6 +908,7 @@ class Window (object): _("It is not a GStreamer log file.")) def idle_set (): + self.logger.debug ("idle trigger after load finished") self.log_view.set_model (self.log_filter) self.line_view.handle_attach_log_file (self) diff --git a/debug-viewer/README b/debug-viewer/README index 47564c492d..f517ae8cfd 100644 --- a/debug-viewer/README +++ b/debug-viewer/README @@ -21,6 +21,16 @@ NEW: column.pack_start (cell, True) OLD: view_column.get_cell_renderers () NEW: column.get_cells () -= porting ressources = +# porting ressources # https://www.xpra.org/trac/ticket/90?cversion=0&cnum_hist=3 -https://mail.gnome.org/archives/commits-list/2013-October/msg05205.html \ No newline at end of file +https://mail.gnome.org/archives/commits-list/2013-October/msg05205.html + +# profiling # +python -m profile -o output.pstats path/to/your/script arg1 arg2 +gprof2dot.py -f pstats output.pstats | dot -Tpng -o output.png +~/projects/tools/gprof2dot/gprof2dot.py -f pstats output.pstats | dot -Tpng -o output.png +eog output.png + +python -m cProfile -o output.pstats2 ./gst-debug-viewer debug.noansi.log +~/projects/tools/gprof2dot/gprof2dot.py -f pstats output.pstats2 | dot -Tpng -o output2.png +eog output2.png