Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 302638 Details for
Bug 404831
"nfsstat -s" shows negative value
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch -- parse and print values correctly
0001-nfs-utils-make-nfsstat-read-and-print-stats-as-unsi.patch (text/plain), 2.26 KB, created by
Jeff Layton
on 2008-04-16 16:45:14 UTC
(
hide
)
Description:
patch -- parse and print values correctly
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2008-04-16 16:45:14 UTC
Size:
2.26 KB
patch
obsolete
>From cd712dc28bebbb57786b6a3e7221935f735f5f59 Mon Sep 17 00:00:00 2001 >From: Jeff Layton <jlayton@redhat.com> >Date: Wed, 16 Apr 2008 12:39:12 -0400 >Subject: [PATCH] nfs-utils: make nfsstat read and print stats as unsigned integers (try #2) > >The nfsstat program reads /proc/net/rpc/* files to gets info about >calls. This info is output as unsigned numbers (at least on any >relatively recent kernel). When nfsstat prints these numbers, they are >printed as signed integers. When the call counters reach 2^31, things >start being printed as negative numbers. > >This patch changes nfsstat to read and print all counters as unsigned >integers. Tested by hacking up a kernel to initialize call counters to >2^31+1. > >Thanks to Takafumi Miki for the initial version of this patch. > >Signed-off-by: Jeff Layton <jlayton@redhat.com> >--- > utils/nfsstat/nfsstat.c | 9 +++++---- > 1 files changed, 5 insertions(+), 4 deletions(-) > >diff --git a/utils/nfsstat/nfsstat.c b/utils/nfsstat/nfsstat.c >index aa6c961..953e4a5 100644 >--- a/utils/nfsstat/nfsstat.c >+++ b/utils/nfsstat/nfsstat.c >@@ -539,7 +539,7 @@ print_numbers(const char *hdr, unsigned int *info, unsigned int nr) > > fputs(hdr, stdout); > for (i = 0; i < nr; i++) >- printf("%s%-8d", i? " " : "", info[i]); >+ printf("%s%-8u", i? " " : "", info[i]); > printf("\n"); > } > >@@ -562,7 +562,7 @@ print_callstats(const char *hdr, const char **names, > printf("\n"); > for (j = 0; j < 6 && i + j < nr; j++) { > pct = ((unsigned long long) info[i+j]*100)/total; >- printf("%-8d%3llu%% ", info[i+j], pct); >+ printf("%-8u%3llu%% ", info[i+j], pct); > } > printf("\n"); > } >@@ -604,7 +604,7 @@ parse_raw_statfile(const char *name, struct statinfo *statp) > for (i = 0; i < cnt; i++) { > if (!(sp = strtok(NULL, " \t"))) > break; >- ip->valptr[i] = atoi(sp); >+ ip->valptr[i] = (unsigned int) strtoul(sp, NULL, 0); > total += ip->valptr[i]; > } > ip->valptr[cnt - 1] = total; >@@ -618,7 +618,8 @@ parse_raw_statfile(const char *name, struct statinfo *statp) > static int > parse_pretty_statfile(const char *filename, struct statinfo *info) > { >- int numvals, curindex, numconsumed, n, sum, err = 1; >+ int numvals, curindex, numconsumed, n, err = 1; >+ unsigned int sum; > char buf[4096], *bufp, *fmt, is_proc; > FILE *fp = NULL; > struct statinfo *ip; >-- >1.5.3.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 404831
:
273161
|
302629
|
302630
| 302638