Refactorized the rules targetting `profiling-*`

Signed-off-by: Ariel Otilibili <otilibil@eurecom.fr>
pull/2907/head
Ariel Otilibili 2024-08-05 23:37:14 +02:00
parent 4dba2f13ad
commit cad29145f1
1 changed files with 5 additions and 5 deletions

View File

@ -124,20 +124,20 @@ semgrep: ## Run semgrep to find bugs and enforce code standards
profiling-gprof: ## Callgraph profiling (need "apt install graphviz")
@echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
sleep 3
./venv/bin/python -m cProfile -o ./glances.cprof ./run.py --stop-after 30
./venv-dev/bin/gprof2dot -f pstats ./glances.cprof | dot -Tsvg -o ./docs/_static/glances-cgraph.svg
$(PYTHON) -m cProfile -o ./glances.cprof ./run.py --stop-after 30
$(VENV_DEV)/gprof2dot -f pstats ./glances.cprof | dot -Tsvg -o ./docs/_static/glances-cgraph.svg
rm -f ./glances.cprof
profiling-pyinstrument: ## PyInstrument profiling
@echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
sleep 3
./venv/bin/pip install pyinstrument
./venv/bin/python -m pyinstrument -r html -o ./docs/_static/glances-pyinstrument.html -m glances --stop-after 30
$(PIP) install pyinstrument
$(PYTHON) -m pyinstrument -r html -o ./docs/_static/glances-pyinstrument.html -m glances --stop-after 30
profiling-pyspy: ## Flame profiling (currently not compatible with Python 3.12)
@echo "Start Glances for 30 iterations (more or less 1 mins, please do not exit !)"
sleep 3
./venv-dev/bin/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s -- ./venv/bin/python ./run.py --stop-after 30
$(VENV_DEV)/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s -- $(PYTHON) ./run.py --stop-after 30
profiling: profiling-gprof profiling-pyinstrument profiling-pyspy ## Profiling of the Glances software