diff --git a/include/ittnotify.h b/include/ittnotify.h index 898f8bb6..0744901c 100644 --- a/include/ittnotify.h +++ b/include/ittnotify.h @@ -2454,9 +2454,58 @@ typedef enum { __itt_metadata_u16, /**< Unsigned 16-bit integer */ __itt_metadata_s16, /**< Signed 16-bit integer */ __itt_metadata_float, /**< Signed 32-bit floating-point */ - __itt_metadata_double /**< SIgned 64-bit floating-point */ + __itt_metadata_double /**< Signed 64-bit floating-point */ } __itt_metadata_type; +/** + * @ingroup parameters + * @brief Add metadata to an instance of a named entity. + * @param[in] domain The domain controlling the call + * @param[in] format The printf-style format of the metadata + * @param[in] ... The metadata itself as multiple arguments + */ +void ITTAPI __itt_formatted_metadata_add(const __itt_domain *domain, __itt_string_handle *format, ...); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, formatted_metadata_add, (const __itt_domain *domain, __itt_string_handle *format, ...)) +#define __itt_formatted_metadata_add ITTNOTIFY_VOID(formatted_metadata_add) +#define __itt_formatted_metadata_add_ptr ITTNOTIFY_NAME(formatted_metadata_add) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_formatted_metadata_add(domain, format, metadata) +#define __itt_formatted_metadata_add_ptr 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_formatted_metadata_add_ptr 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + +/** + * @ingroup parameters + * @brief Add metadata to an instance of a named entity. + * @param[in] domain The domain controlling the call + * @param[in] taskid The identifier for this task instance, *cannot* be __itt_null. + * @param[in] format The printf-style format of the metadata + * @param[in] ... The metadata itself as multiple arguments + */ +void ITTAPI __itt_formatted_metadata_add_overlapped(const __itt_domain *domain, __itt_id taskid, __itt_string_handle *format, ...); + +/** @cond exclude_from_documentation */ +#ifndef INTEL_NO_MACRO_BODY +#ifndef INTEL_NO_ITTNOTIFY_API +ITT_STUBV(ITTAPI, void, formatted_metadata_add_overlapped, (const __itt_domain *domain, __itt_id taskid, __itt_string_handle *format, ...)) +#define __itt_formatted_metadata_add_overlapped ITTNOTIFY_VOID(formatted_metadata_add_overlapped) +#define __itt_formatted_metadata_add_ptr_overlapped ITTNOTIFY_NAME(formatted_metadata_add_overlapped) +#else /* INTEL_NO_ITTNOTIFY_API */ +#define __itt_formatted_metadata_add_overlapped(domain, taskid, format, metadata) +#define __itt_formatted_metadata_add_ptr_overlapped 0 +#endif /* INTEL_NO_ITTNOTIFY_API */ +#else /* INTEL_NO_MACRO_BODY */ +#define __itt_formatted_metadata_add_ptr_overlapped 0 +#endif /* INTEL_NO_MACRO_BODY */ +/** @endcond */ + /** * @ingroup parameters * @brief Add metadata to an instance of a named entity. diff --git a/rust/ittapi-sys/src/linux/ittnotify_bindings.rs b/rust/ittapi-sys/src/linux/ittnotify_bindings.rs index cd069fd5..8de7b41b 100644 --- a/rust/ittapi-sys/src/linux/ittnotify_bindings.rs +++ b/rust/ittapi-sys/src/linux/ittnotify_bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.69.5 */ pub const ITT_OS_WIN: u32 = 1; pub const ITT_OS_LINUX: u32 = 2; @@ -796,10 +796,28 @@ pub const __itt_metadata_type___itt_metadata_u16: __itt_metadata_type = 5; pub const __itt_metadata_type___itt_metadata_s16: __itt_metadata_type = 6; #[doc = "< Signed 32-bit floating-point"] pub const __itt_metadata_type___itt_metadata_float: __itt_metadata_type = 7; -#[doc = "< SIgned 64-bit floating-point"] +#[doc = "< Signed 64-bit floating-point"] pub const __itt_metadata_type___itt_metadata_double: __itt_metadata_type = 8; #[doc = " @ingroup parameters\n @brief describes the type of metadata"] pub type __itt_metadata_type = ::std::os::raw::c_uint; +pub type __itt_formatted_metadata_add_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(domain: *const __itt_domain, format: *mut __itt_string_handle, ...), +>; +extern "C" { + pub static mut __itt_formatted_metadata_add_ptr__3_0: __itt_formatted_metadata_add_ptr__3_0_t; +} +pub type __itt_formatted_metadata_add_overlapped_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + taskid: __itt_id, + format: *mut __itt_string_handle, + ... + ), +>; +extern "C" { + pub static mut __itt_formatted_metadata_add_overlapped_ptr__3_0: + __itt_formatted_metadata_add_overlapped_ptr__3_0_t; +} pub type __itt_metadata_add_ptr__3_0_t = ::std::option::Option< unsafe extern "C" fn( domain: *const __itt_domain, diff --git a/rust/ittapi-sys/src/linux/jitprofiling_bindings.rs b/rust/ittapi-sys/src/linux/jitprofiling_bindings.rs index 1e9d9764..646dd74e 100644 --- a/rust/ittapi-sys/src/linux/jitprofiling_bindings.rs +++ b/rust/ittapi-sys/src/linux/jitprofiling_bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.69.5 */ #[doc = "<\\brief Send this to shutdown the agent.\n Use NULL for event data."] pub const iJIT_jvm_event_iJVM_EVENT_TYPE_SHUTDOWN: iJIT_jvm_event = 2; diff --git a/rust/ittapi-sys/src/macos/ittnotify_bindings.rs b/rust/ittapi-sys/src/macos/ittnotify_bindings.rs index 9c1e40cf..87ceb933 100644 --- a/rust/ittapi-sys/src/macos/ittnotify_bindings.rs +++ b/rust/ittapi-sys/src/macos/ittnotify_bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.69.5 */ pub const ITT_OS_WIN: u32 = 1; pub const ITT_OS_LINUX: u32 = 2; @@ -796,10 +796,28 @@ pub const __itt_metadata_type___itt_metadata_u16: __itt_metadata_type = 5; pub const __itt_metadata_type___itt_metadata_s16: __itt_metadata_type = 6; #[doc = "< Signed 32-bit floating-point"] pub const __itt_metadata_type___itt_metadata_float: __itt_metadata_type = 7; -#[doc = "< SIgned 64-bit floating-point"] +#[doc = "< Signed 64-bit floating-point"] pub const __itt_metadata_type___itt_metadata_double: __itt_metadata_type = 8; #[doc = " @ingroup parameters\n @brief describes the type of metadata"] pub type __itt_metadata_type = ::std::os::raw::c_uint; +pub type __itt_formatted_metadata_add_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(domain: *const __itt_domain, format: *mut __itt_string_handle, ...), +>; +extern "C" { + pub static mut __itt_formatted_metadata_add_ptr__3_0: __itt_formatted_metadata_add_ptr__3_0_t; +} +pub type __itt_formatted_metadata_add_overlapped_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + taskid: __itt_id, + format: *mut __itt_string_handle, + ... + ), +>; +extern "C" { + pub static mut __itt_formatted_metadata_add_overlapped_ptr__3_0: + __itt_formatted_metadata_add_overlapped_ptr__3_0_t; +} pub type __itt_metadata_add_ptr__3_0_t = ::std::option::Option< unsafe extern "C" fn( domain: *const __itt_domain, diff --git a/rust/ittapi-sys/src/macos/jitprofiling_bindings.rs b/rust/ittapi-sys/src/macos/jitprofiling_bindings.rs index 1e9d9764..646dd74e 100644 --- a/rust/ittapi-sys/src/macos/jitprofiling_bindings.rs +++ b/rust/ittapi-sys/src/macos/jitprofiling_bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.69.5 */ #[doc = "<\\brief Send this to shutdown the agent.\n Use NULL for event data."] pub const iJIT_jvm_event_iJVM_EVENT_TYPE_SHUTDOWN: iJIT_jvm_event = 2; diff --git a/rust/ittapi-sys/src/windows/ittnotify_bindings.rs b/rust/ittapi-sys/src/windows/ittnotify_bindings.rs index 39458a7e..8cd76603 100644 --- a/rust/ittapi-sys/src/windows/ittnotify_bindings.rs +++ b/rust/ittapi-sys/src/windows/ittnotify_bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.69.5 */ pub const ITT_OS_WIN: u32 = 1; pub const ITT_OS_LINUX: u32 = 2; @@ -855,10 +855,28 @@ pub const __itt_metadata_type___itt_metadata_u16: __itt_metadata_type = 5; pub const __itt_metadata_type___itt_metadata_s16: __itt_metadata_type = 6; #[doc = "< Signed 32-bit floating-point"] pub const __itt_metadata_type___itt_metadata_float: __itt_metadata_type = 7; -#[doc = "< SIgned 64-bit floating-point"] +#[doc = "< Signed 64-bit floating-point"] pub const __itt_metadata_type___itt_metadata_double: __itt_metadata_type = 8; #[doc = " @ingroup parameters\n @brief describes the type of metadata"] pub type __itt_metadata_type = ::std::os::raw::c_int; +pub type __itt_formatted_metadata_add_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn(domain: *const __itt_domain, format: *mut __itt_string_handle, ...), +>; +extern "C" { + pub static mut __itt_formatted_metadata_add_ptr__3_0: __itt_formatted_metadata_add_ptr__3_0_t; +} +pub type __itt_formatted_metadata_add_overlapped_ptr__3_0_t = ::std::option::Option< + unsafe extern "C" fn( + domain: *const __itt_domain, + taskid: __itt_id, + format: *mut __itt_string_handle, + ... + ), +>; +extern "C" { + pub static mut __itt_formatted_metadata_add_overlapped_ptr__3_0: + __itt_formatted_metadata_add_overlapped_ptr__3_0_t; +} pub type __itt_metadata_add_ptr__3_0_t = ::std::option::Option< unsafe extern "C" fn( domain: *const __itt_domain, diff --git a/rust/ittapi-sys/src/windows/jitprofiling_bindings.rs b/rust/ittapi-sys/src/windows/jitprofiling_bindings.rs index ad674537..427e07ca 100644 --- a/rust/ittapi-sys/src/windows/jitprofiling_bindings.rs +++ b/rust/ittapi-sys/src/windows/jitprofiling_bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.69.5 */ #[doc = "<\\brief Send this to shutdown the agent.\n Use NULL for event data."] pub const iJIT_jvm_event_iJVM_EVENT_TYPE_SHUTDOWN: iJIT_jvm_event = 2; diff --git a/src/ittnotify/ittnotify_config.h b/src/ittnotify/ittnotify_config.h index 49649524..7b0d855c 100644 --- a/src/ittnotify/ittnotify_config.h +++ b/src/ittnotify/ittnotify_config.h @@ -208,10 +208,10 @@ #define ITT_MAGIC { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 } /* Replace with snapshot date YYYYMMDD for promotion build. */ -#define API_VERSION_BUILD 20230630 +#define API_VERSION_BUILD 20250429 #ifndef API_VERSION_NUM -#define API_VERSION_NUM 3.24.6 +#define API_VERSION_NUM 3.26.0 #endif /* API_VERSION_NUM */ #define API_VERSION "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) \ diff --git a/src/ittnotify/ittnotify_static.h b/src/ittnotify/ittnotify_static.h index 60726872..27081cb5 100644 --- a/src/ittnotify/ittnotify_static.h +++ b/src/ittnotify/ittnotify_static.h @@ -207,6 +207,12 @@ ITT_STUBV(ITTAPI, void, counter_dec_delta_v3, (const __itt_domain *domain, __itt ITT_STUBV(ITTAPI, void, marker, (const __itt_domain *domain, __itt_id id, __itt_string_handle *name, __itt_scope scope), (ITT_FORMAT domain, id, name, scope), marker, __itt_group_structure, "%p, %lu, %p, %d") +ITT_STUBV(ITTAPI, void, formatted_metadata_add, (const __itt_domain *domain, __itt_string_handle *format, ...), \ + (ITT_FORMAT domain, format), formatted_metadata_add, __itt_group_structure, "%p, %p") + +ITT_STUBV(ITTAPI, void, formatted_metadata_add_overlapped, (const __itt_domain *domain, __itt_id id, __itt_string_handle *format, ...), \ + (ITT_FORMAT domain, id, format), formatted_metadata_add_overlapped, __itt_group_structure, "%p, %lu, %p") + ITT_STUBV(ITTAPI, void, metadata_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data), (ITT_FORMAT domain, id, key, type, count, data), metadata_add, __itt_group_structure, "%p, %lu, %p, %d, %lu, %p") #if ITT_PLATFORM==ITT_PLATFORM_WIN ITT_STUBV(ITTAPI, void, metadata_str_addA, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char* data, size_t length), (ITT_FORMAT domain, id, key, data, length), metadata_str_addA, __itt_group_structure, "%p, %lu, %p, %p, %lu") diff --git a/src/ittnotify_refcol/itt_refcol_impl.c b/src/ittnotify_refcol/itt_refcol_impl.c index 92503585..aecf8fbb 100644 --- a/src/ittnotify_refcol/itt_refcol_impl.c +++ b/src/ittnotify_refcol/itt_refcol_impl.c @@ -333,6 +333,26 @@ ITT_EXTERN_C void __itt_metadata_add(const __itt_domain *domain, __itt_id id, } } +ITT_EXTERN_C void __itt_formatted_metadata_add(const __itt_domain *domain, __itt_string_handle *format, ...) +{ + if (domain == NULL || format == NULL) + { + LOG_FUNC_CALL_WARN("Incorrect function call"); + return; + } + + va_list args; + va_start(args, format); + + char formatted_metadata[LOG_BUFFER_MAX_SIZE]; + vsnprintf(formatted_metadata, LOG_BUFFER_MAX_SIZE, format->strA, args); + + LOG_FUNC_CALL_INFO("functions args: domain=%s formatted_metadata=%s", + domain->nameA, formatted_metadata); + + va_end(args); +} + ITT_EXTERN_C void __itt_histogram_submit(__itt_histogram* hist, size_t length, void* x_data, void* y_data) { if (hist == NULL)