diff --git a/configure.ac b/configure.ac index c086b58f..e7d5c542 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([thapi], [0.0.10], [bvideau@anl.gov]) +AC_INIT([thapi], [0.0.11], [bvideau@anl.gov]) AC_CONFIG_SRCDIR([opencl/tracer_opencl_helpers.include.c]) AC_CONFIG_HEADERS([utils/config.h]) @@ -70,7 +70,7 @@ PKG_CHECK_MODULES([PROTOBUF], [protobuf >= 3.0]) AX_RUBY_EXTENSION([cast-to-yaml], [yes]) AX_RUBY_EXTENSION([nokogiri], [yes]) AX_RUBY_EXTENSION([babeltrace2], [yes]) -AX_RUBY_EXTENSION([metababel >= 0.0.5], [yes]) +AX_RUBY_EXTENSION([metababel >= 1.0.0], [yes]) # Checks for header files. AC_CHECK_HEADERS([inttypes.h stddef.h stdint.h stdlib.h string.h unistd.h]) diff --git a/xprof/btx_aggreg.cpp b/xprof/btx_aggreg.cpp index d340f340..5100f611 100644 --- a/xprof/btx_aggreg.cpp +++ b/xprof/btx_aggreg.cpp @@ -17,11 +17,16 @@ struct aggreg_s { }; using aggreg_t = struct aggreg_s; -static void initialize_usr_data_callback(void *btx_handle, void **usr_data) { +static void initialize_component_callback(void **usr_data) { *usr_data = new aggreg_t; } -static void finalize_usr_data_callback(void *btx_handle, void *usr_data) { +static void finalize_component_callback(void *usr_data) { + auto *data = static_cast(usr_data); + delete data; +} + +static void finalize_processing_callback(void *btx_handle, void *usr_data) { auto *data = static_cast(usr_data); // Host for (const auto &[hptb_function_name, t] : data->host) { @@ -42,8 +47,6 @@ static void finalize_usr_data_callback(void *btx_handle, void *usr_data) { btx_push_message_aggreg_device(btx_handle, hostname.c_str(), vpid, vtid, name.c_str(), t.min, t.max, t.duration, t.count, did, sdid, metadata.c_str()); } - - delete data; } static void host_usr_callback(void *btx_handle, void *usr_data, const char *hostname, int64_t vpid, @@ -71,9 +74,9 @@ static void device_usr_callback(void *btx_handle, void *usr_data, const char *ho } void btx_register_usr_callbacks(void *btx_handle) { - - btx_register_callbacks_initialize_usr_data(btx_handle, &initialize_usr_data_callback); - btx_register_callbacks_finalize_usr_data(btx_handle, &finalize_usr_data_callback); + btx_register_callbacks_initialize_component(btx_handle, &initialize_component_callback); + btx_register_callbacks_finalize_processing(btx_handle, &finalize_processing_callback); + btx_register_callbacks_finalize_component(btx_handle, &finalize_component_callback); btx_register_callbacks_lttng_host(btx_handle, &host_usr_callback); btx_register_callbacks_lttng_traffic(btx_handle, &traffic_usr_callback); diff --git a/xprof/btx_tally.cpp b/xprof/btx_tally.cpp index 940f7cb8..eb9f27d6 100644 --- a/xprof/btx_tally.cpp +++ b/xprof/btx_tally.cpp @@ -173,7 +173,7 @@ static void print_metadata(std::vector metadata) { std::cout << value << std::endl; } -static void initialize_usr_data_callback(void *btx_handle, void **usr_data) { +static void initialize_component_callback(void **usr_data) { /* User allocates its own data structure */ auto *data = new tally_dispatch_t; *usr_data = data; @@ -190,7 +190,7 @@ static void initialize_usr_data_callback(void *btx_handle, void **usr_data) { }; } -static void read_params_callaback(void *btx_handle, void *usr_data, btx_params_t *usr_params) { +static void read_params_callback(void *usr_data, btx_params_t *usr_params) { auto *data = static_cast(usr_data); data->params = usr_params; @@ -209,7 +209,7 @@ static void read_params_callaback(void *btx_handle, void *usr_data, btx_params_t } } -static void finalize_usr_data_callback(void *btx_handle, void *usr_data) { +static void finalize_component_callback(void *usr_data) { auto *data = static_cast(usr_data); @@ -345,9 +345,9 @@ static void ust_thapi_metadata_usr_callback(void *btx_handle, void *usr_data, co } void btx_register_usr_callbacks(void *btx_handle) { - btx_register_callbacks_initialize_usr_data(btx_handle, &initialize_usr_data_callback); - btx_register_callbacks_read_params(btx_handle, &read_params_callaback); - btx_register_callbacks_finalize_usr_data(btx_handle, &finalize_usr_data_callback); + btx_register_callbacks_initialize_component(btx_handle, &initialize_component_callback); + btx_register_callbacks_read_params(btx_handle, &read_params_callback); + btx_register_callbacks_finalize_component(btx_handle, &finalize_component_callback); btx_register_callbacks_lttng_device_name(btx_handle, &device_name_usr_callback); btx_register_callbacks_lttng_ust_thapi_metadata(btx_handle, &ust_thapi_metadata_usr_callback); diff --git a/xprof/btx_timeline.cpp b/xprof/btx_timeline.cpp index 0c9f3d0d..278a4060 100644 --- a/xprof/btx_timeline.cpp +++ b/xprof/btx_timeline.cpp @@ -297,12 +297,11 @@ static void add_event_async(timeline_dispatch_t *dispatch, std::string hostname, add_event_end(dispatch, track_uuid, end); } -void btx_initialize_usr_data(void *btx_handle, void **usr_data) { - +void btx_initialize_component_callback(void **usr_data) { *usr_data = new timeline_dispatch_t; } -void btx_finalize_usr_data(void *btx_handle, void *usr_data) { +void btx_finalize_component_callback(void *usr_data) { auto *dispatch = static_cast(usr_data); for (auto &[uuid, s] : dispatch->uuid2stack) { while (!s.empty()) { @@ -357,6 +356,6 @@ void btx_register_usr_callbacks(void *btx_handle) { btx_register_callbacks_lttng_device(btx_handle, &device_usr_callback); btx_register_callbacks_lttng_frequency(btx_handle, &frequency_usr_callback); btx_register_callbacks_lttng_power(btx_handle, &power_usr_callback); - btx_register_callbacks_initialize_usr_data(btx_handle, &btx_initialize_usr_data); - btx_register_callbacks_finalize_usr_data(btx_handle, &btx_finalize_usr_data); + btx_register_callbacks_initialize_component(btx_handle, &btx_initialize_component_callback); + btx_register_callbacks_finalize_component(btx_handle, &btx_finalize_component_callback); }