Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
L
libgtop
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 46
    • Issues 46
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 5
    • Merge Requests 5
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • libgtop
  • Issues
  • #25

Closed
Open
Opened Mar 28, 2012 by bugzilla-migration@bugzilla-migrationReporter

read, write values in glibtop_fsusage are in units of sectors, not block size

Submitted by MT

Link to original bug (#672995)

Description

The read and write counters should show the number of blocks read. But on Linux systems (I haven't verified for other platforms), the values are parsed via the sysfs interface and are in units of 512-byte sectors, not the standard 4096-byte block size. So either the code in sysdeps/linux/fsusage.c, or the comment description of the read and write variables, needs to be corrected to avoid any confusion.

From include/glibtop/fsusage.h:

struct _glibtop_fsusage { guint64 flags; guint64 blocks; /* Total number of blocks. / guint64 bfree; / Free blocks available to superuser. / guint64 bavail; / Free blocks available to non-superuser. / guint64 files; / Total file nodes. / guint64 ffree; / Free file nodes. / guint32 block_size; / Size of a block in bytes. / guint64 read, write; / Total blocks read and written */ };

From the kernel documentation (block/stat.txt):

read sectors, write sectors

These values count the number of sectors read from or written to this block device. The "sectors" in question are the standard UNIX 512-byte sectors, not any device- or filesystem-specific block size. The counters are incremented when the I/O completes.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/libgtop#25