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
18cf145c
Commit
18cf145c
authored
Mar 24, 2012
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show: Print fdinfo types as names, not numbers
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
7a451ff1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
cr-show.c
cr-show.c
+18
-2
No files found.
cr-show.c
View file @
18cf145c
...
@@ -54,6 +54,22 @@
...
@@ -54,6 +54,22 @@
static
char
local_buf
[
PAGE_SIZE
];
static
char
local_buf
[
PAGE_SIZE
];
static
LIST_HEAD
(
pstree_list
);
static
LIST_HEAD
(
pstree_list
);
static
char
*
fdtype2s
(
u8
type
)
{
static
char
und
[
4
];
static
char
*
fdtypes
[]
=
{
[
FDINFO_REG
]
=
"reg"
,
[
FDINFO_MAP
]
=
"map"
,
[
FDINFO_CWD
]
=
"cwd"
,
[
FDINFO_EXE
]
=
"exe"
,
};
if
(
type
>
FDINFO_UND
&&
type
<
FD_INFO_MAX
)
return
fdtypes
[
type
];
snprintf
(
und
,
sizeof
(
und
),
"x%02d
\n
"
,
(
int
)
type
);
return
und
;
}
static
void
show_files
(
int
fd_files
)
static
void
show_files
(
int
fd_files
)
{
{
struct
fdinfo_entry
e
;
struct
fdinfo_entry
e
;
...
@@ -67,9 +83,9 @@ static void show_files(int fd_files)
...
@@ -67,9 +83,9 @@ static void show_files(int fd_files)
if
(
ret
<=
0
)
if
(
ret
<=
0
)
goto
out
;
goto
out
;
pr_msg
(
"type: %
02x
len: %02x flags: %4x pos: %8x "
pr_msg
(
"type: %
s
len: %02x flags: %4x pos: %8x "
"addr: %16lx id: %16lx"
,
"addr: %16lx id: %16lx"
,
e
.
type
,
e
.
len
,
e
.
flags
,
e
.
pos
,
e
.
addr
,
e
.
id
);
fdtype2s
(
e
.
type
)
,
e
.
len
,
e
.
flags
,
e
.
pos
,
e
.
addr
,
e
.
id
);
if
(
e
.
len
)
{
if
(
e
.
len
)
{
int
ret
=
read
(
fd_files
,
local_buf
,
e
.
len
);
int
ret
=
read
(
fd_files
,
local_buf
,
e
.
len
);
...
...
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