Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 40877: /trunk/epan/dissectors/ /trun
From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Wed, 8 Feb 2012 15:51:46 +0100
On Wed, Feb 08, 2012 at 09:16:48AM -0500, Jeff Morriss wrote:
> Joerg Mayer wrote:
> [...]
>> So more than half of all the stuff is added by using proto_tree_add_text.
>> As long as the ratio is that way, people are likely to continue using it
>> inside this dissector.
>> Any volunteer(s) to get this down to some sane level by replacing it by
>> proto_tree_add_item and adding hf_ entries where possible to make these
>> Elements filterable?
>>
>> Should something like the above check be added to one of the check scripts
>> to complain if the add_text percentage is above 10% or so?
>
> Done in r40930

Good!

> though there's a lot of dissectors with the problem so I  
> chose 50% as the warning level for now.

Makes sense.

> And the code isn't super fast either.

Why three loops: Just have one for proto_tree_add_[a-z]+. Use this for
totals and if there is a match, check whether is is proto_tree_add_text
and if it is, check for for var = proto_tree_add_text. That should be
"good enough" (or do we loose lots of multiline machtes by this).

> So it's commented out for now.  Maybe another command line  
> option is in order?

Yes, I think it is anyway.

ciao
 Jörg
-- 
Joerg Mayer                                           <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.