Summary: | ASTERISK-09866: New feature: Turn core debugging on for a file | ||
Reporter: | Brett Bryant (bbryant) | Labels: | |
Date Opened: | 2007-07-12 11:00:17 | Date Closed: | 2007-07-30 22:43:29 |
Priority: | Major | Regression? | No |
Status: | Closed/Complete | Components: | General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) 20070712__core_debug_by_file.patch ( 1) 20070716__debug_by_file.patch ( 2) 20070719__core_debug_by_file_2.patch ( 3) 20070719__core_debug_by_file.patch ( 4) 20070720__core_debug_by_file.patch | |
Description: | This patch is helpful when debugging a single file for a problem. I put it here so people could look it over and give their opinion. | ||
Comments: | By: Russell Bryant (russell) 2007-07-13 13:23:51 Can you update the documentation for the CLI command you changed? By: Brett Bryant (bbryant) 2007-07-16 10:11:54 I uploaded a new patch with documentation for the command. By: Russell Bryant (russell) 2007-07-17 18:30:37 1) I would like to see this same functionality added to core set verbose, as well. 2) Here is my proposed syntax: core set {debug|verbose} [atleast] <level> [filename] 3) For turning off debug for a file, I think my preferred behavior would be to just have the existing "core set {debug|verbose} off". 4) As you pointed out when looking at this with me, you have a minor memory leak in here when turning off debug. 5) I would also like to see you take advantage of an optimization for the memory used for the filename with something like: struct ast_debug_file { ... char filename[0]; } struct ast_debug_file *df; df = ast_calloc(1, sizeof(*df) + strlen(filename) + 1); By: Russell Bryant (russell) 2007-07-20 17:27:51 It is worth noting that a related feature exists in 1.4, but accidentally got removed in trunk. This patch adds back what was there with more functionality. By: Digium Subversion (svnbot) 2007-07-23 09:04:33 Repository: asterisk Revision: 76555 ------------------------------------------------------------------------ r76555 | russell | 2007-07-23 09:04:33 -0500 (Mon, 23 Jul 2007) | 29 lines (closes issue ASTERISK-9866) Reported by: bbryant Patches: 20070720__core_debug_by_file.patch uploaded by bbryant (license 36) (with some modifications by me) Tested by: russell, bbryant This set of changes introduces the ability to set the core debug or verbose levels on a per-file basis. Interestingly enough, in 1.4, you have the ability to set core debug for a single file, but that functionality was accidentally lost in the conversion of the CLI commands to the new format. This patch improves upon what was in 1.4 by letting you set it for more than 1 file, and by also supporting verbose. *** Janitor Project *** This patch also introduces a new macro, ast_verb(), which is similar to ast_debug(). Setting the per file verbose value only works for messages that use this macro. Converting existing uses of ast_verbose() can be done like: if (option_debug > 2) ast_verbose(VERBOSE_PREFIX_3 "Something useful "); ... ast_verb(3, "Something useful "); ------------------------------------------------------------------------ By: Digium Subversion (svnbot) 2007-07-23 12:02:46 Repository: asterisk Revision: 76615 ------------------------------------------------------------------------ r76615 | tilghman | 2007-07-23 12:02:43 -0500 (Mon, 23 Jul 2007) | 115 lines Merged revisions 76547,76555,76558-76559,76562-76564 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r76547 | rizzo | 2007-07-23 09:18:04 -0500 (Mon, 23 Jul 2007) | 11 lines introduce two functions, map_x_s() and map_s_x(), to map between integers and strings using a single translation table, and use them in a few places instead of ad-hoc routines that duplicate the table. On passing, note that REFER_CONFIRMED is never used, and add a few comments. Nothing to backport here. ................ r76555 | russell | 2007-07-23 09:21:41 -0500 (Mon, 23 Jul 2007) | 29 lines (closes issue ASTERISK-9866) Reported by: bbryant Patches: 20070720__core_debug_by_file.patch uploaded by bbryant (license 36) (with some modifications by me) Tested by: russell, bbryant This set of changes introduces the ability to set the core debug or verbose levels on a per-file basis. Interestingly enough, in 1.4, you have the ability to set core debug for a single file, but that functionality was accidentally lost in the conversion of the CLI commands to the new format. This patch improves upon what was in 1.4 by letting you set it for more than 1 file, and by also supporting verbose. *** Janitor Project *** This patch also introduces a new macro, ast_verb(), which is similar to ast_debug(). Setting the per file verbose value only works for messages that use this macro. Converting existing uses of ast_verbose() can be done like: if (option_debug > 2) ast_verbose(VERBOSE_PREFIX_3 "Something useful "); ... ast_verb(3, "Something useful "); ................ r76558 | russell | 2007-07-23 09:23:47 -0500 (Mon, 23 Jul 2007) | 1 line note the debug and verbose changes in CHANGES ................ r76559 | russell | 2007-07-23 09:32:04 -0500 (Mon, 23 Jul 2007) | 7 lines (closes issue ASTERISK-9930) Reported by: snuffy Patches: doxygen-updates.diff uploaded by snuffy (license 35) Another big batch of doxygen documentation updates ................ r76562 | russell | 2007-07-23 09:37:26 -0500 (Mon, 23 Jul 2007) | 3 lines Mark str2dtmfmode() as currently unused to resolve a compiler warning and allow building under dev mode ................ r76563 | file | 2007-07-23 09:38:35 -0500 (Mon, 23 Jul 2007) | 22 lines Merged revisions 76561 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r76561 | file | 2007-07-23 11:34:21 -0300 (Mon, 23 Jul 2007) | 14 lines Merged revisions 76560 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r76560 | file | 2007-07-23 11:32:07 -0300 (Mon, 23 Jul 2007) | 6 lines (closes issue ASTERISK-9840) Reported by: homesick Patches: rpid_1.4_75840.patch uploaded by homesick (license 91) Accept Remote Party ID on guest calls. ........ ................ ................ r76564 | rizzo | 2007-07-23 09:45:22 -0500 (Mon, 23 Jul 2007) | 16 lines add two missing entries in the replica of the sip_tech that does not use DTMF BEGIN frames. 1.4 seems correct (it does not have the two fields). However, as this bug shows, the current way of creating the sip_tech replica is too error-prone, one can easily forget to update one of the two entries. Perhaps it would be better to create sip_tech_info expliclty at module load, by doing sip_tech_info = sip_tech; sip_tech_info.send_digit_begin = NULL (in this case, this is something applicable to 1.4 as well). ................ ------------------------------------------------------------------------ By: Digium Subversion (svnbot) 2007-07-30 22:43:29 Repository: asterisk Revision: 77811 ------------------------------------------------------------------------ r77811 | murf | 2007-07-30 22:43:28 -0500 (Mon, 30 Jul 2007) | 115 lines Merged revisions 76547,76555,76558-76559,76562-76564 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r76547 | rizzo | 2007-07-23 08:18:04 -0600 (Mon, 23 Jul 2007) | 11 lines introduce two functions, map_x_s() and map_s_x(), to map between integers and strings using a single translation table, and use them in a few places instead of ad-hoc routines that duplicate the table. On passing, note that REFER_CONFIRMED is never used, and add a few comments. Nothing to backport here. ................ r76555 | russell | 2007-07-23 08:21:41 -0600 (Mon, 23 Jul 2007) | 29 lines (closes issue ASTERISK-9866) Reported by: bbryant Patches: 20070720__core_debug_by_file.patch uploaded by bbryant (license 36) (with some modifications by me) Tested by: russell, bbryant This set of changes introduces the ability to set the core debug or verbose levels on a per-file basis. Interestingly enough, in 1.4, you have the ability to set core debug for a single file, but that functionality was accidentally lost in the conversion of the CLI commands to the new format. This patch improves upon what was in 1.4 by letting you set it for more than 1 file, and by also supporting verbose. *** Janitor Project *** This patch also introduces a new macro, ast_verb(), which is similar to ast_debug(). Setting the per file verbose value only works for messages that use this macro. Converting existing uses of ast_verbose() can be done like: if (option_debug > 2) ast_verbose(VERBOSE_PREFIX_3 "Something useful "); ... ast_verb(3, "Something useful "); ................ r76558 | russell | 2007-07-23 08:23:47 -0600 (Mon, 23 Jul 2007) | 1 line note the debug and verbose changes in CHANGES ................ r76559 | russell | 2007-07-23 08:32:04 -0600 (Mon, 23 Jul 2007) | 7 lines (closes issue ASTERISK-9930) Reported by: snuffy Patches: doxygen-updates.diff uploaded by snuffy (license 35) Another big batch of doxygen documentation updates ................ r76562 | russell | 2007-07-23 08:37:26 -0600 (Mon, 23 Jul 2007) | 3 lines Mark str2dtmfmode() as currently unused to resolve a compiler warning and allow building under dev mode ................ r76563 | file | 2007-07-23 08:38:35 -0600 (Mon, 23 Jul 2007) | 22 lines Merged revisions 76561 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r76561 | file | 2007-07-23 11:34:21 -0300 (Mon, 23 Jul 2007) | 14 lines Merged revisions 76560 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r76560 | file | 2007-07-23 11:32:07 -0300 (Mon, 23 Jul 2007) | 6 lines (closes issue ASTERISK-9840) Reported by: homesick Patches: rpid_1.4_75840.patch uploaded by homesick (license 91) Accept Remote Party ID on guest calls. ........ ................ ................ r76564 | rizzo | 2007-07-23 08:45:22 -0600 (Mon, 23 Jul 2007) | 16 lines add two missing entries in the replica of the sip_tech that does not use DTMF BEGIN frames. 1.4 seems correct (it does not have the two fields). However, as this bug shows, the current way of creating the sip_tech replica is too error-prone, one can easily forget to update one of the two entries. Perhaps it would be better to create sip_tech_info expliclty at module load, by doing sip_tech_info = sip_tech; sip_tech_info.send_digit_begin = NULL (in this case, this is something applicable to 1.4 as well). ................ ------------------------------------------------------------------------ |