| 1 |
/* |
| 2 |
* Copyright (C) 2019-2023 Intel Corporation |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: MIT |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
#pragma once |
| 9 |
|
| 10 |
#include "opencl/source/tracing/tracing_types.h" |
| 11 |
|
| 12 |
#ifdef __cplusplus |
| 13 |
extern "C" { |
| 14 |
#endif |
| 15 |
|
| 16 |
/*! |
| 17 |
Function creates a tracing handle object |
| 18 |
\param[in] device Device to create tracing handle for |
| 19 |
\param[in] callback User-defined callback that will be called along with |
| 20 |
traced API function |
| 21 |
\param[in] userData Pointer to any data user would like to pass into the |
| 22 |
callback, can be zero |
| 23 |
\param[out] handle Tracing handle object that describes current tracing |
| 24 |
session |
| 25 |
\return Status code for current operation |
| 26 |
|
| 27 |
Thread Safety: yes |
| 28 |
*/ |
| 29 |
cl_int CL_API_CALL clCreateTracingHandleINTEL(cl_device_id device, cl_tracing_callback callback, void *userData, cl_tracing_handle *handle); |
| 30 |
|
| 31 |
/*! |
| 32 |
Function allows to specify which target API call should be traced. |
| 33 |
By default function will NOT be traced |
| 34 |
\param[in] handle Tracing handle object |
| 35 |
\param[in] fid Target function identifier |
| 36 |
\param[in] enable Flag to enable/disable tracing for target function |
| 37 |
\return Status code for current operation |
| 38 |
|
| 39 |
Thread Safety: no |
| 40 |
*/ |
| 41 |
cl_int CL_API_CALL clSetTracingPointINTEL(cl_tracing_handle handle, ClFunctionId fid, cl_bool enable); |
| 42 |
|
| 43 |
/*! |
| 44 |
Function destroys the tracing handle object and releases all the associated |
| 45 |
resources |
| 46 |
\param[in] handle Tracing handle object |
| 47 |
\return Status code for current operation |
| 48 |
|
| 49 |
Thread Safety: no |
| 50 |
*/ |
| 51 |
cl_int CL_API_CALL clDestroyTracingHandleINTEL(cl_tracing_handle handle); |
| 52 |
|
| 53 |
/*! |
| 54 |
Function enables the tracing process for the handle. Multiple handles |
| 55 |
can be enabled at a time |
| 56 |
\param[in] handle Tracing handle object |
| 57 |
\return Status code for current operation |
| 58 |
|
| 59 |
Thread Safety: yes |
| 60 |
*/ |
| 61 |
cl_int CL_API_CALL clEnableTracingINTEL(cl_tracing_handle handle); |
| 62 |
|
| 63 |
/*! |
| 64 |
Function disables the tracing process for the handle. It will wait until |
| 65 |
all currently running callbacks are done |
| 66 |
\param[in] handle Tracing handle object |
| 67 |
\return Status code for current operation |
| 68 |
|
| 69 |
Thread Safety: yes |
| 70 |
*/ |
| 71 |
cl_int CL_API_CALL clDisableTracingINTEL(cl_tracing_handle handle); |
| 72 |
|
| 73 |
/*! |
| 74 |
Function requests the tracing state for the handle |
| 75 |
\param[in] handle Tracing handle object |
| 76 |
\param[out] enable Returns TRUE if tracing handle is in use and |
| 77 |
FALSE otherwise |
| 78 |
\return Status code for current operation |
| 79 |
|
| 80 |
Thread Safety: yes |
| 81 |
*/ |
| 82 |
cl_int CL_API_CALL clGetTracingStateINTEL(cl_tracing_handle handle, cl_bool *enable); |
| 83 |
|
| 84 |
#ifdef __cplusplus |
| 85 |
} |
| 86 |
#endif |