[sr-dev] About new debugger module

Marius Zbihlei Marius.Zbihlei at 1and1.ro
Thu Feb 11 19:06:10 CET 2010


Hello, 

I don't see a problem with the malloc's as performance is out of the question. I don't think anyone tries to do profiling with the debugger module. It might be a problem with the user that has ownership of the pointer. I've try with some static buffer but this tends to get complicated as recursive calls are made to the printing function.

 I don't know about your suggestion for a simplified action_info struct. The problem with the size of the patch is that kamailio support expression is actions, which can have there own action list and such on. Probably it will be better not to touch the route_* files in core, just duplicate the print mechanism in modules/debugger. This will allow for some rather nice optimization (I don't need to handle both the DBG() case and the debugger output case) and support only the necessary bits.

Cheers
Marius


> The patch is a little on the long side, and a bit intrusive to my 
> liking , it you have other suggestion please let me now.

indeed a bit long. I was thinking to have some static tables:

struct action_info {
int type;
char *name;
};

struct action_info _sr_actions_list[] = {
   {FORWARD_T, "forward"},
   {IF_T, "if"},
...
   {0, 0}
};

Maybe same for expressions, operators, etc. Would become easy everywhere 
to get the action name (also easy to generate the list of actions for 
documentation purposes). The core print functions will get simplified a 
lot, since only few cases need special handling.

What I do not like about printing to buffer now is alloc every time. I 
was thinking to a less verbose version, just to print the action name, 
but more details are probably better when debugging.

Cheers,
Daniel

>
> Cheers
> Marius
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>    

-- 
Daniel-Constantin Mierla
SIP Server Professional Solutions
* http://www.asipto.com/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20100211/91fc4bca/attachment.htm>


More information about the sr-dev mailing list