Changes

Jump to navigation Jump to search
805 bytes added ,  10:17, 27 March 2019
Line 4: Line 4:  
== Usage ==
 
== Usage ==
 
<pre>
 
<pre>
usage: crit [-h] [-i IN] [-o OUT] [-f {raw,nice}] {decode,encode}
+
usage: crit [-h] {decode,encode,info,x,show} ...
    
CRiu Image Tool
 
CRiu Image Tool
    
positional arguments:
 
positional arguments:
   {decode,encode}       decode/encode - convert criu image from/to binary type
+
   {decode,encode,info,x,show}
                        to/from json
+
                        Use crit CMD --help for command-specific help
 +
    decode             convert criu image from binary type to json
 +
    encode             convert criu image from json type to binary
 +
    info                show info about image
 +
    x                  explore image dir
 +
    show                convert criu image from binary to human-readable json
    
optional arguments:
 
optional arguments:
 
   -h, --help            show this help message and exit
 
   -h, --help            show this help message and exit
  -i IN, --in IN        input file (stdin by default)
  −
  -o OUT, --out OUT    output file (stdout by default)
  −
  --pretty              multi-line with indentation and some fields printed in more human-readable format
   
</pre>
 
</pre>
    
=== Pretty output ===
 
=== Pretty output ===
   −
By default CRIT prints JSON text in one line. This can be read by any further JSON-aware tool for parsing. For human eyes it's more convenient to read JSON multi-line with indentation. However, CRIT does a little bit more and prints some fields in even more pretty manner.
+
Command <decode> prints JSON text in one line. This can be read by any further JSON-aware tool for parsing. For human eyes it's more convenient to read JSON multi-line with indentation. CRIT can do this when using the <code>show</code> action or the <code>--pretty</code> option.
 +
 
 +
Wend doing pretty optput CRIT does a little bit more, than just multiline indented JSON.
    
; Addresses and registers
 
; Addresses and registers
Line 31: Line 35:  
; IP addresses
 
; IP addresses
 
: By default those a printed in decimal, but the "1.2.3.4" for v4 or "::1" for v6 can be seen in the --pretty mode.
 
: By default those a printed in decimal, but the "1.2.3.4" for v4 or "::1" for v6 can be seen in the --pretty mode.
 +
 +
; Symbolic names for flags
 +
: Some known bit sets (e.g. MAP_PRIVATE, MAP_ANONYMOUS, etc. for vma->flags) are shown with names.
 +
 +
; Device numbers
 +
: If the field is known to be of <code>dev_t</code> type, it's printed in the <code>major:minor</code> manner
    
== Functionality ==
 
== Functionality ==
Line 36: Line 46:  
=== Convert images to JSON and back ===
 
=== Convert images to JSON and back ===
   −
{{Status|ready}}
     −
This is the replacement for (rather nasty) criu show code. Also this is the way to edit the images before restoring from them.
+
This is the replacement for (rather nasty) <code>criu show</code> code. Also this is the way to edit the images before restoring from them.
    
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.
 
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.
Line 407: Line 416:  
=== Generate core files out of task images ===
 
=== Generate core files out of task images ===
   −
{{Status|in progress}}
+
Moved into separate project called [[criu-coredump]].
   −
All the needed information is in core-$pid.img and pagemap-$pid.img
+
=== Show images statistics ===
   −
=== On-the-fly conversion ===
+
E.g. -- total number of processes, files, memory, sockets, etc.
 +
Use
 +
<pre>
 +
crit x $directory_with_images <explore type>
 +
</pre>
   −
{{Status|not ready}}
+
Supported explorers are
 +
;'ps'
 +
:to show process tree
   −
There's an idea to make CRIU spawn CRIT and read images "through" it, to allow for at-the-restore-time modifications
+
;'fds'
 +
:to show files used by tasks
   −
=== Convert between different image versions ===
+
;'mems'
 +
:to show memory mappings info
   −
{{Status|not ready}}
+
== Planned functionality ==
   −
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.
+
=== On-the-fly conversion ===
   −
=== Show images statistics ===
+
There's an idea to make CRIU spawn CRIT and read images "through" it, to allow for at-the-restore-time modifications. For details, see https://github.com/xemul/criu/issues/59.
   −
{{Status|not ready}}
+
=== Convert between different image versions ===
   −
E.g. -- total number of processes, files, memory, sockets, etc.
+
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.
    
=== Check/validate images ===
 
=== Check/validate images ===
  −
{{Status|not ready}}
      
Check that
 
Check that
 
* all images are present
 
* all images are present
 
* the inter-images IDs are in consistent state
 
* the inter-images IDs are in consistent state
 +
 +
For details, see https://github.com/xemul/criu/issues/44.
 +
 +
=== [[Anonymize image files]] ===
 +
 +
Since images contain raw memory dumps people may refuse to send us images for debugging. Need to anonymize them, i.e. -- remove this sensitive information.
    
[[Category:Images]]
 
[[Category:Images]]
 
[[Category:API]]
 
[[Category:API]]

Navigation menu