mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
validate:launcher: Add a simple way to profile app
This commit is contained in:
parent
0e03b38cc2
commit
a88156a416
1 changed files with 9 additions and 1 deletions
|
@ -66,4 +66,12 @@ def _add_gst_launcher_path():
|
||||||
if "__main__" == __name__:
|
if "__main__" == __name__:
|
||||||
libsdir = _add_gst_launcher_path()
|
libsdir = _add_gst_launcher_path()
|
||||||
from launcher.main import main
|
from launcher.main import main
|
||||||
exit(main(libsdir))
|
run_profile = os.environ.get('GST_VALIDATE_LAUNCHER_PROFILING', False)
|
||||||
|
if run_profile:
|
||||||
|
import cProfile
|
||||||
|
prof = cProfile.Profile()
|
||||||
|
res = prof.runcall(main, libsdir)
|
||||||
|
prof.dump_stats('gst-validate-launcher-runstats')
|
||||||
|
exit(res)
|
||||||
|
|
||||||
|
exit(main(libsdir))
|
Loading…
Reference in a new issue