[PATCH 15/15] supplicant: Add state transition timestamps.

Jouni Malinen j at w1.fi
Sun Feb 8 14:35:27 EST 2015

On Sat, Jan 31, 2015 at 03:59:03PM -0800, Ben Greear wrote:
> I wanted to get the info through the wpa_cli API.  The idea is to be able to
> report the time it took to establish connection, do 4-way auth, anqp, etc.
> Parsing logs is too complex, fragile, and in-efficient, especially with lots of virtual
> stations.
> I will be happy to re-write it with inline methods.  I think I do want os_get_time()
> so I can compare time-stamps with other logs and other events if needed.

If you are reporting the time it took do something, that should use
os_get_reltime(). If you are reporting a timestamp for some specific
instance, that would be os_get_time(). The patch seemed to show mainly
timestamps, but that's something I'm not sure is really the best thing
to report if this is supposed to make it convenient for interface. I'd
again point at the log with timestamps as the source for raw timestamps,
if that is what you need here. I understand that it may be somewhat
inconvenient for large number of virtual stations.

Number of the values used just a snapshot of the last time something
happened. This may provide quite confusing results, e.g., when ANQP
query was used for some earlier connection and the latest association
did not use ANQP at all. Same would apply for number of other timestamps

As far as PRINT_TIME_STAMP() is concerned, it seems to be used floating
points unnecessarily. All existing cases of printing a timestamp use
integer values here ("%ld.%06y", (long) sec, (unsigned int) usec).

> My use case is generating better reports for testing, and aside from that, this
> feature is probably not that useful.  So, if you think some code cleanup would
> be good enough to get this in, then I will work on re-spinning the patches.
> But, if it is unlikely to ever be wanted upstream anyway, then please let me
> know up front and I'll try to remember not to submit it again :)

I'm not sure a simple cleanup would be sufficient to convince me that
this exact set of timestamps is a useful addition in upstream. Getting
rid of #ifdef/#endif with inline functions hiding that and moving the
results from STATUS to somewhere else (say, "STATUS-TIMESTAMPS") would
likely get quite a bit closer to getting at least some of this included,
Jouni Malinen                                            PGP id EFC895FA

More information about the HostAP mailing list