1
- // Copyright (C) 2023 Intel Corporation
1
+ // Copyright (C) 2023-2024 Intel Corporation
2
2
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
3
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
4
@@ -127,6 +127,53 @@ static umf_result_t traceAllocationSplit(void *provider, void *ptr,
127
127
ptr , totalSize , firstSize );
128
128
}
129
129
130
+ static umf_result_t traceGetIpcHandleSize (void * provider , size_t * pSize ) {
131
+ umf_provider_trace_params_priv_t * traceProvider =
132
+ (umf_provider_trace_params_priv_t * )provider ;
133
+
134
+ traceProvider -> trace ("get_ipc_handle_size" );
135
+ return umfMemoryProviderGetIPCHandleSize (traceProvider -> hUpstreamProvider ,
136
+ pSize );
137
+ }
138
+
139
+ static umf_result_t traceGetIpcHandle (void * provider , const void * ptr ,
140
+ size_t size , void * ipcHandle ) {
141
+ umf_provider_trace_params_priv_t * traceProvider =
142
+ (umf_provider_trace_params_priv_t * )provider ;
143
+
144
+ traceProvider -> trace ("get_ipc_handle" );
145
+ return umfMemoryProviderGetIPCHandle (traceProvider -> hUpstreamProvider , ptr ,
146
+ size , ipcHandle );
147
+ }
148
+
149
+ static umf_result_t tracePutIpcHandle (void * provider , void * ipcHandle ) {
150
+ umf_provider_trace_params_priv_t * traceProvider =
151
+ (umf_provider_trace_params_priv_t * )provider ;
152
+
153
+ traceProvider -> trace ("put_ipc_handle" );
154
+ return umfMemoryProviderPutIPCHandle (traceProvider -> hUpstreamProvider ,
155
+ ipcHandle );
156
+ }
157
+
158
+ static umf_result_t traceOpenIpcHandle (void * provider , void * ipcHandle ,
159
+ void * * ptr ) {
160
+ umf_provider_trace_params_priv_t * traceProvider =
161
+ (umf_provider_trace_params_priv_t * )provider ;
162
+
163
+ traceProvider -> trace ("open_ipc_handle" );
164
+ return umfMemoryProviderOpenIPCHandle (traceProvider -> hUpstreamProvider ,
165
+ ipcHandle , ptr );
166
+ }
167
+
168
+ static umf_result_t traceCloseIpcHandle (void * provider , void * ptr ) {
169
+ umf_provider_trace_params_priv_t * traceProvider =
170
+ (umf_provider_trace_params_priv_t * )provider ;
171
+
172
+ traceProvider -> trace ("close_ipc_handle" );
173
+ return umfMemoryProviderCloseIPCHandle (traceProvider -> hUpstreamProvider ,
174
+ ptr );
175
+ }
176
+
130
177
umf_memory_provider_ops_t UMF_TRACE_PROVIDER_OPS = {
131
178
.version = UMF_VERSION_CURRENT ,
132
179
.initialize = traceInitialize ,
@@ -141,4 +188,9 @@ umf_memory_provider_ops_t UMF_TRACE_PROVIDER_OPS = {
141
188
.ext .purge_force = tracePurgeForce ,
142
189
.ext .allocation_merge = traceAllocationMerge ,
143
190
.ext .allocation_split = traceAllocationSplit ,
191
+ .ipc .get_ipc_handle_size = traceGetIpcHandleSize ,
192
+ .ipc .get_ipc_handle = traceGetIpcHandle ,
193
+ .ipc .put_ipc_handle = tracePutIpcHandle ,
194
+ .ipc .open_ipc_handle = traceOpenIpcHandle ,
195
+ .ipc .close_ipc_handle = traceCloseIpcHandle ,
144
196
};
0 commit comments