CUBRID Engine
latest
|
#include "event_log.h"
#include "config.h"
#include "critical_section.h"
#include "dbtype.h"
#include "error_manager.h"
#include "environment_variable.h"
#include "log_impl.h"
#include "query_executor.h"
#include "object_primitive.h"
#include "porting.h"
#include "system_parameter.h"
#include "xasl_cache.h"
#include <assert.h>
#include <stdio.h>
#include <sys/time.h>
Go to the source code of this file.
Macros | |
#define | EVENT_LOG_FILE_DIR "server" |
#define | EVENT_LOG_FILE_SUFFIX ".event" |
Functions | |
static FILE * | event_file_open (const char *path) |
static FILE * | event_file_backup (FILE *fp, const char *path) |
static void | event_log_print_client_ids_info (CLIENTIDS *client_info, int indent) |
void | event_log_init (const char *db_name) |
void | event_log_final (void) |
FILE * | event_log_start (THREAD_ENTRY *thread_p, const char *event_name) |
void | event_log_end (THREAD_ENTRY *thread_p) |
void | event_log_print_client_info (int tran_index, int indent) |
void | event_log_sql_string (THREAD_ENTRY *thread_p, FILE *log_fp, XASL_ID *xasl_id, int indent) |
void | event_log_bind_values (THREAD_ENTRY *thread_p, FILE *log_fp, int tran_index, int bind_index) |
void | event_log_log_flush_thr_wait (THREAD_ENTRY *thread_p, int flush_count, clientids *client_info, int flush_time, int flush_wait_time, int writer_time) |
Variables | |
static FILE * | event_Fp = NULL |
static char | event_log_file_path [PATH_MAX] |
#define EVENT_LOG_FILE_DIR "server" |
Definition at line 55 of file event_log.c.
Referenced by event_log_init().
#define EVENT_LOG_FILE_SUFFIX ".event" |
Definition at line 56 of file event_log.c.
Referenced by event_file_open(), and event_log_init().
|
static |
Definition at line 188 of file event_log.c.
Referenced by event_file_open(), and event_log_start().
|
static |
Definition at line 120 of file event_log.c.
References ARG_FILE_LINE, assert, cub_dirname_r(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), event_file_backup(), EVENT_LOG_FILE_SUFFIX, free_and_init, NULL, prm_get_integer_value(), PRM_ID_ER_LOG_SIZE, strdup(), and strlen.
Referenced by event_log_init(), and event_log_start().
void event_log_bind_values | ( | THREAD_ENTRY * | thread_p, |
FILE * | log_fp, | ||
int | tran_index, | ||
int | bind_index | ||
) |
Definition at line 405 of file event_log.c.
References log_tdes::bind_history, db_private_free, i, LOG_FIND_TDES(), NULL, pr_valstring(), db_value_array::size, and db_value_array::vals.
Referenced by event_log_many_ioreads(), event_log_slow_query(), event_log_temp_expand_pages(), and lock_wait_state_to_string().
void event_log_end | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 290 of file event_log.c.
References assert, csect_check_own, CSECT_EVENT_LOG_FILE, csect_exit, event_Fp, and NULL.
Referenced by event_log_log_flush_thr_wait(), event_log_many_ioreads(), event_log_slow_query(), event_log_temp_expand_pages(), and lock_detect_local_deadlock().
void event_log_final | ( | void | ) |
Definition at line 208 of file event_log.c.
References event_Fp, and NULL.
Referenced by boot_server_all_finalize().
void event_log_init | ( | const char * | db_name | ) |
Definition at line 70 of file event_log.c.
References assert, basename(), DB_MAX_IDENTIFIER_LENGTH, envvar_logdir_file(), event_file_open(), event_Fp, EVENT_LOG_FILE_DIR, event_log_file_path, EVENT_LOG_FILE_SUFFIX, NULL, and PATH_SEPARATOR.
Referenced by boot_restart_server().
void event_log_log_flush_thr_wait | ( | THREAD_ENTRY * | thread_p, |
int | flush_count, | ||
clientids * | client_info, | ||
int | flush_time, | ||
int | flush_wait_time, | ||
int | writer_time | ||
) |
Definition at line 446 of file event_log.c.
References event_log_end(), event_log_print_client_ids_info(), event_log_start(), log_fp, and NULL.
Referenced by logpb_flush_all_append_pages().
|
static |
Definition at line 308 of file event_log.c.
References clientids::client_type, event_Fp, clientids::get_db_user(), clientids::get_host_name(), clientids::get_program_name(), NULL, and clientids::process_id.
Referenced by event_log_log_flush_thr_wait().
void event_log_print_client_info | ( | int | tran_index, |
int | indent | ||
) |
Definition at line 335 of file event_log.c.
References event_Fp, host, logtb_find_client_name_host_pid(), NULL, and pid.
Referenced by event_log_many_ioreads(), event_log_slow_query(), event_log_temp_expand_pages(), lock_detect_local_deadlock(), and lock_wait_state_to_string().
void event_log_sql_string | ( | THREAD_ENTRY * | thread_p, |
FILE * | log_fp, | ||
XASL_ID * | xasl_id, | ||
int | indent | ||
) |
Definition at line 362 of file event_log.c.
References assert, ASSERT_ERROR, csect_check_own, CSECT_EVENT_LOG_FILE, EVENT_EMPTY_QUERY, NO_ERROR, NULL, xasl_id::sha1, execution_info::sql_hash_text, xasl_cache_ent::sql_info, XASL_CACHE_SEARCH_GENERIC, XASL_ID_IS_NULL, xcache_find_sha1(), and xcache_unfix().
Referenced by lock_wait_state_to_string().
FILE* event_log_start | ( | THREAD_ENTRY * | thread_p, |
const char * | event_name | ||
) |
Definition at line 222 of file event_log.c.
References ARG_FILE_LINE, csect_enter, CSECT_EVENT_LOG_FILE, csect_exit, ER_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), event_file_backup(), event_file_open(), event_Fp, event_log_file_path, INF_WAIT, NULL, prm_get_integer_value(), and PRM_ID_ER_LOG_SIZE.
Referenced by event_log_log_flush_thr_wait(), event_log_many_ioreads(), event_log_slow_query(), event_log_temp_expand_pages(), and lock_detect_local_deadlock().
|
static |
Definition at line 58 of file event_log.c.
Referenced by event_log_end(), event_log_final(), event_log_init(), event_log_print_client_ids_info(), event_log_print_client_info(), and event_log_start().
|
static |
Definition at line 59 of file event_log.c.
Referenced by event_log_init(), and event_log_start().