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
bd1d6186
Commit
bd1d6186
authored
May 09, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stats: Write dump stats after dump is finished
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
d770f4ef
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
cr-dump.c
cr-dump.c
+4
-1
stats.h
include/stats.h
+3
-0
stats.c
stats.c
+23
-0
No files found.
cr-dump.c
View file @
bd1d6186
...
...
@@ -59,6 +59,7 @@
#include "file-lock.h"
#include "page-xfer.h"
#include "kerndat.h"
#include "stats.h"
#include "asm/dump.h"
...
...
@@ -1638,8 +1639,10 @@ err:
if
(
ret
)
{
kill_inventory
();
pr_err
(
"Dumping FAILED.
\n
"
);
}
else
}
else
{
write_stats
(
DUMP_STATS
);
pr_info
(
"Dumping finished successfully
\n
"
);
}
return
ret
;
}
include/stats.h
View file @
bd1d6186
#ifndef __CR_STATS_H__
#define __CR_STATS_H__
void
show_stats
(
int
fd
);
#define DUMP_STATS 1
void
write_stats
(
int
what
);
#endif
stats.c
View file @
bd1d6186
#include <unistd.h>
#include "protobuf.h"
#include "stats.h"
#include "crtools.h"
#include "protobuf/stats.pb-c.h"
void
show_stats
(
int
fd
)
{
pb_show_vertical
(
fd
,
PB_STATS
);
}
void
write_stats
(
int
what
)
{
StatsEntry
stats
=
STATS_ENTRY__INIT
;
DumpStatsEntry
dstats
=
DUMP_STATS_ENTRY__INIT
;
char
*
name
;
int
fd
;
pr_info
(
"Writing stats
\n
"
);
if
(
what
==
DUMP_STATS
)
{
stats
.
dump
=
&
dstats
;
name
=
"dump"
;
}
else
return
;
fd
=
open_image
(
CR_FD_STATS
,
O_DUMP
,
name
);
if
(
fd
>=
0
)
{
pb_write_one
(
fd
,
&
stats
,
PB_STATS
);
close
(
fd
);
}
}
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