From eaf5e77392d98c5de7b5e6bba88eb2121226df36 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 17 Feb 2014 11:13:27 -0400 Subject: profiling target to makefile --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 00fec2ed..564fbe15 100644 --- a/Makefile +++ b/Makefile @@ -64,5 +64,8 @@ manpages: apidocs: @sphinx-apidoc -o docs/api src/leap/bitmask +mailprofile: + gprof2dot -f pstats /tmp/leap_mail_profile.pstats -n 0.2 -e 0.2 | dot -Tpdf -o /tmp/leap_mail_profile.pdf + clean : $(RM) $(COMPILED_UI) $(COMPILED_RESOURCES) $(COMPILED_UI:.py=.pyc) $(COMPILED_RESOURCES:.py=.pyc) -- cgit v1.2.3 From f5d174948bf4e2fa6fca8024168a40af922a30a9 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 17 Feb 2014 13:29:28 -0400 Subject: add line_profiler targets to Makefile --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 564fbe15..25d2bcf5 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,10 @@ COMPILED_RESOURCES = $(RESOURCES:%.qrc=$(COMPILED_DIR)/%_rc.py) DEBVER = $(shell dpkg-parsechangelog | sed -ne 's,Version: ,,p') +ifndef EDITOR + export EDITOR=vim +endif + # all : resources ui @@ -67,5 +71,11 @@ apidocs: mailprofile: gprof2dot -f pstats /tmp/leap_mail_profile.pstats -n 0.2 -e 0.2 | dot -Tpdf -o /tmp/leap_mail_profile.pdf +do_lineprof: + LEAP_PROFILE_IMAPCMD=1 LEAP_MAIL_MANHOLE=1 kernprof.py -l src/leap/bitmask/app.py --offline --debug + +view_lineprof: + @python -m line_profiler app.py.lprof | $(EDITOR) - + clean : $(RM) $(COMPILED_UI) $(COMPILED_RESOURCES) $(COMPILED_UI:.py=.pyc) $(COMPILED_RESOURCES:.py=.pyc) -- cgit v1.2.3 From 06c8d6f98768f173854585e3c9b36c4fa6bfe753 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 5 Mar 2014 15:28:08 -0400 Subject: script to graph cpu/mem usage. Related: #5259 Use as: RESOURCE_TIME=5 make resource_graph where RESOURCE_TIME are the minutes to run for. --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 25d2bcf5..2bd39eb0 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,10 @@ ifndef EDITOR export EDITOR=vim endif +ifndef RESOURCE_TIME + export RESOURCE_TIME=10 +endif + # all : resources ui @@ -77,5 +81,9 @@ do_lineprof: view_lineprof: @python -m line_profiler app.py.lprof | $(EDITOR) - +resource_graph: + ./pkg/scripts/monitor_resource.zsh `pgrep bitmask` $(RESOURCE_TIME) + display bitmask-resources.png + clean : $(RM) $(COMPILED_UI) $(COMPILED_RESOURCES) $(COMPILED_UI:.py=.pyc) $(COMPILED_RESOURCES:.py=.pyc) -- cgit v1.2.3 From ce66b82ce46948b8c2a74a17a1d75d7510e77f7f Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 7 Mar 2014 12:56:11 -0400 Subject: add ability to set nice order via env var --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2bd39eb0..b637fefc 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,7 @@ view_lineprof: @python -m line_profiler app.py.lprof | $(EDITOR) - resource_graph: + #./pkg/scripts/monitor_resource.zsh `pgrep twistd` $(RESOURCE_TIME) ./pkg/scripts/monitor_resource.zsh `pgrep bitmask` $(RESOURCE_TIME) display bitmask-resources.png -- cgit v1.2.3 From 806fe6f8f6664da99f5405af5a831f0e48e3fe64 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 10 Mar 2014 03:31:32 -0400 Subject: comment workaround for systems w/o pgrep --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b637fefc..cb1f8218 100644 --- a/Makefile +++ b/Makefile @@ -76,13 +76,16 @@ mailprofile: gprof2dot -f pstats /tmp/leap_mail_profile.pstats -n 0.2 -e 0.2 | dot -Tpdf -o /tmp/leap_mail_profile.pdf do_lineprof: - LEAP_PROFILE_IMAPCMD=1 LEAP_MAIL_MANHOLE=1 kernprof.py -l src/leap/bitmask/app.py --offline --debug + LEAP_PROFILE_IMAPCMD=1 LEAP_MAIL_MANHOLE=1 kernprof.py -l src/leap/bitmask/app.py --debug + +do_lineprof_offline: + LEAP_PROFILE_IMAPCMD=1 LEAP_MAIL_MANHOLE=1 kernprof.py -l src/leap/bitmask/app.py --offline --debug -N view_lineprof: @python -m line_profiler app.py.lprof | $(EDITOR) - resource_graph: - #./pkg/scripts/monitor_resource.zsh `pgrep twistd` $(RESOURCE_TIME) + #./pkg/scripts/monitor_resource.zsh `ps aux | grep app.py | head -1 | awk '{print $$2}'` $(RESOURCE_TIME) ./pkg/scripts/monitor_resource.zsh `pgrep bitmask` $(RESOURCE_TIME) display bitmask-resources.png -- cgit v1.2.3 From ed4fcb096c3166b76075921a484ee045e96f60b2 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 11 Mar 2014 12:10:15 -0400 Subject: add cProfile+viewer target to Makefile --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index cb1f8218..358af126 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,12 @@ manpages: apidocs: @sphinx-apidoc -o docs/api src/leap/bitmask +do_cprofile: + python -m cProfile -o bitmask.cprofile src/leap/bitmask/app.py --debug -N + +view_cprofile: + cprofilev bitmask.cprofile + mailprofile: gprof2dot -f pstats /tmp/leap_mail_profile.pstats -n 0.2 -e 0.2 | dot -Tpdf -o /tmp/leap_mail_profile.pdf -- cgit v1.2.3