OmniSciDB
a5dc49c757
|
Namespaces | |
anonymous_namespace{Logger.cpp} | |
Classes | |
class | Collector |
struct | DebugTimerParams |
class | Duration |
class | DurationTree |
struct | GetDepth |
class | JsonEncoder |
struct | EraseDurationTrees |
Depth-first search and erase all DurationTrees. Not thread-safe. More... | |
struct | ThreadLocalIds |
class | LocalIdsScopeGuard |
class | LogOptions |
struct | LogShutdown |
class | Logger |
class | DebugTimer |
Typedefs | |
using | ChannelLogger = boost::log::sources::channel_logger_mt< Channel > |
using | SeverityLogger = boost::log::sources::severity_logger_mt< Severity > |
using | ClogSync = sinks::synchronous_sink< sinks::text_ostream_backend > |
using | FileSync = sinks::synchronous_sink< sinks::text_file_backend > |
using | Clock = std::chrono::steady_clock |
using | DurationTreeNode = boost::variant< Duration, DurationTree & > |
using | DurationTreeNodes = std::deque< DurationTreeNode > |
using | DurationTreeMap = std::unordered_map< ThreadId, std::unique_ptr< DurationTree >> |
using | RequestId = uint64_t |
using | ThreadId = uint64_t |
using | Channels = std::set< Channel > |
using | FatalFunc = void(*)() noexcept |
Enumerations | |
enum | Channel { IR = 0, PTX, ASM, EXECUTOR, _NCHANNELS } |
enum | Severity { DEBUG4 = 0, DEBUG3, DEBUG2, DEBUG1, INFO, WARNING, ERROR, FATAL, _NSEVERITIES } |
Functions | |
BOOST_LOG_GLOBAL_LOGGER_CTOR_ARGS (gChannelLogger_IR, ChannelLogger,(keywords::channel=IR)) BOOST_LOG_GLOBAL_LOGGER_CTOR_ARGS(gChannelLogger_PTX | |
boost::log::formatting_ostream & | operator<< (boost::log::formatting_ostream &strm, boost::log::to_log_manip< Channel, tag::channel > const &manip) |
boost::log::formatting_ostream & | operator<< (boost::log::formatting_ostream &strm, boost::log::to_log_manip< Severity, tag::severity > const &manip) |
template<typename TAG , typename SINK > | |
void | set_formatter (SINK &sink) |
template<typename FILE_SINK , typename TAG > | |
boost::shared_ptr< FILE_SINK > | make_sink (boost::shared_ptr< Collector > &collector, LogOptions const &log_opts, fs::path const &full_log_dir, TAG const tag) |
template<typename CONSOLE_SINK > | |
boost::shared_ptr< CONSOLE_SINK > | make_sink (LogOptions const &log_opts) |
void | init (LogOptions const &log_opts) |
void | set_once_fatal_func (FatalFunc fatal_func) |
void | shutdown () |
std::istream & | operator>> (std::istream &in, Channels &channels) |
std::ostream & | operator<< (std::ostream &out, Channels const &channels) |
std::istream & | operator>> (std::istream &in, Severity &sev) |
std::ostream & | operator<< (std::ostream &out, Severity const &sev) |
Duration * | newDuration (DebugTimerParams const debug_timer_params) |
std::ostream & | operator<< (std::ostream &os, Duration const &duration) |
std::ostream & | operator<< (std::ostream &os, DurationTree const &duration_tree) |
boost::log::record_ostream & | operator<< (boost::log::record_ostream &os, DurationTreeMap::const_reference kv_pair) |
void | logAndEraseDurationTree (std::string *json_str) |
void | debug_timer_new_thread (ThreadId const parent_thread_id) |
RequestId | request_id () |
ThreadId | thread_id () |
ThreadLocalIds | thread_local_ids () |
RequestId | set_new_request_id () |
void | set_request_id (RequestId const request_id) |
fs::path | get_log_dir_path () |
bool | fast_logging_check (Channel) |
bool | fast_logging_check (Severity severity) |
template<typename X , typename Y > | |
BOOST_NOINLINE std::string * | check_failed (X const &x, Y const &y, char const *xstr, char const *ystr, char const *op_str) |
Variables | |
std::atomic< FatalFunc > | g_fatal_func {nullptr} |
std::once_flag | g_fatal_func_flag |
bool | g_any_active_channels {false} |
Severity | g_min_active_severity {Severity::FATAL} |
static fs::path | g_log_dir_path |
std::mutex | g_duration_tree_map_mutex |
DurationTreeMap | g_duration_tree_map |
constexpr std::array< char const *, 4 > | ChannelNames {"IR", "PTX", "ASM", "EXECUTOR"} |
constexpr std::array< char, 4 > | ChannelSymbols {'R', 'P', 'A', 'X'} |
constexpr std::array< char const *, 8 > | SeverityNames |
constexpr std::array< char, 8 > | SeveritySymbols {'4', '3', '2', '1', 'I', 'W', 'E', 'F'} |
Definition at line 53 of file Logger.cpp.
using logger::Channels = typedef std::set<Channel> |
using logger::Clock = typedef std::chrono::steady_clock |
Definition at line 561 of file Logger.cpp.
using logger::ClogSync = typedef sinks::synchronous_sink<sinks::text_ostream_backend> |
Definition at line 344 of file Logger.cpp.
using logger::DurationTreeMap = typedef std::unordered_map<ThreadId, std::unique_ptr<DurationTree>> |
Definition at line 654 of file Logger.cpp.
using logger::DurationTreeNode = typedef boost::variant<Duration, DurationTree&> |
Definition at line 598 of file Logger.cpp.
using logger::DurationTreeNodes = typedef std::deque<DurationTreeNode> |
Definition at line 599 of file Logger.cpp.
using logger::FatalFunc = typedef void (*)() noexcept |
using logger::FileSync = typedef sinks::synchronous_sink<sinks::text_file_backend> |
Definition at line 345 of file Logger.cpp.
using logger::RequestId = typedef uint64_t |
typedef boost::log::sources::severity_logger_mt< Severity > logger::SeverityLogger |
Definition at line 59 of file Logger.cpp.
using logger::ThreadId = typedef uint64_t |
enum logger::Channel |
Enumerator | |
---|---|
IR | |
PTX | |
ASM | |
EXECUTOR | |
_NCHANNELS |
Definition at line 91 of file Logger.h.
enum logger::Severity |
Enumerator | |
---|---|
DEBUG4 | |
DEBUG3 | |
DEBUG2 | |
DEBUG1 | |
INFO | |
WARNING | |
ERROR | |
FATAL | |
_NSEVERITIES |
Definition at line 103 of file Logger.h.
logger::BOOST_LOG_GLOBAL_LOGGER_CTOR_ARGS | ( | gChannelLogger_IR | , |
ChannelLogger | , | ||
(keywords::channel=IR) | |||
) |
BOOST_NOINLINE std::string* logger::check_failed | ( | X const & | x, |
Y const & | y, | ||
char const * | xstr, | ||
char const * | ystr, | ||
char const * | op_str | ||
) |
Definition at line 309 of file Logger.h.
References getCurrentStackTrace().
void logger::debug_timer_new_thread | ( | ThreadId const | parent_thread_id | ) |
Call this when a new thread is spawned that will have timers that need to be associated with timers on the parent thread. Required: g_thread_local_ids.thread_id_ is not yet in g_duration_tree_map.
Definition at line 863 of file Logger.cpp.
References CHECK, g_duration_tree_map, g_duration_tree_map_mutex, logger::anonymous_namespace{Logger.cpp}::g_thread_local_ids(), and logger::ThreadLocalIds::thread_id_.
|
inline |
Definition at line 265 of file Logger.h.
References g_any_active_channels.
Referenced by anonymous_namespace{RelAlgOptimizer.cpp}::cleanup_dead_nodes(), fold_filters(), query_state::StdLog::log(), and query_state::StdLog::logCallStack().
|
inline |
boost::filesystem::path logger::get_log_dir_path | ( | ) |
Definition at line 906 of file Logger.cpp.
References g_log_dir_path.
Referenced by Catalog_Namespace::Catalog::initializeSystemServers().
void logger::init | ( | LogOptions const & | log_opts | ) |
Definition at line 364 of file Logger.cpp.
References _NSEVERITIES, logger::LogOptions::channels_, logger::LogOptions::full_log_dir(), g_any_active_channels, g_log_dir_path, g_min_active_severity, INFO, nvtx_helpers::init(), LOG, logger::LogOptions::max_files_, logger::LogOptions::severity_, and logger::LogOptions::severity_clog_.
Referenced by UdfCompiler::compileFromCommandLine(), UdfCompiler::generateAST(), QueryRunner::QueryRunner::init(), CommandLineOptions::init_logging(), main(), ColumnarResults::mergeResults(), ResultSetManager::reduce(), Executor::reduceMultiDeviceResultSets(), FixedLengthEncoder< T, V >::updateStatsEncoded(), and NoneEncoder< T >::updateStatsEncoded().
void logger::logAndEraseDurationTree | ( | std::string * | json_str | ) |
Definition at line 813 of file Logger.cpp.
References CHECK, g_duration_tree_map, g_duration_tree_map_mutex, logger::anonymous_namespace{Logger.cpp}::g_thread_local_ids(), logger::JsonEncoder::str(), and logger::ThreadLocalIds::thread_id_.
Referenced by logger::DebugTimer::stop(), and logger::DebugTimer::stopAndGetJson().
boost::shared_ptr<FILE_SINK> logger::make_sink | ( | boost::shared_ptr< Collector > & | collector, |
LogOptions const & | log_opts, | ||
fs::path const & | full_log_dir, | ||
TAG const | tag | ||
) |
Definition at line 308 of file Logger.cpp.
References logger::LogOptions::auto_flush_, logger::LogOptions::file_name_pattern_, INFO, logger::LogOptions::rotate_daily_, logger::LogOptions::rotation_size_, logger::LogOptions::severity_, and logger::LogOptions::symlink_.
boost::shared_ptr<CONSOLE_SINK> logger::make_sink | ( | LogOptions const & | log_opts | ) |
Definition at line 348 of file Logger.cpp.
References logger::LogOptions::severity_clog_.
Duration* logger::newDuration | ( | DebugTimerParams const | debug_timer_params | ) |
Definition at line 659 of file Logger.cpp.
References ERROR, logger::DebugTimerParams::file_, g_duration_tree_map, g_duration_tree_map_mutex, g_enable_debug_timer, logger::anonymous_namespace{Logger.cpp}::g_thread_local_ids(), logger::DebugTimerParams::line_, LOG, logger::DebugTimerParams::name_, and logger::ThreadLocalIds::thread_id_.
boost::log::formatting_ostream& logger::operator<< | ( | boost::log::formatting_ostream & | strm, |
boost::log::to_log_manip< Channel, tag::channel > const & | manip | ||
) |
boost::log::formatting_ostream& logger::operator<< | ( | boost::log::formatting_ostream & | strm, |
boost::log::to_log_manip< Severity, tag::severity > const & | manip | ||
) |
std::ostream& logger::operator<< | ( | std::ostream & | out, |
Channels const & | channels | ||
) |
std::ostream& logger::operator<< | ( | std::ostream & | out, |
Severity const & | sev | ||
) |
Definition at line 467 of file Logger.cpp.
std::ostream& logger::operator<< | ( | std::ostream & | os, |
Duration const & | duration | ||
) |
Definition at line 680 of file Logger.cpp.
References logger::Duration::depth_, logger::DebugTimerParams::file_, nvtx_helpers::anonymous_namespace{nvtx_helpers.cpp}::filename(), logger::DebugTimerParams::line_, logger::DebugTimerParams::name_, logger::Duration::relative_start_time(), and logger::Duration::value().
std::ostream& logger::operator<< | ( | std::ostream & | os, |
DurationTree const & | duration_tree | ||
) |
Definition at line 686 of file Logger.cpp.
References logger::DurationTree::depth_, logger::DurationTree::durations(), and logger::DurationTree::thread_id_.
boost::log::record_ostream& logger::operator<< | ( | boost::log::record_ostream & | os, |
DurationTreeMap::const_reference | kv_pair | ||
) |
Definition at line 698 of file Logger.cpp.
std::istream& logger::operator>> | ( | std::istream & | in, |
Channels & | channels | ||
) |
Definition at line 424 of file Logger.cpp.
References ChannelNames, parse_ast::line, and logger::anonymous_namespace{Logger.cpp}::unquote().
std::istream& logger::operator>> | ( | std::istream & | in, |
Severity & | sev | ||
) |
Definition at line 453 of file Logger.cpp.
References logger::anonymous_namespace{Logger.cpp}::unquote().
RequestId logger::request_id | ( | ) |
Definition at line 876 of file Logger.cpp.
References logger::anonymous_namespace{Logger.cpp}::g_thread_local_ids(), and logger::ThreadLocalIds::request_id_.
Referenced by ExecutorResourceMgr_Namespace::ExecutorResourceMgr::choose_next_request(), DBHandler::create_table(), ExecutorResourceMgr_Namespace::ExecutorResourceMgr::enqueue_request(), ExecutorResourceMgr_Namespace::ExecutorResourceMgr::get_chunk_request_info(), ExecutorResourceMgr_Namespace::ExecutorResourceMgr::get_request_for_id(), ExecutorResourceMgr_Namespace::OutstandingQueueRequests::get_semaphore_for_request(), ExecutorResourceMgr_Namespace::ExecutorResourceMgr::mark_request_dequed(), ExecutorResourceMgr_Namespace::ExecutorResourceMgr::mark_request_error(), ExecutorResourceMgr_Namespace::ExecutorResourceMgr::mark_request_finished(), ExecutorResourceMgr_Namespace::ExecutorResourceMgr::mark_request_timed_out(), populate_output_stats_cols(), DBHandler::processCalciteRequest(), ExecutorResourceMgr_Namespace::ExecutorResourceMgr::request_resources_with_timeout(), set_request_id(), heavyai::RequestInfo::setRequestId(), DBHandler::sql_execute_gdf(), and ExecutorResourceMgr_Namespace::OutstandingQueueRequests::wake_request_by_id().
void logger::set_formatter | ( | SINK & | sink | ) |
Definition at line 289 of file Logger.cpp.
RequestId logger::set_new_request_id | ( | ) |
Definition at line 891 of file Logger.cpp.
References logger::anonymous_namespace{Logger.cpp}::g_next_request_id, logger::anonymous_namespace{Logger.cpp}::g_next_thread_id, logger::anonymous_namespace{Logger.cpp}::g_thread_local_ids(), logger::ThreadLocalIds::request_id_, and logger::ThreadLocalIds::thread_id_.
Referenced by DBHandler::connect(), and DBHandler::internal_connect().
void logger::set_once_fatal_func | ( | FatalFunc | fatal_func | ) |
Definition at line 394 of file Logger.cpp.
References g_fatal_func.
Referenced by QueryRunner::QueryRunner::QueryRunner().
void logger::set_request_id | ( | RequestId const | request_id | ) |
Definition at line 899 of file Logger.cpp.
References logger::anonymous_namespace{Logger.cpp}::g_next_thread_id, logger::anonymous_namespace{Logger.cpp}::g_thread_local_ids(), request_id(), logger::ThreadLocalIds::request_id_, and logger::ThreadLocalIds::thread_id_.
void logger::shutdown | ( | ) |
Definition at line 401 of file Logger.cpp.
References nvtx_helpers::shutdown().
Referenced by heartbeat(), EmbeddedDatabase::DBEngineImpl::reset(), TestProcessSignalHandler::shutdownSubsystemsAndExit(), startHeavyDBServer(), and logger::LogShutdown::~LogShutdown().
ThreadId logger::thread_id | ( | ) |
Definition at line 879 of file Logger.cpp.
References logger::anonymous_namespace{Logger.cpp}::g_thread_local_ids(), and logger::ThreadLocalIds::thread_id_.
Referenced by import_export::import_thread_delimited(), import_export::import_thread_shapefile(), import_export::Importer::importDelimited(), import_export::Importer::importGDALGeo(), import_export::Importer::importGDALRaster(), foreign_storage::LazyParquetChunkLoader::loadRowGroups(), nvtx_helpers::name_current_thread(), StringDictionary::populate_string_array_ids(), and Parser::InsertIntoTableAsSelectStmt::populateData().
ThreadLocalIds logger::thread_local_ids | ( | ) |
Definition at line 882 of file Logger.cpp.
References logger::anonymous_namespace{Logger.cpp}::g_thread_local_ids().
Referenced by WindowFunctionContext::compute(), QueryRunner::QueryRunner::getCalcitePlan(), QueryRunner::QueryRunner::getRelAlgDag(), BaselineJoinHashTableBuilder::initHashTableOnCpu(), Executor::launchKernelsImpl(), query_state::StdLog::log(), query_state::StdLog::logCallStack(), ResultSet::ResultSetComparator< BUFFER_ITERATOR_TYPE >::materializeApproxQuantileColumn(), ResultSet::ResultSetComparator< BUFFER_ITERATOR_TYPE >::materializeCountDistinctColumn(), ResultSet::ResultSetComparator< BUFFER_ITERATOR_TYPE >::materializeModeColumn(), ResultSet::parallelRowCount(), ResultSet::parallelTop(), foreign_storage::ParquetDataWrapper::populateChunkBuffers(), PerfectJoinHashTable::reify(), BoundingBoxIntersectJoinHashTable::reifyImpl(), RangeJoinHashTable::reifyWithLayout(), BaselineJoinHashTable::reifyWithLayout(), QueryRunner::QueryRunner::runSelectQuery(), QueryRunner::QueryRunner::runSQLWithAllowingInterrupt(), DBHandler::sql_execute_impl(), and DBHandler::validateRelAlg().
Definition at line 93 of file Logger.h.
Referenced by operator<<(), and operator>>().
constexpr std::array<char, 4> logger::ChannelSymbols {'R', 'P', 'A', 'X'} |
Definition at line 95 of file Logger.h.
Referenced by operator<<().
bool logger::g_any_active_channels {false} |
Definition at line 359 of file Logger.cpp.
Referenced by fast_logging_check(), and init().
DurationTreeMap logger::g_duration_tree_map |
Definition at line 657 of file Logger.cpp.
Referenced by debug_timer_new_thread(), logAndEraseDurationTree(), newDuration(), and logger::EraseDurationTrees::operator()().
std::mutex logger::g_duration_tree_map_mutex |
Definition at line 656 of file Logger.cpp.
Referenced by debug_timer_new_thread(), logAndEraseDurationTree(), and newDuration().
std::atomic<FatalFunc> logger::g_fatal_func {nullptr} |
Definition at line 341 of file Logger.cpp.
Referenced by set_once_fatal_func(), and logger::Logger::~Logger().
std::once_flag logger::g_fatal_func_flag |
Definition at line 342 of file Logger.cpp.
Referenced by logger::Logger::~Logger().
|
static |
Definition at line 362 of file Logger.cpp.
Referenced by get_log_dir_path(), and init().
Severity logger::g_min_active_severity {Severity::FATAL} |
Definition at line 360 of file Logger.cpp.
Referenced by fast_logging_check(), and init().
constexpr std::array<char const*, 8> logger::SeverityNames |
constexpr std::array<char, 8> logger::SeveritySymbols {'4', '3', '2', '1', 'I', 'W', 'E', 'F'} |
Definition at line 124 of file Logger.h.
Referenced by operator<<().