Commit 59286da2 authored by Thomas Applencourt's avatar Thomas Applencourt

Cleaned autoconf

parent 73e3089d
Pipeline #12607 canceled with stage
......@@ -74,7 +74,7 @@ clprof.sh: $(top_builddir)/utils/xprof.sh.erb
$(ERB) -T 1 languages=["opencl"] $(top_builddir)/utils/xprof.sh.erb > $@
chmod a+x $@
BUILT_SOURCES = $(OPENCL_PROBES_INCL) babeltrace_cl_callbacks.h clinterval_callbacks.h clprof.c
BUILT_SOURCES = $(OPENCL_PROBES_INCL) babeltrace_cl_callbacks.h
tracer_opencl.c: $(srcdir)/gen_opencl.rb $(srcdir)/opencl_model.rb $(ML_FILES) cl.xml.patched $(srcdir)/tracer_opencl_helpers.include.c $(OPENCL_PROBES_INCL) tracer_opencl.h
SRC_DIR=$(srcdir) $(RUBY) $(srcdir)/gen_opencl.rb > $@
......@@ -110,16 +110,31 @@ install-exec-hook::
ln -s $(libdir)/libTracerOpenCL.so.1.0.0 $(pkglibdir)/opencl/libOpenCL.so.1
ln -s $(pkglibdir)/opencl/libOpenCL.so.1 $(pkglibdir)/opencl/libOpenCL.so
nodist_libCLProf_la_SOURCES = \
CLEANFILES = \
clprof.c \
clinterval_callbacks.cpp \
clinterval_callbacks.h \
clinterval_dispatchers.c \
clinterval.h \
clinterval.c \
xprof_utils.cpp
BUILT_SOURCES += \
clinterval.h \
babeltrace_cl.h \
clinterval_callbacks.h \
xprof_utils.cpp
nodist_libCLProf_la_SOURCES = \
clinterval_callbacks.cpp \
clinterval_callbacks.h \
clinterval_dispatchers.c \
clinterval.c \
clinterval.h \
tracer_opencl.h
libCLProf_la_SOURCES = \
clprof.c \
xprof_utils.cpp
clprof.c
libCLProf_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(srcdir)/include -I./
libCLProf_la_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Werror $(BABELTRACE2_CFLAGS)
......@@ -152,12 +167,13 @@ clinterval_dispatchers.c: $(srcdir)/gen_babeltrace_cl_dispatchers.rb opencl_mode
SRC_DIR=$(srcdir) $(RUBY) $(srcdir)/gen_babeltrace_cl_dispatchers.rb clinterval > clinterval_dispatchers.c
clinterval.h: $(top_srcdir)/xprof/interval.h.erb
$(ERB) namespace="clinterval" $(top_srcdir)/xprof/interval.h.erb > $(srcdir)/clinterval.h
$(ERB) namespace="clinterval" $(top_srcdir)/xprof/interval.h.erb > clinterval.h
clinterval.c: $(top_srcdir)/xprof/interval.c.erb
$(ERB) namespace="clinterval" $(top_srcdir)/xprof/interval.c.erb > $(srcdir)/clinterval.c
$(ERB) namespace="clinterval" $(top_srcdir)/xprof/interval.c.erb > clinterval.c
xprof_utils.cpp: $(top_srcdir)/utils/xprof_utils.cpp
ln -s $(top_srcdir)/utils/xprof_utils.cpp xprof_utils.cpp
nodist_libBabeltraceCL_la_SOURCES = \
babeltrace_cl_dispatchers.c \
......@@ -205,7 +221,7 @@ EXTRA_DIST = \
extract_enqueues \
test_wrapper.sh
CLEANFILES = \
CLEANFILES += \
$(OPENCL_PROBES_INCL) \
$(OPENCL_PROBES_TP) \
$(OPENCL_PROBES_SRC) \
......@@ -215,6 +231,5 @@ CLEANFILES = \
opencl_model.yaml \
babeltrace_cl_dispatchers.c \
babeltrace_cl_callbacks.h \
clinterval_callbacks.cpp \
dust.c \
$(TEST_FILES)
This diff is collapsed.
#pragma once
#include <babeltrace2/babeltrace.h>
#include "uthash.h"
#include "utarray.h"
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
// Dispacher are a light wrapper arrround calbacks to unpack the arguments
// and call the list of callbaks.
struct clinterval_dispatch;
struct clinterval_callbacks;
// Implement by `clinterval_dispatchers.c`
extern void init_clinterval_dispatcher(struct clinterval_dispatch *dispatch);
// `clinterval_dispatcher_t` is a alias to a function we return void and take those list as arguments
// `Dispacher` are a thin wrapper arround `callbacks`. They unpacks llng-parameters and give back ocl object
// It's not clear why dispacher need a `clinterval_dispatch`
typedef void (clinterval_dispatcher_t)
(struct clinterval_dispatch *dispatch,
struct clinterval_callbacks *callbacks,
const bt_event *message,
const bt_clock_snapshot *clock);
struct clinterval_callbacks {
const char *name;
clinterval_dispatcher_t *dispatcher;
UT_array *callbacks;
UT_hash_handle hh;
};
struct clinterval_event_callbacks {
const char *name;
clinterval_dispatcher_t *dispatcher;
UT_array *callbacks;
UT_hash_handle hh;
};
/* A dispach is the Filter component's private data */
struct clinterval_dispatch {
/* Hash table */
struct clinterval_callbacks *callbacks;
/* Hash table by name */
struct clinterval_event_callbacks *event_callbacks;
/* Downstream message */
bt_stream *stream;
bt_event_class *host_event_class;
bt_event_class *device_event_class;
/* Component's input port (weak) */
bt_self_component_port_input *in_port;
};
/* Message iterator's private data */
struct clinterval_message_iterator {
/* (Weak) link to the component's private data */
struct clinterval_dispatch *dispatch;
/* Upstream message iterator (owned by this) */
bt_message_iterator *message_iterator;
/* All the variable need to handle the create of the message */
/* It's a C++ struct */
void * callbacks_state;
};
// To talk to the callbacks
extern void init_clinterval_callbacks(struct clinterval_dispatch*);
extern void* init_clinterval_callbacks_state();
/* Implemented in clinterval_callbacks.cpp.erb */
bool downstream_message_queue_empty(struct clinterval_message_iterator*);
size_t downstream_message_queue_size(struct clinterval_message_iterator*);
const bt_message * downstream_message_queue_pop(struct clinterval_message_iterator*);
// Global state for the downstream message
// If we want to get rid of them, need to update the dispatcher signature
extern struct clinterval_message_iterator *clinterval_iter_g;
extern bt_self_message_iterator *self_message_iterator_g;
// Symbol used by clprof.c
extern
bt_component_class_initialize_method_status clinterval_dispatch_initialize(
bt_self_component_filter *self_component_filter,
bt_self_component_filter_configuration *configuration,
const bt_value *params, void *initialize_method_data);
extern
void clinterval_dispatch_finalize(bt_self_component_filter *self_component_filter);
extern void
clinterval_register_dispatcher(struct clinterval_dispatch *dispatch,
const char *name,
clinterval_dispatcher_t *dispatcher);
extern void
clinterval_register_callback(struct clinterval_dispatch *dispatch,
const char *name,
void *func);
extern
bt_message_iterator_class_next_method_status clinterval_dispatch_message_iterator_next(
bt_self_message_iterator *self_message_iterator,
bt_message_array_const messages, uint64_t capacity,
uint64_t *count);
extern
bt_message_iterator_class_initialize_method_status
clinterval_dispatch_message_iterator_initialize(
bt_self_message_iterator *self_message_iterator,
bt_self_message_iterator_configuration *configuration,
bt_self_component_port_output *self_port);
extern
void clinterval_dispatch_message_iterator_finalize(
bt_self_message_iterator *self_message_iterator);
#ifdef __cplusplus
}
#endif
../utils/xprof_utils.cpp
\ No newline at end of file
......@@ -215,30 +215,45 @@ zeinterval_dispatchers.c: $(srcdir)/gen_babeltrace_ze_dispatchers.rb $(ZE_LIB_GE
zeinterval_callbacks.cpp: $(srcdir)/gen_zeprof.rb $(ZEPROF) babeltrace_ze_callbacks.h $(srcdir)/zeinterval_callbacks.cpp.erb
SRC_DIR=$(srcdir) $(RUBY) $(srcdir)/gen_zeprof.rb
zeinterval_callbacks.h:
zeinterval_callbacks.h: $(srcdir)/gen_babeltrace_ze_callbacks.rb $(ZE_MODEL)
SRC_DIR=$(srcdir) $(RUBY) $(srcdir)/gen_babeltrace_ze_callbacks.rb "zeinterval" > zeinterval_callbacks.h
zeinterval.h: $(srcdir)/interval.h.erb
$(ERB) namespace="zeinterval" $(srcdir)/interval.h.erb > $(srcdir)/zeinterval.h
zeinterval.h: $(top_srcdir)/xprof/interval.h.erb
$(ERB) namespace="zeinterval" $(top_srcdir)/xprof/interval.h.erb > zeinterval.h
zeinterval.c: $(srcdir)/interval.c.erb
$(ERB) namespace="zeinterval" $(srcdir)/interval.c.erb > $(srcdir)/zeinterval.c
zeinterval.c: $(top_srcdir)/xprof/interval.c.erb
$(ERB) namespace="zeinterval" $(top_srcdir)/xprof/interval.c.erb > zeinterval.c
xprof_utils.cpp: $(top_srcdir)/utils/xprof_utils.cpp
ln -s $(top_srcdir)/utils/xprof_utils.cpp xprof_utils.cpp
CLEANFILES += \
zeprof.c \
zeinterval_callbacks.cpp
zeinterval_callbacks.cpp \
zeinterval_callbacks.h \
zeinterval_dispatchers.c \
zeinterval.h \
zeinterval.c \
xprof_utils.cpp
BUILT_SOURCES += \
zeinterval.h \
babeltrace_ze.h \
zeinterval_callbacks.h \
xprof_utils.cpp
# For a strange reason we should not put `xprof_utils.cpp` neither in the `sources`
nodist_libZEProf_la_SOURCES = \
zeprof.h \
zeinterval_callbacks.cpp \
zeinterval_callbacks.h \
zeinterval_dispatchers.c \
zeinterval.h \
zeinterval.c
zeinterval.c \
zeinterval.h \
babeltrace_ze.h
libZEProf_la_SOURCES = \
babeltrace_ze.h \
zeprof.c \
xprof_utils.cpp
zeprof.c
libZEProf_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(srcdir)/include -I./
libZEProf_la_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Werror $(BABELTRACE2_CFLAGS)
......
../xprof/interval.c.erb
\ No newline at end of file
../xprof/interval.h.erb
\ No newline at end of file
../utils/xprof_utils.cpp
\ No newline at end of file
......@@ -19,11 +19,11 @@ typedef std::tuple<uint64_t, uint64_t> timerResolution_kernelTimestampValidBits_
struct zeinterval_callbacks_state {
std::unordered_map<hp_event_t,tfn_ts_t> event_to_function_name_and_ts;
std::unordered_map<hpt_function_name_t, ze_device_handle_t> function_name_to_device;
std::unordered_map<hp_command_list_t, dsd_t> command_list_to_device;
std::unordered_map<hp_device_t, timerResolution_kernelTimestampValidBits_t> device_to_timerResolution_kernelTimestampValidBits;
std::unordered_map<hpt_function_name_t, ze_device_handle_t> function_name_to_device;
std::unordered_map<hp_command_list_t, dsd_t> command_list_to_device;
std::unordered_map<hp_device_t, timerResolution_kernelTimestampValidBits_t> device_to_timerResolution_kernelTimestampValidBits;
std::unordered_map<hpt_t, thapi_function_name> last_kernel;
std::unordered_map<hpt_t, thapi_function_name> last_kernel;
std::unordered_map<hp_event_t, sd_t> event_result_to_start_and_delta;
std::unordered_map<hp_device_t, int64_t> device_ts_to_llng_ts;
......@@ -37,7 +37,7 @@ struct zeinterval_callbacks_state {
std::unordered_map<hpt_t, fn_ts_t> profiled_function_name_and_ts;
std::unordered_map<hpt_function_name_t, dsd_t> function_name_to_dsd;
std::queue<const bt_message*> downstream_message_queue;
std::queue<const bt_message*> downstream_message_queue;
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment