diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92048b29..9bcd0542 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,6 +85,7 @@ jobs: if: matrix.os == 'ubuntu-22.04' && matrix.perm == 'root' && matrix.dir == 'github' run: | export DLIO_PROFILER_ENABLE=1 + export DLIO_PROFILER_LOG_LEVEL=ERROR dlio_benchmark workload=unet3d ++workload.output.folder=$PWD/output ++workload.train.computation_time=0.05 ++workload.evaluation.eval_time=0.01 ++workload.train.epochs=2 ++workload.workflow.train=True ++workload.workflow.generate_data=True ++workload.dataset.num_files_train=16 ++workload.dataset.num_files_eval=16 ++workload.reader.read_threads=2 ++workload.dataset.record_length=4096 ++workload.dataset.record_length_stdev=0 \ ++workload.framework=tensorflow ++workload.reader.data_loader=tensorflow ++workload.dataset.format=npz ls -a $PWD/output diff --git a/include/dlio_profiler/core/dlio_profiler_main.h b/include/dlio_profiler/core/dlio_profiler_main.h index f60179ad..1a0dc173 100644 --- a/include/dlio_profiler/core/dlio_profiler_main.h +++ b/include/dlio_profiler/core/dlio_profiler_main.h @@ -20,7 +20,7 @@ #include #include "typedef.h" -static void handler(int sig) { +static void handler(int sig) { // GCOVR_EXCL_START void *array[10]; size_t size; @@ -31,7 +31,7 @@ static void handler(int sig) { fprintf(stderr, "Error: signal %d:\n", sig); backtrace_symbols_fd(array, size, STDERR_FILENO); exit(1); -} +} // GCOVR_EXCL_STOP namespace dlio_profiler { class DLIOProfilerCore { diff --git a/src/dlio_profiler/brahma/posix.h b/src/dlio_profiler/brahma/posix.h index a4db903b..21cbab42 100644 --- a/src/dlio_profiler/brahma/posix.h +++ b/src/dlio_profiler/brahma/posix.h @@ -57,7 +57,7 @@ class POSIXDLIOProfiler : public POSIX { (void) data; ignore_filename.push_back(resolved_path); } - ~POSIXDLIOProfiler() override = default; + ~POSIXDLIOProfiler() override = default; // GCOVR_EXCL_LINE static std::shared_ptr get_instance() { if (instance == nullptr) { instance = std::make_shared(); diff --git a/src/dlio_profiler/core/dlio_profiler_main.cpp b/src/dlio_profiler/core/dlio_profiler_main.cpp index 7b5735d9..6c46e14c 100644 --- a/src/dlio_profiler/core/dlio_profiler_main.cpp +++ b/src/dlio_profiler/core/dlio_profiler_main.cpp @@ -37,10 +37,10 @@ dlio_profiler::DLIOProfilerCore::DLIOProfilerCore(ProfilerStage stage, ProfileTy } break; } - default: { + default: { // GCOVR_EXCL_START DLIO_PROFILER_LOGERROR(UNKNOWN_PROFILER_TYPE.message, type); throw std::runtime_error(UNKNOWN_PROFILER_TYPE.code); - } + } // GCOVR_EXCL_STOP } } @@ -73,7 +73,7 @@ dlio_profiler::DLIOProfilerCore::initlialize(bool is_init, bool _bind, const cha bind_signals(); if (is_init) { char *dlio_profiler_log_level = getenv(DLIO_PROFILER_LOG_LEVEL); - if (dlio_profiler_log_level == nullptr) { + if (dlio_profiler_log_level == nullptr) { // GCOV_EXCL_START logger_level = cpplogger::LoggerType::LOG_ERROR; } else { if (strcmp(dlio_profiler_log_level, "ERROR") == 0) { @@ -83,7 +83,7 @@ dlio_profiler::DLIOProfilerCore::initlialize(bool is_init, bool _bind, const cha } else if (strcmp(dlio_profiler_log_level, "DEBUG") == 0) { logger_level = cpplogger::LoggerType::LOG_WARN; } - } + } // GCOV_EXCL_STOP DLIO_PROFILER_LOGGER->level = logger_level; DLIO_PROFILER_LOGINFO("Enabling logging level %d", logger_level); @@ -95,7 +95,7 @@ dlio_profiler::DLIOProfilerCore::initlialize(bool is_init, bool _bind, const cha DLIO_PROFILER_LOGINFO("DLIO Profiler enabled", ""); char *dlio_profiler_priority_str = getenv(DLIO_PROFILER_GOTCHA_PRIORITY); if (dlio_profiler_priority_str != nullptr) { - gotcha_priority = atoi(dlio_profiler_priority_str); + gotcha_priority = atoi(dlio_profiler_priority_str); // GCOV_EXCL_LINE } if (_process_id == nullptr || *_process_id == -1) { this->process_id = getpid(); @@ -107,10 +107,10 @@ dlio_profiler::DLIOProfilerCore::initlialize(bool is_init, bool _bind, const cha char *dlio_profiler_log = getenv(DLIO_PROFILER_LOG_FILE); if (dlio_profiler_log != nullptr) { this->log_file = std::string(dlio_profiler_log) + "-" + std::to_string(this->process_id) + ".pfw"; - } else { + } else { // GCOV_EXCL_START DLIO_PROFILER_LOGERROR(UNDEFINED_LOG_FILE.message, ""); throw std::runtime_error(UNDEFINED_LOG_FILE.code); - } + } // GCOV_EXCL_STOP } else { this->log_file = _log_file; } @@ -119,10 +119,10 @@ dlio_profiler::DLIOProfilerCore::initlialize(bool is_init, bool _bind, const cha char *dlio_profiler_data_dirs = getenv(DLIO_PROFILER_DATA_DIR); if (dlio_profiler_data_dirs != nullptr) { this->data_dirs = dlio_profiler_data_dirs; - } else { + } else { // GCOV_EXCL_START DLIO_PROFILER_LOGERROR(UNDEFINED_DATA_DIR.message, ""); throw std::runtime_error(UNDEFINED_DATA_DIR.code); - } + } // GCOV_EXCL_STOP } else { this->data_dirs = _data_dirs; } diff --git a/src/dlio_profiler/dlio_logger.h b/src/dlio_profiler/dlio_logger.h index 9e6cf202..6c2bbc00 100644 --- a/src/dlio_profiler/dlio_logger.h +++ b/src/dlio_profiler/dlio_logger.h @@ -31,7 +31,7 @@ class DLIOLogger { } char *dlio_profiler_error = getenv("DLIO_PROFILER_ERROR"); if (dlio_profiler_error != nullptr && strcmp(dlio_profiler_error, "1") == 0) { - throw_error = true; + throw_error = true; // GCOVR_EXCL_LINE } this->is_init=true; int fd = -1; @@ -42,7 +42,7 @@ class DLIOLogger { fd = fileno(stderr); log_file = "STDERR"; } else { - if (strcmp(dlio_profiler_log_dir, "STDERR") == 0) { + if (strcmp(dlio_profiler_log_dir, "STDERR") == 0) { // GCOV_EXCL_START fd = fileno(stderr); log_file = "STDERR"; } else if (strcmp(dlio_profiler_log_dir, "STDOUT") == 0) { @@ -51,7 +51,7 @@ class DLIOLogger { } else { int pid = getpid(); log_file = std::string(dlio_profiler_log_dir) + "/" + "trace_ll_" + std::to_string(pid) + ".pfw"; - } + } // GCOV_EXCL_STOP } } update_log_file(log_file); diff --git a/src/dlio_profiler/utils/posix_internal.cpp b/src/dlio_profiler/utils/posix_internal.cpp index d3bf0906..e2fc3079 100644 --- a/src/dlio_profiler/utils/posix_internal.cpp +++ b/src/dlio_profiler/utils/posix_internal.cpp @@ -25,24 +25,24 @@ int dlp_open(const char *pathname, int flags, ...) { if (result >= 0) return (int) result; - return -1; + return -1; // GCOV_EXCL_LINE } ssize_t dlp_write(int fd, const void *buf, size_t count) { return syscall(SYS_write, fd, buf, count); } -ssize_t dlp_read(int fd, void *buf, size_t count) { +ssize_t dlp_read(int fd, void *buf, size_t count) { // GCOV_EXCL_START return syscall(SYS_read, fd, buf, count); -} +} // GCOV_EXCL_STOP int dlp_close(int fd) { return syscall(SYS_close, fd); } -int dlp_fsync(int fd) { +int dlp_fsync(int fd) { // GCOV_EXCL_START return syscall(SYS_fsync, fd); -} +} // GCOV_EXCL_STOP ssize_t dlp_readlink(const char *path, char *buf, size_t bufsize) { return syscall(SYS_readlink, path, buf, bufsize);