Wireshark-dev: Re: [Wireshark-dev] Why does the extcap stuff take so long to start up?

From: Michał Łabędzki <michal.tomasz.labedzki@xxxxxxxxx>
Date: Mon, 27 Mar 2017 08:30:27 +0200
Hello Guy,

Could you check if any of extcap binaries generates that delay? (check
one by one) On "my" Ubuntu 12.04:

my_extcap[4] = {androiddump, randpktdump, udpdump, my custom extcap};

  $ time ./run/tshark -D # returns 21 interfaces
  real    0m0.188s
  user    0m0.115s
  sys     0m0.061s


  $ time ./run/tshark -D # with connected phone + androiddump (+7 interfaces)
  real    0m0.464s
  user    0m0.115s
  sys     0m0.077s

~200ms for androiddump is very ice (expected), not a bug (if ~4s it is a bug).


  $ time ./run/tshark -D # extcap dir renamed (removed) - 13 interfaces now
  real    0m0.141s
  user    0m0.106s
  sys     0m0.030s

Summary: no problem on my platform.

PS. Similar results when opening small capture file.

It seems that initializing interfaces takes significant time, but my
question is: why does it <must> be done if user only try to open
capture file? Could we do not initialize nor extcap neither libpcap
interfaces in that case? ....or do it in background...

2017-03-27 1:05 GMT+02:00 Guy Harris <guy@xxxxxxxxxxxx>:
> $ time ./tshark -r /tmp/nothing.pcap    # reading an empty pcap file
>                                         # with all the extcap binaries present
> real    0m4.089s
> user    0m0.694s
> sys     0m2.637s
>
> $ time ./tshark -r /tmp/nothing.pcap    # reading the same empty pcap file
>                                         # with the extcap binaries removed
> real    0m0.540s
> user    0m0.310s
> sys     0m0.220s
>
> So it took *four seconds* of real time, and over *two seconds* of system-mode CPU time, to run, I guess, extcap_register_preferences(), and all the stuff it runs.
>
> Does it need to take that long?
>
> If it does need to take that long, do we need to do that if we're not capturing?
> ___________________________________________________________________________
> Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
> Archives:    https://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
>              mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe



-- 
Michał Łabędzki