-
Notifications
You must be signed in to change notification settings - Fork 2
feat:wrapper OH_HiTrace #5
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
feat:wrapper OH_HiTrace #5
Conversation
|
LGTM |
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 PR introduces a wrapper for OH_HiTrace tracing functionality by adding a new SystraceSection RAII helper class and integrating it into the canvas drawing code for performance profiling.
Key changes:
- Created
oh_systrace_section.hwith aSystraceSectionRAII wrapper for automatic trace start/finish - Integrated the new tracing utility into
drawRectmethod for performance monitoring
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| oh_systrace_section.h | Defines new SystraceSection RAII class for scoped OH_HiTrace tracing |
| oh_native_canvas_proxy.cpp | Adds trace instrumentation to the drawRect method using the new wrapper |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| namespace OH { | ||
| struct SystraceSection { | ||
| public: |
Copilot
AI
Oct 23, 2025
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.
Remove the redundant public: access specifier. Members of a struct are public by default in C++.
| public: |
| #include <sstream> | ||
|
|
||
| namespace OH { | ||
| struct SystraceSection { |
Copilot
AI
Oct 23, 2025
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.
The SystraceSection class is not copyable or movable, which could lead to issues if accidentally copied. Add SystraceSection(const SystraceSection&) = delete; and SystraceSection& operator=(const SystraceSection&) = delete; to prevent copying.
| OH_HiTrace_FinishTrace(); | ||
| } | ||
| }; | ||
| }//namespace OH |
Copilot
AI
Oct 23, 2025
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.
[nitpick] Add a space before the comment: } // namespace OH to follow standard C++ formatting conventions.
| }//namespace OH | |
| } // namespace OH |
1d59d24 to
3a977da
Compare
Signed-off-by: wuxujie <[email protected]>
Proposed Changes
Testing
Test: Describe how you tested your changes. Note that this line (with
Test:) is required, your PR will not build without it!Issues Fixed
Fixes: [Optional] The bug on https://issuetracker.google.com being fixed
Google CLA
You need to sign the Google Contributor’s License Agreement at https://cla.developers.google.com/.
This is needed since we synchronise most of the code with Google’s AOSP repository. Signing this agreement allows us to synchronise code from your Pull Requests as well.