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
94c6d773
Commit
94c6d773
authored
Mar 15, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shmem: Split shmem dumping code into two
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
9486946b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
shmem.c
shmem.c
+21
-12
No files found.
shmem.c
View file @
94c6d773
...
...
@@ -291,21 +291,14 @@ int add_shmem_area(pid_t pid, VmaEntry *vma)
return
0
;
}
#define for_each_shmem_dump(_i, _si) \
for (i = 0; i < SHMEM_HASH_SIZE; i++) \
for (si = shmems_hash[i]; si; si = si->next)
int
cr_dump_shmem
(
void
)
static
int
dump_one_shmem
(
struct
shmem_info_dump
*
si
)
{
int
i
,
err
,
fd
,
fd_pg
;
PagemapEntry
pe
=
PAGEMAP_ENTRY__INIT
;
int
err
,
fd
,
fd_pg
;
unsigned
char
*
map
=
NULL
;
void
*
addr
=
NULL
;
struct
shmem_info_dump
*
si
;
unsigned
long
pfn
,
nrpages
;
for_each_shmem_dump
(
i
,
si
)
{
PagemapEntry
pe
=
PAGEMAP_ENTRY__INIT
;
pr_info
(
"Dumping shared memory 0x%lx
\n
"
,
si
->
shmid
);
nrpages
=
(
si
->
size
+
PAGE_SIZE
-
1
)
/
PAGE_SIZE
;
...
...
@@ -375,8 +368,6 @@ int cr_dump_shmem(void)
close
(
fd
);
munmap
(
addr
,
si
->
size
);
xfree
(
map
);
}
return
0
;
err_close2:
...
...
@@ -389,3 +380,21 @@ err:
xfree
(
map
);
return
-
1
;
}
#define for_each_shmem_dump(_i, _si) \
for (i = 0; i < SHMEM_HASH_SIZE; i++) \
for (si = shmems_hash[i]; si; si = si->next)
int
cr_dump_shmem
(
void
)
{
int
ret
=
0
,
i
;
struct
shmem_info_dump
*
si
;
for_each_shmem_dump
(
i
,
si
)
{
ret
=
dump_one_shmem
(
si
);
if
(
ret
)
break
;
}
return
ret
;
}
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