public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Stephen Hemminger" <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, "Andrew Rybchenko" <andrew.rybchenko@oktetlabs.ru>
Subject: RE: [PATCH] mempool: introduce statistics reset function
Date: Mon, 23 Feb 2026 19:14:21 +0100	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35F6573F@smartserver.smartshare.dk> (raw)
In-Reply-To: <20260223092102.20446fa4@phoenix.local>

> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Monday, 23 February 2026 18.21
> 
> On Mon, 23 Feb 2026 10:20:54 +0000
> Morten Brørup <mb@smartsharesystems.com> wrote:
> 
> > +	fprintf(f, "    avg objs/bulk put=%#Lf, get=%#Lf,
> get_fail=%#Lf\n",
> > +			sum.put_bulk != 0 ? (long double)sum.put_objs /
> sum.put_bulk : 0,
> > +			sum.get_success_bulk != 0 ?
> > +			(long double)sum.get_success_objs /
> sum.get_success_bulk : 0,
> > +			sum.get_fail_bulk != 0 ?
> > +			(long double)sum.get_fail_objs / sum.get_fail_bulk :
> 0);
> > +	fprintf(f, "    avg common_pool objs/bulk put=%#Lf, get=%#Lf\n",
> > +			sum.put_common_pool_bulk != 0 ?
> > +			(long double)sum.put_common_pool_objs /
> sum.put_common_pool_bulk : 0,
> > +			sum.get_common_pool_bulk != 0 ?
> > +			(long double)sum.get_common_pool_objs /
> sum.get_common_pool_bulk : 0);
> > +	fprintf(f, "    avg cache miss rate put_objs=%s%#Lf,
> get_objs=%s%#Lf\n",
> > +			sum.put_common_pool_objs != 0 ? "1/" : "",
> > +			sum.put_common_pool_objs != 0 ?
> > +			(long double)sum.put_objs / sum.put_common_pool_objs
> : 0,
> > +			sum.get_common_pool_objs != 0 ? "1/" : "",
> > +			sum.get_common_pool_objs != 0 ?
> > +			(long double)sum.get_success_objs /
> sum.get_common_pool_objs : 0);
> > +	fprintf(f, "    avg cache miss rate put_bulk=%s%#Lf,
> get_bulk=%s%#Lf\n",
> > +			sum.put_common_pool_bulk != 0 ? "1/" : "",
> > +			sum.put_common_pool_bulk != 0 ?
> > +			(long double)sum.put_bulk / sum.put_common_pool_bulk
> : 0,
> > +			sum.get_common_pool_bulk != 0 ? "1/" : "",
> > +			sum.get_common_pool_bulk != 0 ?
> > +			(long double)sum.get_success_bulk /
> sum.get_common_pool_bulk : 0);
> 
> This is getting verbose, would look better as function or better yet
> table driven.

Dump outputs are formatted as hierarchy, like this, so table is a no-go.
Only the last two are similar, and could share a macro/function, but I think it would make the code less readable.


  reply	other threads:[~2026-02-23 18:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 10:20 [PATCH] mempool: introduce statistics reset function Morten Brørup
2026-02-23 17:21 ` Stephen Hemminger
2026-02-23 18:14   ` Morten Brørup [this message]
2026-02-24  6:29 ` Andrew Rybchenko
2026-02-24  6:38   ` Morten Brørup
2026-02-24  6:50     ` Andrew Rybchenko
2026-02-24  9:28 ` [PATCH v2] " Morten Brørup
2026-02-24  9:57   ` Andrew Rybchenko
2026-02-27  9:20   ` fengchengwen
2026-02-27 21:24     ` Morten Brørup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98CBD80474FA8B44BF855DF32C47DC35F6573F@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox