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
772e8b33
Commit
772e8b33
authored
Jun 01, 2011
by
Konstantin Khlebnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use full working set range by default
parent
fa5463c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
ioping.c
ioping.c
+20
-11
No files found.
ioping.c
View file @
772e8b33
...
...
@@ -49,7 +49,7 @@ void usage(void)
" -p <period> print raw statistics for every <period> requests
\n
"
" -i <interval> interval between requests (1s)
\n
"
" -s <size> request size (4k)
\n
"
" -S <wsize> working set size (1m)
\n
"
" -S <wsize> working set size (1m
for dirs, full range for others
)
\n
"
" -o <offset> in file offset
\n
"
" -L use sequential operations rather than random
\n
"
" -C use cached-io
\n
"
...
...
@@ -181,7 +181,8 @@ long long interval = 1000000;
long
long
deadline
=
0
;
ssize_t
size
=
1
<<
12
;
ssize_t
wsize
=
1
<<
20
;
ssize_t
wsize
=
0
;
ssize_t
temp_wsize
=
1
<<
20
;
off_t
offset
=
0
;
off_t
woffset
=
0
;
...
...
@@ -219,13 +220,9 @@ void parse_options(int argc, char **argv)
break
;
case
's'
:
size
=
parse_size
(
optarg
);
if
(
size
>
wsize
)
wsize
=
size
;
break
;
case
'S'
:
wsize
=
parse_size
(
optarg
);
if
(
wsize
<
size
)
size
=
wsize
;
break
;
case
'o'
:
offset
=
parse_size
(
optarg
);
...
...
@@ -319,6 +316,14 @@ int main (int argc, char **argv)
parse_options
(
argc
,
argv
);
if
(
wsize
)
temp_wsize
=
wsize
;
else
if
(
size
>
temp_wsize
)
temp_wsize
=
size
;
if
(
size
<=
0
)
errx
(
1
,
"request size must be greather than zero"
);
flags
=
O_RDONLY
;
if
(
direct
)
flags
|=
O_DIRECT
;
...
...
@@ -328,7 +333,7 @@ int main (int argc, char **argv)
if
(
S_ISDIR
(
stat
.
st_mode
)
||
S_ISREG
(
stat
.
st_mode
))
{
if
(
S_ISDIR
(
stat
.
st_mode
))
stat
.
st_size
=
wsize
;
stat
.
st_size
=
offset
+
temp_
wsize
;
if
(
!
quiet
)
parse_device
(
stat
.
st_dev
);
}
else
if
(
S_ISBLK
(
stat
.
st_mode
))
{
...
...
@@ -349,10 +354,14 @@ int main (int argc, char **argv)
errx
(
1
,
"unsupported destination:
\"
%s
\"
"
,
path
);
}
if
(
wsize
>
stat
.
st_size
)
wsize
=
stat
.
st_size
;
if
(
size
>
stat
.
st_size
)
size
=
stat
.
st_size
;
if
(
offset
+
wsize
>
stat
.
st_size
)
errx
(
1
,
"target is too small for this"
);
if
(
!
wsize
)
wsize
=
stat
.
st_size
-
offset
;
if
(
size
>
wsize
)
errx
(
1
,
"request size is too big for this target"
);
buf
=
memalign
(
sysconf
(
_SC_PAGE_SIZE
),
size
);
if
(
!
buf
)
...
...
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