lkml.org 
[lkml]   [2020]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH net-next] net: phy: Maintain MDIO device and bus statistics
From
Date


On 1/12/2020 8:53 PM, Florian Fainelli wrote:
> Maintain per MDIO device and MDIO bus statistics comprised of the number
> of transfers/operations, reads and writes and errors. This is useful for
> tracking the per-device and global MDIO bus bandwidth and doing
> optimizations as necessary.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---

[snip]

> +#define MDIO_BUS_STATS_SHOW_NAME(name, file, field, format_string) \
> +static ssize_t mdio_bus_stats_##name##_show(struct mdio_bus_stats *s, \
> + char *buf) \
> +{ \
> + unsigned int start; \
> + ssize_t len; \
> + u64 tmp; \
> + do { \
> + start = u64_stats_fetch_begin(&s->syncp); \
> + tmp = u64_stats_read(&s->field); \
> + } while (u64_stats_fetch_retry(&s->syncp, start)); \
> + len = sprintf(buf, format_string ## "\n", tmp); \

^ ===== that hunk right there does not build, I sent a non-fixed up
patch, I would still appreciate comments though.
--
Florian

\
 
 \ /
  Last update: 2020-01-13 05:56    [W:0.060 / U:25.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site