[PATCH v3 0/2] Add option to timestamp console log

Morten Brørup mb at smartsharesystems.com
Tue Mar 7 08:33:17 CET 2023


> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Monday, 6 March 2023 20.28
> 
> This is a reprise of earlier patch to add timestamp to console
> messages.
> 
> Example:
> # dpdk-testpmd -l 1-4 -n 4 --vdev net_null0 --log-timestamp -- -i
> EAL: Detected CPU lcores: 16
> EAL: Detected NUMA nodes: 1
> EAL: Detected static linkage of DPDK
> EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
> EAL: Selected IOVA mode 'VA'
> Interactive-mode selected
> [       0.191407] testpmd: create a new mbuf pool <mb_pool_0>: n=171456,
> size=2176, socket=0
> [       0.191510] testpmd: preferred mempool ops selected: ring_mp_mc

This is useful.

Here's some feature creep: Since the timestamp output is configurable, there is no need to settle on one specific timestamp format. The option could allow a choice between MONOTONIC and REALTIME, with an option for REALTIME to include the date in ISO 8601 format (YYYY-MM-DD). And REALTIME could be UTC or local time. You could consider taking a format string for strftime(), with the extension that %f expands to 6 digit microseconds like in Python [1].

[1]: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes

With or without feature creep,

Series-acked-by: Morten Brørup <mb at smartsharesystems.com>



More information about the dev mailing list