Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
888bc286
Commit
888bc286
authored
Jul 11, 2012
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check: Add check for evetfd is shown proerly in fdinfo
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
feb6624d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
cr-check.c
cr-check.c
+47
-0
No files found.
cr-check.c
View file @
888bc286
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/eventfd.h>
#include <fcntl.h>
#include "proc_parse.h"
#include "sockets.h"
...
...
@@ -10,6 +11,7 @@
#include "syscall.h"
#include "files.h"
#include "sk-inet.h"
#include "proc_parse.h"
static
int
check_map_files
(
void
)
{
...
...
@@ -140,6 +142,50 @@ static int check_proc_stat(void)
return
0
;
}
static
int
check_one_fdinfo
(
union
fdinfo_entries
*
e
,
void
*
arg
)
{
*
(
int
*
)
arg
=
(
int
)
e
->
efd
.
counter
;
return
0
;
}
static
int
check_fdinfo_eventfd
(
void
)
{
int
fd
,
ret
;
int
cnt
=
13
,
proc_cnt
=
0
;
fd
=
eventfd
(
cnt
,
0
);
if
(
fd
<
0
)
{
pr_perror
(
"Can't make eventfd"
);
return
-
1
;
}
ret
=
parse_fdinfo
(
fd
,
FDINFO_EVENTFD
,
check_one_fdinfo
,
&
proc_cnt
);
close
(
fd
);
if
(
ret
)
{
pr_err
(
"Error parsing proc fdinfo
\n
"
);
return
-
1
;
}
if
(
proc_cnt
!=
cnt
)
{
pr_err
(
"Counter mismatch (or not met) %d want %d
\n
"
,
proc_cnt
,
cnt
);
return
-
1
;
}
pr_info
(
"Eventfd fdinfo works OK (%d vs %d)
\n
"
,
cnt
,
proc_cnt
);
return
0
;
}
static
int
check_fdinfo_ext
(
void
)
{
int
ret
=
0
;
ret
|=
check_fdinfo_eventfd
();
return
ret
;
}
int
cr_check
(
void
)
{
int
ret
=
0
;
...
...
@@ -153,6 +199,7 @@ int cr_check(void)
ret
|=
check_fcntl
();
ret
|=
check_proc_stat
();
ret
|=
check_tcp_repair
();
ret
|=
check_fdinfo_ext
();
if
(
!
ret
)
pr_msg
(
"Looks good.
\n
"
);
...
...
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