[enhancement]: Tool to profile cloud-init with cProfile
holmanb opened this issue · comments
Enhancement
Cloud-init runs as four separate services at early runtime. This could be instrumented in our integration test suite to run cProfile within each service to make introspecting cloud-init runtime easier for developers. This can be done manually, by modifying cloud-init-local.service
, cloud-init.service
, cloud-config.service
, and cloud-final.service
, for example ExecStart=python3 -m cProfile -o cloud-init-local.prof /usr/bin/cloud-init init --local
in the case of cloud-init-local.service
This could follow a similar approach to 9001f07, which modifies the service files to run cloud-init under the coverage python module (see tests/integration_tests/assets/enable_coverage.py
in that commit).