Establish a performance profiling environment guarantees meaningful
and consistency of consecutive invocations of the odp_cpu_xxx() APIs.
While after profiling was done restore the execution environment to
its multi-core optimized state.

Signed-off-by: Yi He <[email protected]>
---
 include/odp/api/spec/cpu.h | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h
index 2789511..0bc9327 100644
--- a/include/odp/api/spec/cpu.h
+++ b/include/odp/api/spec/cpu.h
@@ -27,6 +27,21 @@ extern "C" {
 
 
 /**
+ * @typedef odp_profiler_t
+ * ODP performance profiler handle
+ */
+
+/**
+ * Setup a performance profiling environment
+ *
+ * A performance profiling environment guarantees meaningful and consistency of
+ * consecutive invocations of the odp_cpu_xxx() APIs.
+ *
+ * @return performance profiler handle
+ */
+odp_profiler_t odp_profiler_start(void);
+
+/**
  * CPU identifier
  *
  * Determine CPU identifier on which the calling is running. CPU numbering is
@@ -170,6 +185,22 @@ uint64_t odp_cpu_cycles_resolution(void);
 void odp_cpu_pause(void);
 
 /**
+ * Stop the performance profiling environment
+ *
+ * Stop performance profiling and restore the execution environment to its
+ * multi-core optimized state, won't preserve meaningful and consistency of
+ * consecutive invocations of the odp_cpu_xxx() APIs anymore.
+ *
+ * @param profiler  performance profiler handle
+ *
+ * @retval 0 on success
+ * @retval <0 on failure
+ *
+ * @see odp_profiler_start()
+ */
+int odp_profiler_stop(odp_profiler_t profiler);
+
+/**
  * @}
  */
 
-- 
1.9.1

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to