cjolivier01 commented on a change in pull request #8972: Profiling enhancements, python API, vtune and chrome tracing objects, etc. URL: https://github.com/apache/incubator-mxnet/pull/8972#discussion_r162143286
########## File path: include/mxnet/c_api.h ########## @@ -227,10 +228,131 @@ MXNET_DLL int MXSetProfilerConfig(int mode, const char* filename); */ MXNET_DLL int MXSetProfilerState(int state); -/*! \brief Save profile and stop profiler */ +/*! + * \brief Save profile and stop profiler + * \param append true if appending to current profile file, false for truncate + * \return + */ MXNET_DLL int MXDumpProfile(); -/*! \brief Set the number of OMP threads to use */ +/*! + * \brief Set whether to continuously write the profiling data to a file + * \param continuous_dump true to continuously write profiling data to a file + * \param delay_in_seconds Number of seconds (or fraction of seconds) to delay between writes + * \return 0 when success, -1 when failure happens. + */ +MXNET_DLL int MXSetContinuousProfileDump(int continuous_dump, float delay_in_seconds); + +/*! + * \brief Pause profiler tuning collection + * \param paused If nonzero, profiling pauses. Otherwise, profiling resumes/continues + * \return 0 when success, -1 when failure happens. + * \note pausing and resuming is global and not recursive + */ +MXNET_DLL int MXProfilePause(int paused); + +/*! + * \brief Create profiling domain + * \param domain String representing the domain name to create + * \param out Return domain object + * \return 0 when success, -1 when failure happens. + */ +MXNET_DLL int MXProfileCreateDomain(const char *domain, ProfileHandle *out); + +/*! + * \brief Create profile task + * \param name Name of the task + * \param domain Domain of the task + * \param out Output handle + * \return 0 when success, -1 when failure happens. + */ +MXNET_DLL int MXProfileCreateTask(ProfileHandle domain, + const char *task_name, + ProfileHandle *out); + +/*! + * \brief Create profile frame + * \param name Name of the frame + * \param domain Domain of the frame + * \param out Output handle + * \return 0 when success, -1 when failure happens. + */ +MXNET_DLL int MXProfileCreateFrame(ProfileHandle domain, + const char *frame_name, + ProfileHandle *out); + +/*! + * \brief Create profile event + * \param name Name of the event + * \param out Output handle + * \return 0 when success, -1 when failure happens. + */ +MXNET_DLL int MXProfileCreateEvent(const char *event_name, ProfileHandle *out); + +/*! + * \brief Create profile counter + * \param name Name of the counter + * \param domain Domain of the counter + * \param out Output handle + * \return 0 when success, -1 when failure happens. + */ +MXNET_DLL int MXProfileCreateCounter(ProfileHandle domain, + const char *counter_name, + ProfileHandle *out); + +/*! + * \brief Destroy a frame + * \param frame_handle Handle to frame to destroy + * \return 0 when success, -1 when failure happens. + */ +MXNET_DLL int MXProfileDestroyHandle(ProfileHandle frame_handle); + +/*! + * \brief Start timing the duration of a profile duration object such as an event, task or frame + * \param duration_handle handle to the duration object + * \return 0 when success, -1 when failure happens. + */ +MXNET_DLL int MXProfileDurationStart(ProfileHandle duration_handle); + +/*! + * \brief Stoptiming the duration of a profile duration object such as an event, task or frame + * \param duration_handle handle to the duration object + * \return 0 when success, -1 when failure happens. + */ +MXNET_DLL int MXProfileDurationStop(ProfileHandle duration_handle); + +/*! + * \brief Set a counter, given its handle + * \param counter_handle Handle to counter to set + * \param value Value to set the counter to (64-bit unsigned integer) + * \return 0 when success, -1 when failure happens. + */ +MXNET_DLL int MXProfileSetCounter(ProfileHandle counter_handle, uint64_t value); + +/*! + * \brief Adjust a counter by the given amount, given its handle + * \param counter_handle Handle to counter to adjust + * \param value Value to adjust the counter by (64-bit signed integer) + * \return 0 when success, -1 when failure happens. + */ +MXNET_DLL int MXProfileAdjustCounter(ProfileHandle counter_handle, int64_t value); + +/*! + * \brief Mark a single instant in time + * \param domain Domain of the marker + * \param instant_marker_name Name of the marker + * \param scope Scope of marker ('global', 'process', 'thread', 'task', 'marker') + * \return 0 when success, -1 when failure happens. + */ +MXNET_DLL int MXProfileSetInstantMarker(ProfileHandle domain, Review comment: done ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services