linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question about /proc/partitions
@ 2003-11-02 16:23 Gwénaël Cotrez
  0 siblings, 0 replies; only message in thread
From: Gwénaël Cotrez @ 2003-11-02 16:23 UTC (permalink / raw)
  To: linux-kernel

Hi,
I'm developing a system accounting, which get informations about I/O in
/proc/partitions.
But, I've noticed that sometimes this system returns informations about negative
I/O.
I find this in in the kernel tree source :
http://lxr.linux.no/source/include/linux/genhd.h?v=2.4.22#L61

61 struct hd_struct {
...........
69         /* Performance stats: */
70         unsigned int ios_in_flight;
71         unsigned int io_ticks;
72         unsigned int last_idle_time;
73         unsigned int last_queue_change;
74         unsigned int aveq;
75        
76         unsigned int rd_ios;
77         unsigned int rd_merges;
78         unsigned int rd_ticks;
79         unsigned int rd_sectors;
80         unsigned int wr_ios;
81         unsigned int wr_merges;
82         unsigned int wr_ticks;
83         unsigned int wr_sectors;       
84 #endif /* CONFIG_BLK_STATS */
85 };

but in http://lxr.linux.no/source/drivers/block/genhd.c?v=2.4.22#L181

static int part_show(struct seq_file *s, void *v)
.............
189 #ifdef CONFIG_BLK_STATS
190                             "     rio rmerge rsect ruse wio wmerge "
191                             "wsect wuse running use aveq"
......
203                         seq_printf(s, "%4d  %4d %10d %s "                  
                <------
204                                       "%d %d %d %d %d %d %d %d %d %d %d\n",
     <------
205                                       gp->major, n, gp->sizes[n],
206                                       disk_name(gp, n, buf),
207                                       hd->rd_ios, hd->rd_merges,
208 #define MSEC(x) ((x) * 1000 / HZ)
209                                       hd->rd_sectors, MSEC(hd->rd_ticks),
210                                       hd->wr_ios, hd->wr_merges,
211                                       hd->wr_sectors, MSEC(hd->wr_ticks),
212                                       hd->ios_in_flight, MSEC(hd->io_ticks),
213                                       MSEC(hd->aveq));
.....................
223 }

I think that negative I/O result of the usage of %d in seq_printf function for
variable declared as  unsigned int.
Somebody could confirm me this

Thank's


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-02 16:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-02 16:23 Question about /proc/partitions Gwénaël Cotrez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).