-
Notifications
You must be signed in to change notification settings - Fork 123
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-25312] Modify diagdb utility to accept a class-name parameter #5141
Changes from 11 commits
1ce74a3
f9968bb
456117c
473e627
c2916c9
78e5377
03d40b6
535fff4
5032a77
0ae9fe3
aae7f38
d06428d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -1531,6 +1531,7 @@ diagdb (UTIL_FUNCTION_ARG * arg) | |||
char er_msg_file[PATH_MAX]; | ||||
const char *db_name; | ||||
const char *output_file = NULL; | ||||
const char *class_name; | ||||
FILE *outfp = NULL; | ||||
bool is_emergency = false; | ||||
DIAGDUMP_TYPE diag; | ||||
|
@@ -1565,13 +1566,17 @@ diagdb (UTIL_FUNCTION_ARG * arg) | |||
} | ||||
} | ||||
|
||||
class_name = utility_get_option_string_value (arg_map, DIAG_CLASS_NAME_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) | ||||
{ | ||||
goto print_diag_usage; | ||||
} | ||||
|
||||
if (diag == DIAGDUMP_ALL && class_name != NULL) | ||||
{ | ||||
goto print_diag_usage; | ||||
} | ||||
if (check_database_name (db_name)) | ||||
{ | ||||
goto error_exit; | ||||
|
@@ -1716,10 +1721,26 @@ diagdb (UTIL_FUNCTION_ARG * arg) | |||
if (diag == DIAGDUMP_ALL || diag == DIAGDUMP_HEAP) | ||||
{ | ||||
bool dump_records; | ||||
/* this dumps the contents of all heaps */ | ||||
dump_records = utility_get_option_bool_value (arg_map, DIAG_DUMP_RECORDS_S); | ||||
fprintf (outfp, "\n*** DUMP OF ALL HEAPS ***\n"); | ||||
(void) file_tracker_dump_all_heap (thread_p, outfp, dump_records); | ||||
|
||||
if (class_name == NULL) | ||||
{ | ||||
fprintf (outfp, "\n*** DUMP OF ALL HEAPS ***\n"); | ||||
(void) file_tracker_dump_all_heap (thread_p, outfp, dump_records); | ||||
} | ||||
else | ||||
{ | ||||
assert (diag != DIAGDUMP_ALL); | ||||
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. It is already checked.
Suggested change
|
||||
if (!sm_check_system_class_by_name (class_name)) | ||||
{ | ||||
if (utility_check_class_name (class_name) != NO_ERROR) | ||||
{ | ||||
goto error_exit; | ||||
} | ||||
} | ||||
fprintf (outfp, "\n*** DUMP HEAP OF %s ***\n", class_name); | ||||
heap_dump_specific_file (thread_p, outfp, dump_records, class_name); | ||||
} | ||||
} | ||||
|
||||
db_shutdown (); | ||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -14507,6 +14507,22 @@ heap_dump (THREAD_ENTRY * thread_p, FILE * fp, HFID * hfid, bool dump_records) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fprintf (fp, "\n\n*** END OF DUMP FOR HEAP FILE ***\n\n"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* heap_dump_specific_file () - dump a specific heap file with class name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* return : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* thread_p (in) : thread entry | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* fp (in) : output file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* dump_records (in) : true to dump records | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* class_name (in) : name of class to dump | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
void | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
heap_dump_specific_file (THREAD_ENTRY * thread_p, FILE * fp, bool dump_records, const char *class_name) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/* TODO: Fetch HFID of class which corresponds to class_name, and dump heap file by HFID. Will be handled at CBRD-25313 and CBRD-25314. */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fprintf (fp, "\n\n*** DUMP A CLASS NAMED %s ***\n\n", class_name); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. Does this need to print out this message? This information is already included in the heading. 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. I think it's duplicated information. It's been deleted. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* heap_dump_capacity () - dump heap file capacity | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -554,6 +554,7 @@ extern int heap_set_autoincrement_value (THREAD_ENTRY * thread_p, HEAP_CACHE_ATT | |||||||||
HEAP_SCANCACHE * scan_cache, int *is_set); | ||||||||||
|
||||||||||
extern void heap_dump (THREAD_ENTRY * thread_p, FILE * fp, HFID * hfid, bool dump_records); | ||||||||||
extern void heap_dump_specific_file (THREAD_ENTRY * thread_p, FILE * fp, bool dump_records, const char *class_name); | ||||||||||
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
|
||||||||||
extern void heap_attrinfo_dump (THREAD_ENTRY * thread_p, FILE * fp, HEAP_CACHE_ATTRINFO * attr_info, bool dump_schema); | ||||||||||
#if defined (CUBRID_DEBUG) | ||||||||||
extern void heap_chnguess_dump (FILE * fp); | ||||||||||
|
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.