From 081f687d9784fd3433a215bbe83c47d231bc8ee5 Mon Sep 17 00:00:00 2001 From: Tim Lauridsen Date: Mon, 24 Jun 2024 12:05:32 +0200 Subject: [PATCH] make: add targets to debug updater memory usage with memray --- .gitignore | 2 +- Makefile | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8ba7404..4283ffd 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,4 @@ yumex/constants.py sandbox/ - +profile/ diff --git a/Makefile b/Makefile index b227f39..b72fe9e 100644 --- a/Makefile +++ b/Makefile @@ -203,3 +203,23 @@ run-tests: # run unit tests and generate html coverage report run-test-report: pytest --cov --cov-report html + +# dnf5 install python3-memray +memray-updater: + @systemctl --user stop yumex-updater-systray.service + @$(MAKE) localbuild + @-mkdir -p profile + @-rm profile/output.bin + @-rm profile/memray-flamegraph-output.html + @-python3 -m memray run -o profile/output.bin ./builddir/bin/yumex_updater_systray + @-python3 -m memray flamegraph profile/output.bin + +# dnf5 install python3-memray +memray-updater-live: + @-systemctl --user stop yumex-updater-systray.service + @$(MAKE) localbuild + @-mkdir -p profile + @-python3 -m memray run --live ./builddir/bin/yumex_updater_systray + + +