Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioping
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ioping
Commits
2c4f4f1d
Commit
2c4f4f1d
authored
Dec 30, 2013
by
Konstantin Khlebnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iopint: unhardcode units for printing device size
Signed-off-by:
Konstantin Khlebnikov
<
koct9i@gmail.com
>
parent
9172aae6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
ioping.c
ioping.c
+11
-10
No files found.
ioping.c
View file @
2c4f4f1d
...
...
@@ -382,6 +382,7 @@ long long now(void)
char
*
path
=
NULL
;
char
*
fstype
=
""
;
char
*
device
=
""
;
off_t
device_size
=
0
;
int
fd
;
void
*
buf
;
...
...
@@ -901,13 +902,9 @@ int main (int argc, char **argv)
if
(
fd
<
0
)
err
(
2
,
"failed to open
\"
%s
\"
"
,
path
);
st
.
st
_size
=
get_device_size
(
fd
,
&
st
);
device
_size
=
get_device_size
(
fd
,
&
st
);
st
.
st_size
=
device_size
;
fstype
=
"device"
;
device
=
malloc
(
32
);
if
(
!
device
)
err
(
2
,
"no mem"
);
snprintf
(
device
,
32
,
"%.1f Gb"
,
(
double
)
st
.
st_size
/
(
1ll
<<
30
));
}
else
{
errx
(
2
,
"unsupported destination:
\"
%s
\"
"
,
path
);
}
...
...
@@ -1008,8 +1005,10 @@ int main (int argc, char **argv)
if
(
!
quiet
)
{
print_size
(
ret_size
);
printf
(
" from %s (%s %s): request=%d time="
,
path
,
fstype
,
device
,
request
);
printf
(
" from %s (%s %s"
,
path
,
fstype
,
device
);
if
(
device_size
)
print_size
(
device_size
);
printf
(
"): request=%d time="
,
request
);
print_time
(
this_time
);
printf
(
"
\n
"
);
}
...
...
@@ -1079,8 +1078,10 @@ int main (int argc, char **argv)
time_min
,
time_avg
,
time_max
,
time_mdev
);
}
else
if
(
!
quiet
||
(
!
period_time
&&
!
period_request
))
{
printf
(
"
\n
--- %s (%s %s) ioping statistics ---
\n
"
,
path
,
fstype
,
device
);
printf
(
"
\n
--- %s (%s %s"
,
path
,
fstype
,
device
);
if
(
device_size
)
print_size
(
device_size
);
printf
(
") ioping statistics ---
\n
"
);
print_int
(
request
);
printf
(
" requests completed in "
);
print_time
(
time_total
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment