-
-
Notifications
You must be signed in to change notification settings - Fork 524
Add wall clock analysis #184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Implemented a new profiling tool that captures both on-CPU and off-CPU activity for a specified process. - The script runs 'oncputime' and 'offcputime' tools simultaneously and combines their results into a unified flamegraph. - Added functionality to discover threads and profile them individually if the application is multi-threaded. - Included error handling for tool execution and output processing. - Created methods for generating flamegraph data and SVG visualizations. - Added command-line argument parsing for user-defined profiling parameters. - Implemented detailed analysis reports for both individual threads and overall profiling results.
…d test program for memory leak detection
…ailed explanations and examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces significant improvements to the memleak eBPF memory leak detection tool and adds a new comprehensive wallclock profiler directory with combined on-CPU and off-CPU analysis capabilities. The main changes include upgrading to blazesym v0.2.0 for improved symbol resolution and creating a complete performance profiling solution.
Key changes:
- Upgrade
memleakto use the newblazesym v0.2.0C API for better performance and accuracy - Add comprehensive wallclock profiler with
oncputimeandoffcputimetools - Create test infrastructure and example programs for both tools
Reviewed Changes
Copilot reviewed 29 out of 31 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/third_party/blazesym | Updated blazesym submodule to newer version for v0.2.0 API |
| src/32-wallclock-profiler/ | New complete wallclock profiler implementation with on-CPU and off-CPU analysis |
| src/16-memleak/ | Updated memleak implementation to use new blazesym v0.2.0 C API |
| .github/workflows/test-libbpf.yml | Added CI testing for the new wallclock profiler |
Comments suppressed due to low confidence (3)
src/32-wallclock-profiler/wallclock_profiler.py:1
- [nitpick] The docstring title doesn't match the actual filename. Should be 'Wall Clock Profiler' to match the filename 'wallclock_profiler.py'.
#!/usr/bin/env python3
src/32-wallclock-profiler/wallclock_profiler.py:1
- Commented out nanosleep code should be removed as it's not being used and clutters the codebase.
#!/usr/bin/env python3
src/32-wallclock-profiler/wallclock_profiler.py:1
- More commented out nanosleep code that should be removed.
#!/usr/bin/env python3
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…ipts and usage examples
This pull request introduces significant improvements to the
memleakeBPF memory leak detection tool and adds a new test program for leak verification. The main changes include upgrading to the newblazesym v0.2.0C API for symbol resolution, refactoring the symbolization logic inmemleak.c, and providing documentation and infrastructure for testing memory leak detection. Additionally, similar build and test infrastructure changes are introduced in the wallclock profiler directory.Memleak improvements and test infrastructure:
blazesym v0.2.0C API for symbol resolution, replacing the old API and types throughoutmemleak.cand updating the build process to use the newcapipackage. This results in improved performance and more accurate symbolization. [1] [2] [3] [4] [5] [6] [7] [8]memleak.cto use the new blazesym API, with dynamic selection of symbolization source (kernel or process) and improved handling of inlined functions. [1] [2]test_memleak.cthat intentionally leaks memory for verification purposes, along with Makefile updates and.gitignoreentries to support building and cleaning test binaries. [1] [2] [3] [4] [5]README.mdandREADME.zh.md) to explain the new symbolization library, describe the test program, and provide example output demonstrating successful leak detection. [1] [2]Wallclock profiler build/test infrastructure:
Makefile,.gitignore, and configuration file to support building main and test programs, and cleaning up artifacts. [1] [2] [3]These changes modernize the symbolization workflow, make leak detection more robust, and provide a simple way to verify correctness with a dedicated test program.