Commit graph

16 commits

Author SHA1 Message Date
Pavel Emelyanov
25a978d32e crit: The 'mems' explorer
This one prints the /proc/pid/maps-like output, but with slightly more
details. Like this

1
	exe                                     /zdtm/live/static/maps00
	00400000-00406000                   r-x /zdtm/live/static/maps00
	00605000-00606000                   r-- /zdtm/live/static/maps00 + 0x5000
	00606000-00607000                   rw- /zdtm/live/static/maps00 + 0x6000
	7f4037845000-7f40379f9000           r-x /lib64/libc.so.6
	7f40379f9000-7f4037bf8000           --- /lib64/libc.so.6 + 0x1b4000
	7f4037bf8000-7f4037bfc000           r-- /lib64/libc.so.6 + 0x1b3000
	7f4037bfc000-7f4037bfe000           rw- /lib64/libc.so.6 + 0x1b7000
	7f4037bfe000-7f4037c03000           rw-
	7f4037c03000-7f4037c23000           r-x /lib64/ld-linux-x86-64.so.2
	7f4037e1e000-7f4037e22000           rw-
	7f4037e22000-7f4037e23000           r-- /lib64/ld-linux-x86-64.so.2 + 0x1f000
	7f4037e23000-7f4037e24000           rw- /lib64/ld-linux-x86-64.so.2 + 0x20000
	7f4037e24000-7f4037e25000           rw-
	7fff34652000-7fff34699000           rw- [stack?]
	7fff346e2000-7fff346e4000           r--
	7fff346e4000-7fff346e6000           r-x [vdso]
	ffffffffff600000-ffffffffff601000   r-x [vsyscall] *

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-16 18:14:57 +03:00
Pavel Emelyanov
6c8f7bbb29 crit: The 'fds' explorer
Shows files opened by tasks. The output is like

1
	      0: /dev/null
	      1: /zdtm/live/static/session00.outns
	      2: /zdtm/live/static/session00.outns
	    cwd: /zdtm/live/static
	   root: /
6
	      0: /dev/null
	      1: /zdtm/live/static/session00.out.inprogress
	      2: /zdtm/live/static/session00.out.inprogress
	      3: pipe[18305]
	    cwd: /zdtm/live/static
	   root: /
10
	      0: /dev/null
	      1: /zdtm/live/static/session00.out.inprogress
	      2: /zdtm/live/static/session00.out.inprogress
	      3: pipe[18308]
	    cwd: /zdtm/live/static
	   root: /

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Appreciated-by: avagin@openvz.org
2015-12-16 18:14:56 +03:00
Pavel Emelyanov
022baf868b crit: The 'ps' explorer
Shows process tree from image. The output is like

    PID   PGID    SID   COMM
      1      1      1   session00
      4      4      4       session00
      7      7      7           session00
      8      4      4           session00
     11     11     11           session00
     12      4      4               session00
     13     13     13           session00
     14     14     14               session00
     15      4      4                   session00
      6      4      4       session00
     10      9      9       session00

(the above is for session00 test).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Appreciated-by: avagin@openvz.org
2015-12-16 18:14:55 +03:00
Pavel Emelyanov
075c1c9f08 crit: Explore action and stubs
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Appreciated-by: avagin@openvz.org
2015-12-16 18:14:54 +03:00
Kir Kolyshkin
01a99c0a63 crit: fix decode usage help
Was:
    decode              convert criu image from binary type json

Now:
    decode              convert criu image from binary type to json

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-11-05 15:24:04 +03:00
Pavel Emelyanov
d2f8f481c7 crit: Introduce 'info' action
This should print some information about image file itself, e.g.
statistical information. Right now print magic and the number of
object written in the file.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-09-21 11:51:39 +03:00
Tycho Andersen
1de38f344d crit: add a show option for human consumption
This saves some keystrokes and is equivalent to decode --pretty.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-23 15:15:27 +03:00
Pavel Emelyanov
dbda403b8d crit: Avoid full exception trace when meeting unknown magic in image (v2)
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
2015-05-30 00:32:27 +03:00
Ruslan Kuprieiev
0b08bcfcad crit: gather and parse arguments in a proper way
This will allow us to easily extend commands that crit
supports, avoiding "--help" confusion.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-02-09 14:08:22 +03:00
Pavel Emelyanov
0d2aeb3581 crit: Get rid of --format option
I plan to mark some fields as IP address and print them respectively.
The --format hex is not nice switch for this and introducing one more
(--format hex ipadd) is too bad.

So let's fix the cirt API to be simple and stupid. By default crit
generates canonical one-line JSON. With --pretty option it splits the
output into lines, adds indentation and prints hex as hex and IP as
IP.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Ruslan Kuprieiev <kupruser@gmail.com>
2015-01-29 18:47:13 +03:00
Ruslan Kuprieiev
87da3e3437 crit: add --format hex option
Pavel reported that decimal values for some fields are hard to read,
because people used to see hex values in there. Unfortunately, json
doesn't support hex representation of integers, so we can only store
them as hex strings. Not all field need to be represented as hex
strings, so this set introduces a custom field option called "criu"
to use in our proto files. One should use [(criu).hex = true] to mark
which field should be represented as a hex string. pb2dict module
from pycriu package will look into field options and if he finds that
criu.hex is set to True, it will convert such field to/from hex string.
Though, such behaviour is optional and user can request it by specifying
 --format hex when calling crit decode("crit encode" in its turn, detects
such fields automatically and doesn't require any special cmdline options
to be set).

We need our proto files to compile with both protoc and
protoc-c compilers, which requires creating google/protobuf
directory with a symlink to /usr/include/google/protobuf/
descriptor.proto to make protoc-c and generated c files happy.

Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-01-19 18:13:55 +04:00
Pavel Emelyanov
7b4a264e28 crit: Small inf/outf evaluation cleanup
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-01-15 19:51:18 +03:00
Ruslan Kuprieiev
1a30e8800e crit: fix typo
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-01-14 20:47:47 +04:00
Ruslan Kuprieiev
7a8ddc0f4a crit: split convert command into decode and encode
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-01-14 20:47:46 +04:00
Ruslan Kuprieiev
912f1a5afb crit: print new line if orig_type == bin and using stdout
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-01-14 20:47:43 +04:00
Ruslan Kuprieiev
d36994c4c3 crit: add crit
crit is a python script that helps user to manipulate criu
images. For now, it can only convert criu images to\from
human-readable format using pycriu.images module.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-01-14 20:44:47 +04:00