1919 #define DTRACE_EXPORT __attribute__ ((visibility(" default" )))
2020#endif
2121
22- #ifdef __cplusplus
23- extern " C" {
24- #endif
25-
26- // ---------------------------dtrace c---------------------------
2722/* !
2823 * handle to a dynamic tracing context.
2924 * Each handle represents an independent dynamic tracing instance for a command.
3025 */
31- typedef void * dtrace_handle_t ; // NOLINT
32-
33- /* !
34- * @struct dtrace_config_t
35- *
36- * @brief Configuration for creating a dtrace handle.
37- *
38- * @details
39- * This structure contains configuration parameters for dtrace operation.
40- */
41- typedef struct { // NOLINT
42- const char * script_file; // Script file containing the probe and action details
43- const char * map_data; // Map data containing details of control code
44- uint32_t log_level; // Log level for debugging (default: dtrace_error)
45- uint32_t output_fmt; // Output format for result file (default: python)
46- } dtrace_config_t ;
26+ using dtrace_handle_t = void *; // NOLINT
4727
4828/* !
4929 * create_dtrace_handle() - Creates a handle to the dynamic tracing context.
5030 *
51- * @config: Configuration structure containing dtrace parameters.
31+ * @script_file: Path to script file containing probe and action details.
32+ * @map_data: Map JSON string with details of control code.
33+ * @log_level: Log level for debugging.
34+ * @output_fmt: Output format for result file.
5235 *
5336 * @return Opaque raw handle to the dynamic tracing context owned by the caller, or NULL on failure.
5437 * @note The caller must release this handle by calling destroy_dtrace_handle().
5538 */
5639DTRACE_EXPORT
5740dtrace_handle_t
58- create_dtrace_handle (const dtrace_config_t * config);
41+ create_dtrace_handle (const std::string& script_file, const std::string& map_data, uint32_t log_level,
42+ uint32_t output_fmt);
5943
6044/* !
6145 * get_dtrace_col_numbers() - Retrieves the buffer sizes required for dynamic tracing.
@@ -110,8 +94,8 @@ populate_dtrace_buffer(dtrace_handle_t dtrace_handle, uint32_t* dtrace_buffer,
11094 * and writes the output to the specified result file.
11195 */
11296DTRACE_EXPORT
113- void
114- get_dtrace_result_file (dtrace_handle_t dtrace_handle, const char * result_file);
97+ void
98+ get_dtrace_result_file (dtrace_handle_t dtrace_handle, const std::string& result_file);
11599
116100/* !
117101* destroy_dtrace_handle() - Destroys a dynamic tracing context.
@@ -125,8 +109,4 @@ DTRACE_EXPORT
125109void
126110destroy_dtrace_handle (dtrace_handle_t dtrace_handle);
127111
128- #ifdef __cplusplus
129- }
130- #endif
131-
132112#endif // TRACE_H
0 commit comments