CUBRID Engine
latest
|
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <unistd.h>
#include "cubrid_getopt.h"
#include "cas_common.h"
#include "cas_query_info.h"
#include "broker_log_time.h"
#include "broker_log_sql_list.h"
#include "log_top_string.h"
#include "broker_log_top.h"
#include "broker_log_util.h"
Go to the source code of this file.
Macros | |
#define | MAX_SRV_HANDLE 3000 |
#define | CLIENT_MSG_BUF_SIZE 1024 |
#define | CONNECT_MSG_BUF_SIZE 1024 |
Functions | |
static int | log_top_query (int argc, char *argv[], int arg_start) |
static int | log_top (FILE *fp, char *filename, long start_offset, long end_offset) |
static int | log_execute (T_QUERY_INFO *qi, char *linebuf, char **query_p) |
static int | get_args (int argc, char *argv[]) |
static int | read_multi_line_sql (FILE *fp, T_STRING *t_str, char **linebuf, int *lineno, T_STRING *sql_buf, T_STRING *cas_log_buf) |
static int | read_execute_end_msg (char *msg_p, int *res_code, int *runtime_msec) |
static int | read_bind_value (FILE *fp, T_STRING *t_str, char **linebuf, int *lineno, T_STRING *cas_log_buf) |
static int | search_offset (FILE *fp, char *string, long *offset, bool start) |
static char * | organize_query_string (const char *sql) |
int | main (int argc, char *argv[]) |
int | get_file_offset (char *filename, long *start_offset, long *end_offset) |
int | check_log_time (char *start_date, char *end_date) |
Variables | |
T_LOG_TOP_MODE | log_top_mode = MODE_PROC_TIME |
static char * | sql_info_file = NULL |
static int | mode_max_handle_lower_bound |
static char | mode_tran = 0 |
static char | from_date [128] = "" |
static char | to_date [128] = "" |
#define CLIENT_MSG_BUF_SIZE 1024 |
Definition at line 53 of file broker_log_top.c.
Referenced by log_top().
#define CONNECT_MSG_BUF_SIZE 1024 |
Definition at line 54 of file broker_log_top.c.
Referenced by log_top().
#define MAX_SRV_HANDLE 3000 |
Definition at line 52 of file broker_log_top.c.
Referenced by log_execute(), and log_top().
int check_log_time | ( | char * | start_date, |
char * | end_date | ||
) |
Definition at line 330 of file broker_log_top.c.
References DATE_STR_LEN, from_date, and to_date.
Referenced by info_add(), query_info_add(), and query_info_add_ne().
|
static |
Definition at line 744 of file broker_log_top.c.
References from_date, getopt(), log_top_mode, MODE_MAX_HANDLE, mode_max_handle_lower_bound, mode_tran, optarg, optind, sql_info_file, str_to_log_date_format(), and to_date.
Referenced by main().
int get_file_offset | ( | char * | filename, |
long * | start_offset, | ||
long * | end_offset | ||
) |
Definition at line 300 of file broker_log_top.c.
References from_date, NULL, search_offset(), and to_date.
Referenced by log_top_query(), and log_top_tran().
|
static |
Definition at line 717 of file broker_log_top.c.
References MAX_SRV_HANDLE, NULL, and p.
Referenced by log_top().
|
static |
Definition at line 471 of file broker_log_top.c.
References t_query_info::cas_log, CAS_LOG_BEGIN_WITH_MONTH, CAS_LOG_BEGIN_WITH_YEAR, t_query_info::cas_log_len, CLIENT_MSG_BUF_SIZE, CONNECT_MSG_BUF_SIZE, DATE_STR_LEN, GET_CUR_DATE_STR, get_msg_start_ptr(), i, is_cas_log(), log_execute(), log_top_mode, LT_INVAILD_VERSION, LT_NO_ERROR, LT_OTHER_ERROR, MAX_SRV_HANDLE, MODE_MAX_HANDLE, mode_max_handle_lower_bound, NULL, organize_query_string(), t_query_info::organized_sql, query_info_add(), query_info_add_ne(), query_info_clear(), query_info_init(), read_bind_value(), read_execute_end_msg(), read_multi_line_sql(), REALLOC, t_query_info::sql, strlen, t_string_add(), t_string_clear(), t_string_free(), t_string_len(), t_string_make(), t_string_str(), ut_get_line(), and ut_trim().
Referenced by log_top_query().
|
static |
Definition at line 347 of file broker_log_top.c.
References argc, error(), get_file_offset(), i, log_top(), LT_INVAILD_VERSION, MALLOC, NULL, num_thread, process_flag, query_info_print(), SLEEP_MILISEC, sql_info_file, sql_list_make(), thr_main(), and THREAD_BEGIN.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 99 of file broker_log_top.c.
References argc, argv, assert, cubregex::count(), error(), FREE_MEM, get_args(), handle, i, log_top_query(), log_top_tran(), MALLOC, mode_tran, and NULL.
|
static |
|
static |
Definition at line 822 of file broker_log_top.c.
References CAS_LOG_BEGIN_WITH_YEAR, get_msg_start_ptr(), is_cas_log(), t_string_add(), t_string_len(), and ut_get_line().
Referenced by log_top().
|
static |
Definition at line 864 of file broker_log_top.c.
References NULL, p, and str_to_int32().
Referenced by log_top().
|
static |
Definition at line 793 of file broker_log_top.c.
References CAS_LOG_BEGIN_WITH_YEAR, is_cas_log(), strlen, t_string_add(), and ut_get_line().
Referenced by log_top().
|
static |
Definition at line 919 of file broker_log_top.c.
References assert, CAS_LOG_BEGIN_WITH_YEAR, DATE_STR_LEN, error(), is_cas_log(), NULL, t_string_free(), t_string_make(), and ut_get_line().
Referenced by get_file_offset().
|
static |
Definition at line 90 of file broker_log_top.c.
Referenced by check_log_time(), get_args(), and get_file_offset().
T_LOG_TOP_MODE log_top_mode = MODE_PROC_TIME |
Definition at line 85 of file broker_log_top.c.
Referenced by get_args(), log_top(), and query_info_print().
|
static |
Definition at line 88 of file broker_log_top.c.
Referenced by get_args(), and log_top().
|
static |
Definition at line 89 of file broker_log_top.c.
Referenced by get_args(), and main().
|
static |
Definition at line 87 of file broker_log_top.c.
Referenced by get_args(), and log_top_query().
|
static |
Definition at line 91 of file broker_log_top.c.
Referenced by check_log_time(), get_args(), and get_file_offset().