Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build:
- source /home/hicr/.hicr-env.sh
- echo "Building TraCR..."
- mkdir build
- meson setup build -DbuildExamples=true -DcompileWarningsAsErrors=true -Dbuildtype=debug -Db_coverage=true
- meson setup build -DbuildPyTraCR=true -DbuildTests=true -DbuildExamples=true -DcompileWarningsAsErrors=true -Dbuildtype=debug -Db_coverage=true
- meson compile -C build
- echo "Running tests..."
- meson test -C build
Expand Down
1 change: 0 additions & 1 deletion examples/.gitignore

This file was deleted.

4 changes: 2 additions & 2 deletions examples/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ foreach args : cpp_args_list
if get_option('buildPyTraCR') and instrumentation_enabled and (test_type != 'pthread_example')

test_name = 'pyTraCR_' + test_name
workdir = meson.current_source_dir() + '/' + test_name + '_out/'
workdir = meson.project_build_root() + '/examples/' + test_name + '_out/'

# Create the output directory before tests
create_dirs = custom_target('create_pytracr_dirs' + test_name,
Expand All @@ -61,7 +61,7 @@ foreach args : cpp_args_list

test(test_name,
py,
args: ['../pytracr/' + test_type + '.py'],
args: [meson.current_source_dir() + '/pytracr/' + test_type + '.py'],
env: ['PYTHONPATH=' + meson.project_build_root() + '/include/pytracr/'],
suite: testSuite,
workdir: workdir,
Expand Down
4 changes: 4 additions & 0 deletions examples/pthread_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ void *threadFunction(void *arg) {

INSTRUMENTATION_THREAD_MARK_SET(thrd_finished_id);

// Optional: This marker pushes the int64_t max value. Can be used to indicate
// the ending.
INSTRUMENTATION_VMARKER_RESET();

// TraCR free thread
INSTRUMENTATION_THREAD_END();

Expand Down
3 changes: 3 additions & 0 deletions include/pytracr/pytracr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ static void instrumentation_vmarker_set(size_t value) {
INSTRUMENTATION_VMARKER_SET(value);
}

static void instrumentation_vmarker_reset() { INSTRUMENTATION_VMARKER_RESET(); }

static void instrumentation_vmarker_push(size_t value) {
INSTRUMENTATION_VMARKER_PUSH(value);
}
Expand Down Expand Up @@ -122,6 +124,7 @@ PYBIND11_MODULE(tracr, m) {
m.def("INSTRUMENTATION_VMARKER_TYPE", &instrumentation_vmarker_type, "");
m.def("INSTRUMENTATION_VMARKER_LABEL", &instrumentation_vmarker_label, "");
m.def("INSTRUMENTATION_VMARKER_SET", &instrumentation_vmarker_set, "");
m.def("INSTRUMENTATION_VMARKER_RESET", &instrumentation_vmarker_reset, "");
m.def("INSTRUMENTATION_VMARKER_PUSH", &instrumentation_vmarker_push, "");
m.def("INSTRUMENTATION_VMARKER_POP", &instrumentation_vmarker_pop, "");

Expand Down
8 changes: 7 additions & 1 deletion src/tracr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ extern ThreadMarkerMap thread_marker_map;
thread_marker_map.pop(idx);

/**
* ovni marker methods (vanilla) (only used for performance comparisons)
* ovni marker methods (vanilla)
*/
#define INSTRUMENTATION_VMARKER_TYPE(flag, title) ovni_mark_type(0, flag, title)

Expand All @@ -163,6 +163,10 @@ extern ThreadMarkerMap thread_marker_map;
debug_print("instr_marker_set (TID: %d)", get_tid()); \
ovni_mark_set(0, value)

#define INSTRUMENTATION_VMARKER_RESET() \
debug_print("instr_marker_reset (TID: %d)", get_tid()); \
ovni_mark_set(0, INT64_MAX)

#define INSTRUMENTATION_VMARKER_PUSH(value) \
debug_print("instr_marker_push (TID: %d)", get_tid()); \
ovni_mark_push(0, value)
Expand Down Expand Up @@ -218,6 +222,8 @@ extern ThreadMarkerMap thread_marker_map;

#define INSTRUMENTATION_VMARKER_SET(value) (void)(value)

#define INSTRUMENTATION_VMARKER_RESET()

#define INSTRUMENTATION_VMARKER_PUSH(value) (void)(value)

#define INSTRUMENTATION_VMARKER_POP(value) (void)(value)
Expand Down