Skip to content

Conversation

@eparshut
Copy link
Contributor

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_global to store the global ITT state and capture it in __itt_api_init.
  • Add __itt_refcol_release to 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_release is missing ITT_EXTERN_C and ITTAPI annotations; add these macros to ensure correct linkage and calling convention.
void __itt_refcol_release()

src/ittnotify_refcol/Makefile:5

  • Library name changed from libittrefcol.so to libittnotify_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_release explaining 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_release to verify correct object management and cleanup.
ITT_EXTERN_C __itt_domain* ITTAPI __itt_domain_create(const char *name)

@eparshut eparshut merged commit 1de6647 into intel:master Jun 26, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reference collector receives NULL name for __itt_task_begin after first in PyTorch

3 participants