On 9/9/25 5:10 PM, Aaron Conole via dev wrote:
> Eelco Chaudron <[email protected]> writes:
> 
>> On 3 Sep 2025, at 16:26, Aaron Conole via dev wrote:
>>
>>> There is some confusion about which options can be passed to ovs-tcpdump
>>> when gathering data.  The interpretation sometimes is that ovs-tcpdump
>>> only accepts a specific small set of options and discards other options.
>>> This leads to questions such as, "How can I use '-C' or set the snaplen
>>> with ovs-tcpdump like tcpdump allows?"  To correct this, print the
>>> dump_cmd help after the ovs-tcpdump options.
>>>
>>> As part of this rework, we delay printing the usage data until after
>>> all arguments are processed, which allows setting the dumpcmd as well
>>> for the --help option.
>>>
>>> Signed-off-by: Aaron Conole <[email protected]>
>>
>> Hi Aaron,
>>
>> I think the patch in general is good, however, the output might end up
>> being more confusing. For example:
>>
>> The following are the 'tcpdump' options:
>> tcpdump version 4.99.5
>> libpcap version 1.10.5 (with TPACKET_V3)
>> OpenSSL 3.2.4 11 Feb 2025
>> 64-bit build, 64-bit time_t
>> Usage: tcpdump [-AbdDefhHIJKlLnNOpqStuUvxX#] [ -B size ] [ -c count ] 
>> [--count]
>>         [ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]
>>         [ -i interface ] [ --immediate-mode ] [ -j tstamptype ]
>>         [ -M secret ] [ --number ] [ --print ] [ -Q in|out|inout ]
>>         [ -r file ] [ -s snaplen ] [ -T type ] [ --version ]
>>         [ -V file ] [ -w file ] [ -W filecount ] [ -y datalinktype ]
>>         [ --time-stamp-precision precision ] [ --micro ] [ --nano ]
>>         [ -z postrotate-command ] [ -Z user ] [ expression ]
>>
>>
>> Here, the version info and other metadata appear before the actual
>> usage instructions.
>> Should we perhaps start dumping from “Usage” onwards? Though I’m not
>> sure this will work reliably for all tcpdump versions.

Rabbit also points out that some tcpdump builds print help to stderr or only
support “-h”.  This should be taken care of, I guess.

> 
> That doesn't seem very robust, imo.
> 
>> Thoughts?
> 
> I agree it can be a bit confusing, but also, right now there's confusion
> about what options can be passed to ovs-tcpdump and that leads people to
> do their own weird solutions (or even re-implement it).  And though the
> documentation looks to be clear in most places, the missing details in
> '--help' creates this confusion.

Maybe adding an example with some complex-ish arguments instead would help?

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to