-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CBRD-25771] Add -i option to DIAGDB for input file and update usage message #5743
base: develop
Are you sure you want to change the base?
Changes from 4 commits
09bc405
dda8dd9
e9c42e4
981fd9f
d335c27
208d1b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
해당 코드는 diag -d 9(Heap dump)외의 옵션에서 -n 옵션이 입력되었을 때, usage를 출력해주는 코드입니다. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 수정하여 반영하였습니다. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1556,6 +1556,7 @@ diagdb (UTIL_FUNCTION_ARG * arg) | |
DIAGDUMP_TYPE diag; | ||
THREAD_ENTRY *thread_p; | ||
int error_code = NO_ERROR; | ||
char *fname; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 의미있는 변수명을 사용하는 것이 좋겠습니다. ex) class_name_list_file |
||
|
||
db_name = utility_get_option_string_value (arg_map, OPTION_STRING_TABLE, 0); | ||
if (db_name == NULL) | ||
|
@@ -1587,6 +1588,9 @@ diagdb (UTIL_FUNCTION_ARG * arg) | |
} | ||
|
||
class_name = utility_get_option_string_value (arg_map, DIAG_CLASS_NAME_S, 0); | ||
|
||
fname = utility_get_option_string_value (arg_map, DIAG_INPUT_FILE_S, 0); | ||
|
||
diag = (DIAGDUMP_TYPE) utility_get_option_int_value (arg_map, DIAG_DUMP_TYPE_S); | ||
|
||
if (diag != DIAGDUMP_LOG && utility_get_option_string_table_size (arg_map) != 1) | ||
|
@@ -1747,12 +1751,16 @@ diagdb (UTIL_FUNCTION_ARG * arg) | |
bool dump_records; | ||
dump_records = utility_get_option_bool_value (arg_map, DIAG_DUMP_RECORDS_S); | ||
|
||
if (class_name == NULL) | ||
if (class_name == NULL && fname == NULL) | ||
{ | ||
fprintf (outfp, "\n*** DUMP OF ALL HEAPS ***\n"); | ||
(void) file_tracker_dump_all_heap (thread_p, outfp, dump_records); | ||
} | ||
else | ||
else if (class_name && fname) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 부분은 전달받은 class_name 또는 fname 정보를 통해 출력을 처리하는 부분입니다. 전달받은 인자에 대한 예외처리를 수행하는 코드가 들어가게 되면, 코드 가독성이 떨어지게 됩니다. 해당 검사는 위에서 if (diag != DIAGDUMP_HEAP && fname != NULL) 검사 다음에 바로 수행하는게 좋을 것 같습니다. |
||
{ | ||
goto print_diag_usage; | ||
} | ||
else if (class_name != NULL) | ||
{ | ||
Comment on lines
1758
to
1769
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 잘 모르는 부분이라 리뷰의 의도는 아니고, 순수한 궁금증에 여쭤보고 싶은 게 있습니다. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 말씀하신 의도를 제가 정확히 파악했는지 모르겠습니다만, class_name이 NULL이고 fname이 NULL이 아닌 경우는 input file에 대한 heap dump를 위한 로직이 실행됩니다. 해당 코드는 다른 브랜치로 PR 예정이기 때문에 현재 PR 코드에는 보이지 않습니다. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아하 답변 감사드립니다. 이해되었습니다. |
||
if (!sm_check_system_class_by_name (class_name)) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1219,6 +1219,8 @@ typedef struct _ha_config | |||||||||
#define DIAG_EMERGENCY_L "emergency" | ||||||||||
#define DIAG_CLASS_NAME_S 'n' | ||||||||||
#define DIAG_CLASS_NAME_L "class-name" | ||||||||||
#define DIAG_INPUT_FILE_S 'i' | ||||||||||
#define DIAG_INPUT_FILE_L "input-file" | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Indent There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 수정하였습니다. |
||||||||||
|
||||||||||
/* patch option list */ | ||||||||||
#define PATCH_RECREATE_LOG_S 'r' | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
내부 요구사항에 의해 추가하는 기능으로 히든 옵션으로 정리하시죠.