diff options
author | Jakub Zawadzki <darkjames@darkjames.pl> | 2014-05-14 01:56:23 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-05-17 21:33:26 +0000 |
commit | ea95c837fe62cb89ae7a0507e3ca437b822d658c (patch) | |
tree | 4474e48708ed60c27eb35d4ee3904381086daed7 /epan/dissectors/packet-udp.c | |
parent | 24082972a3650c0e743776b47549a17ab0ad20fe (diff) |
Introduce col_add_lstr(), use it instead of slower col_add_fstr.
We have callgrind benchmarks which shows that col_add_fstr() takes
5% of Ir count cause of formatting done in g_vsnprintf().
New col_add_lstr() can be used in few dissectors without much ugliness,
and it should be a little faster.
Change-Id: Ifddd951063dfd3a27c2a7da4dafce9b242c0472c
Reviewed-on: https://code.wireshark.org/review/1629
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-udp.c')
-rw-r--r-- | epan/dissectors/packet-udp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-udp.c b/epan/dissectors/packet-udp.c index 82952a5b85..4d191fd17c 100644 --- a/epan/dissectors/packet-udp.c +++ b/epan/dissectors/packet-udp.c @@ -458,8 +458,10 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto) udph->uh_sport=tvb_get_ntohs(tvb, offset); udph->uh_dport=tvb_get_ntohs(tvb, offset+2); - col_add_fstr(pinfo->cinfo, COL_INFO, "Source port: %s Destination port: %s", - ep_udp_port_to_display(udph->uh_sport), ep_udp_port_to_display(udph->uh_dport)); + col_add_lstr(pinfo->cinfo, COL_INFO, + "Source port: ", ep_udp_port_to_display(udph->uh_sport), " " + "Destination port: ", ep_udp_port_to_display(udph->uh_dport), + COL_ADD_LSTR_TERMINATOR); if (tree) { if (udp_summary_in_tree) { |