17 #include <google/heap-profiler.h>
18 #include <google/malloc_extension.h>
51 DEFINE_int32(max_log_files, 10,
"Maximum number of log files to retain per severity "
52 "level. The most recent log files are retained. If set to 0, all log files are "
76 sleep(FLAGS_logbufsecs);
78 google::FlushLogFiles(google::GLOG_INFO);
84 #ifndef ADDRESS_SANITIZER
97 size_t bytes_used = 0;
98 size_t bytes_in_pageheap = 0;
99 MallocExtension::instance()->GetNumericProperty(
100 "generic.current_allocated_bytes", &bytes_used);
101 MallocExtension::instance()->GetNumericProperty(
102 "generic.heap_size", &bytes_in_pageheap);
104 MallocExtension::instance()->ReleaseFreeMemory();
128 DecimalUtil::InitMaxUnscaledDecimal();
129 TestInfo::Init(test_mode);
133 CpuInfo::VerifyCpuRequirements();
139 google::ParseCommandLineFlags(&argc, &argv,
true);
140 if (!FLAGS_redaction_rules_file.empty()) {
142 EXIT_WITH_ERROR(
"Redaction cannot be used in combination with log level 3 or "
143 "higher or the -vmodule option because these log levels may log data in "
144 "ways redaction rules may not anticipate.");
159 LOG(INFO) <<
"Using hostname: " << FLAGS_hostname;
168 LOG(INFO) <<
"Process ID: " << getpid();
183 Expr::InitBuiltinsDummy();
186 #ifndef ADDRESS_SANITIZER
188 if (FLAGS_enable_process_lifetime_heap_profiling) {
189 HeapProfilerStart(FLAGS_heap_profile_dir.c_str());
void InitThriftLogging()
Redirects all Thrift logging to VLOG(1)
#define EXIT_WITH_ERROR(msg)
TODO: Consider allowing fragment IDs as category parameters.
string GetVersionString(bool compact)
Returns "<program short name> version <GetBuildVersion(compact)>".
void InitCommonRuntime(int argc, char **argv, bool init_jvm, TestInfo::Mode m=TestInfo::NON_TEST)
string GetBuildVersion(bool compact)
string SetRedactionRulesFromFile(const string &rules_file_path)
MemTracker * process_mem_tracker()
void InitGoogleLoggingSafe(const char *arg)
void CheckAndRotateLogFiles(int max_log_files)
DEFINE_int32(max_log_files, 10,"Maximum number of log files to retain per severity ""level. The most recent log files are retained. If set to 0, all log files are ""retained.")
void InitThreading()
Initialises the threading subsystem. Must be called before a Thread is created.
void InitJvmLoggingSupport()
std::string DebugString(const T &val)
DECLARE_bool(enable_process_lifetime_heap_profiling)
#define EXIT_IF_ERROR(stmt)
void Release(int64_t bytes)
Decreases consumption of this tracker and its ancestors by 'bytes'.
Status GetHostname(string *hostname)
DECLARE_int32(logbufsecs)
static ExecEnv * GetInstance()
static const float TCMALLOC_RELEASE_FREE_MEMORY_FRACTION
static Status Init()
Initializes the libcache. Must be called before any other APIs.
void LogCommandLineFlags()
Writes all command-line flags to the log at level INFO.
static void Init()
Initializes the cache. Must be called before any other APIs.
static void MaintenanceThread()
Status InitAuth(const std::string &appname)
shared_ptr< impala::Thread > maintenance_thread