This endpoint is intended for profiling user code and kernel code, receiving information about coverage of kernel code and user code, and receiving values of performance counters.
Information about methods of the endpoint is provided in the table below.
Methods of the profiler.Profiler endpoint (kl.core.Profiler interface)
Method
Method purpose and parameters
Potential danger of the method
CreateUser
Purpose
Assigns user code profiling.
Profiling generates statistics on the execution of user code in the context of the defined thread. These statistics show how many times the user code from different sections of the defined virtual address range was triggered during the profiling period.
Parameters
[in] tid – thread ID (TID).
[in] from – starting address of the virtual address range for which the statistics are being gathered.
[in] to – end address of the virtual address range for which the statistics are being gathered.
[in] scale – value defining the granularity for dividing user code within the virtual address range defined through the from and to parameters. The address range will be divided into the specific number of sections according to this value.
[out] rc – return code.
Allows the kernel memory to be used up by creating a multitude of objects within it.
DestroyUser
Purpose
Cancels user code profiling.
Parameters
[in] tid – thread ID (TID).
[out] rc – return code.
N/A
CreateKernel
Purpose
Assigns kernel code profiling.
Profiling results in statistics on kernel code execution. These statistics show how many times the kernel code was triggered from different sections of the memory address range of the process that called this method. The range of virtual addresses occupied by kernel code are identical for all processes. Kernel code execution statistics are gathered in the aggregate and not within the context of one process or thread.
Parameters
[out] from – starting address of the virtual address range for which the statistics are being gathered.
[out] to – end address of the virtual address range for which the statistics are being gathered.
[out] scale – value indicating the granularity for dividing kernel code within the virtual address range corresponding to the from and to parameters. The address range will be divided into the specific number of sections defined by this value.
[out] size – size of data containing the statistics in bytes.
[out] rc – return code.
N/A
DestroyKernel
Purpose
Cancels kernel code profiling.
Parameters
[out] rc – return code.
N/A
StartKernel
Purpose
Starts kernel code profiling.
Parameters
[out] rc – return code.
N/A
StopKernel
Purpose
Stops kernel code profiling.
Parameters
[out] rc – return code.
N/A
GetKernelData
Purpose
Lets you get data containing the kernel code execution statistics received during profiling.
Parameters
[in] buf – pointer to the buffer used to save data containing kernel code execution statistics.
[out] rc – return code.
N/A
GetCoverageData
Purpose
Lets you get information about kernel code coverage.
Parameters
[in] index – index for enumerating object files containing instrumented code for gathering coverage data. Enumeration starts with zero.
[out] buf – sequence containing information about the code coverage of an object file (in gcda format).
[out] size – size (in bytes) of data containing information about the code coverage of an object file.
[out] name – path to the *.gcda file that was assigned during compilation.
[out] rc – return code.
N/A
FlushGcov
Purpose
Output of data on kernel code coverage in gcda format via UART.
Parameters
[out] rc – return code.
N/A
FlushGcovFile
Purpose
Output of data on code coverage in gcda format via UART.
Parameters
[in] name – path to the *.gcda file that was assigned during compilation.
[in] buf – pointer to the buffer containing information about code coverage in gcda format.
[in] size – size of data containing code coverage information.
[out] rc – return code.
N/A
GetCounters
Purpose
Lets you get the values of performance counters.
Parameters
[in] prefix – prefix for names of performance counters.
[in] names – sequence containing the names of performance counters.
[out] values – sequence containing the values of performance counters.