Add ITT API object creation and cleanup to reference collector#182
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
The PR enhances the reference collector by adding state tracking, object creation, and cleanup support for ITT API domains, string handles, counters, and histograms, plus minor stylistic tweaks.
- Introduce
g_itt_globalto store the global ITT state and capture it in__itt_api_init. - Add
__itt_refcol_releaseto free all allocated reference-collected objects. - Provide public factory functions (
__itt_domain_create,__itt_string_handle_create,__itt_counter_create_v3,__itt_histogram_create) and update comment style. - Rename the output library in the Makefile to
libittnotify_refcol.so.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/ittnotify_refcol/itt_refcol_impl.c | Added global pointer handling, release function, public create APIs for domain/string/counter/histogram, and updated comments. |
| src/ittnotify_refcol/Makefile | Updated LIB_NAME from libittrefcol.so to libittnotify_refcol.so. |
Comments suppressed due to low confidence (4)
src/ittnotify_refcol/itt_refcol_impl.c:230
- Public API function
__itt_refcol_releaseis missingITT_EXTERN_CandITTAPIannotations; add these macros to ensure correct linkage and calling convention.
void __itt_refcol_release()
src/ittnotify_refcol/Makefile:5
- Library name changed from
libittrefcol.sotolibittnotify_refcol.so; update documentation and any downstream build or install scripts to match the new name.
LIB_NAME = libittnotify_refcol.so
src/ittnotify_refcol/itt_refcol_impl.c:229
- Add a brief doc comment above
__itt_refcol_releaseexplaining when and how clients should call this cleanup function.
// Call this function to release allocated resources and avoid memory leaks
src/ittnotify_refcol/itt_refcol_impl.c:281
- Consider adding unit tests for
__itt_domain_create,__itt_string_handle_create,__itt_counter_create_v3,__itt_histogram_create, and__itt_refcol_releaseto verify correct object management and cleanup.
ITT_EXTERN_C __itt_domain* ITTAPI __itt_domain_create(const char *name)
Andy51
approved these changes
Jun 26, 2025
lalithsharan-intel
approved these changes
Jun 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented creation and management of ITT API domains, string handles, counters, and histograms objects in the reference collector. As well fixed some minor problems in reference collector.
These changes should improve the usability of the reference collector and solve problems such as #178