public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Racz Zoltan <racz.zoli@gmail.com>
To: dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org, Racz Zoltan <racz.zoli@gmail.com>
Subject: [PATCH 0/6] btrfs-progs: V2 scrub status: add json output format
Date: Fri, 14 Feb 2025 18:47:03 +0200	[thread overview]
Message-ID: <20250214164709.51465-1-racz.zoli@gmail.com> (raw)

This patchset is a follow-up to the json output implementation sent
earlier this week. It uses the new fmt_print format types (duration
and date-time).

The patchset also relies on the following patches:
[PATCH] btrfs-progs: add duration format to fmt_print
[PATCH] btrfs-progs: change print format for btrfs_scrub_progress struct keys in print_scrub_full()
[PATCH] btrfs-progs: Simplified unit_mode check in print_scrub_summary

Example usages:

1. ./btrfs --format json scrub status /
Result:
{
  "__header": {
    "version": "1"
  },
  "scrub-status": {
    "uuid": "1a7d1bc4-c212-42bf-b05c-73bd313d3ecd",
    "info": {
      "started-at": "2025-02-11 00:27:01 +0200",
      "status": "finished",
      "duration": "00:00:15"
    },
    "scrub": {
      "total-bytes-to-scrub": 84444946432,
      "rate": 4726353100
    }
  }
}

2. ./btrfs --format json scrub status / -R
Result:
{
  "__header": {
    "version": "1"
  },
  "scrub-status": {
    "uuid": "1a7d1bc4-c212-42bf-b05c-73bd313d3ecd",
    "info": {
      "started-at": "2025-02-11 00:27:01 +0200",
      "status": "finished",
      "duration": "00:00:15"
    },
    "scrub": {
      "data-extents-scrubbed": 1507393,
      "tree-extents-scrubbed": 108172,
      "data-bytes-scrubbed": 69123006464,
      "tree-bytes-scrubbed": 1772290048,
      "read-errors": 0,
      "csum-errors": 0,
      "verify-errors": 0,
      "no-csum": 107693,
      "csum-discards": 0,
      "super-errors": 0,
      "malloc-errors": 0,
      "uncorrectable-errors": 0,
      "unverified-errors": 0,
      "corrected-errors": 0,
      "last-physical": 159691177984
    }
  }
}

3. ./btrfs --format json scrub status / -d
Result:
{
  "__header": {
    "version": "1"
  },
  "scrub-status": {
    "uuid": "1a7d1bc4-c212-42bf-b05c-73bd313d3ecd",
    "devices": [
      {
        "device": {
          "dev": "/dev/nvme0n1p3",
          "id": 1,
          "info": {
            "started-at": "2025-02-11 00:27:01 +0200",
            "status": "finished",
            "duration": "00:00:15"
          },
          "scrub": {
            "total-bytes-to-scrub": 70895296512,
            "rate": 4726353100
          }
        }
      }
    ]
  }
}


Racz Zoltan (6):
  Added rowspec struct and neccesary include file for json output format
  Added json output format for print_scrub_full
  Added json output format for print_scrub_summary
  Added json output format for _print_scrub_ss and print_scrub_dev
  Added json output format for cmd_scrub_status
  Corrected a minor JSON string error in print_scrub_dev

 cmds/scrub.c | 307 +++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 235 insertions(+), 72 deletions(-)

-- 
2.48.1


             reply	other threads:[~2025-02-14 16:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14 16:47 Racz Zoltan [this message]
2025-02-14 16:47 ` [PATCH 1/6] btrfs-progs: Added rowspec struct and neccesary include file for json output format Racz Zoltan
2025-02-14 16:47 ` [PATCH 2/6] btrfs-progs: Added json output format for print_scrub_full Racz Zoltan
2025-02-14 16:47 ` [PATCH 3/6] btrfs-progs: Added json output format for print_scrub_summary Racz Zoltan
2025-02-14 16:47 ` [PATCH 4/6] btrfs-progs: Added json output format for _print_scrub_ss and print_scrub_dev Racz Zoltan
2025-02-14 16:47 ` [PATCH 5/6] btrfs-progs: Added json output format for cmd_scrub_status Racz Zoltan
2025-02-14 16:47 ` [PATCH 6/6] btrfs-progs: Corrected a minor JSON string error in print_scrub_dev Racz Zoltan

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=20250214164709.51465-1-racz.zoli@gmail.com \
    --to=racz.zoli@gmail.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.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