Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Chen Yisong
lxc
Commits
534a6aaf
Unverified
Commit
534a6aaf
authored
Nov 28, 2017
by
AustinReichert
Committed by
Christian Brauner
Dec 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/lxc_top: removed internal logging
Signed-off-by:
AustinReichert
<
austinskyreichert@utexas.edu
>
parent
0571062f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
lxc_top.c
src/lxc/tools/lxc_top.c
+10
-12
No files found.
src/lxc/tools/lxc_top.c
View file @
534a6aaf
...
...
@@ -38,8 +38,6 @@
#include "mainloop.h"
#include "utils.h"
lxc_log_define
(
lxc_top_ui
,
lxc
);
#define USER_HZ 100
#define ESC "\033"
#define TERMCLEAR ESC "[H" ESC "[J"
...
...
@@ -129,12 +127,12 @@ static int stdin_tios_setup(void)
struct
termios
newtios
;
if
(
!
isatty
(
0
))
{
ERROR
(
"stdin is not a tty
"
);
fprintf
(
stderr
,
"stdin is not a tty
\n
"
);
return
-
1
;
}
if
(
tcgetattr
(
0
,
&
oldtios
))
{
SYSERROR
(
"failed to get current terminal settings
"
);
fprintf
(
stderr
,
"failed to get current terminal settings
\n
"
);
return
-
1
;
}
...
...
@@ -148,7 +146,7 @@ static int stdin_tios_setup(void)
newtios
.
c_cc
[
VTIME
]
=
0
;
if
(
tcsetattr
(
0
,
TCSAFLUSH
,
&
newtios
))
{
ERROR
(
"failed to set new terminal settings
"
);
fprintf
(
stderr
,
"failed to set new terminal settings
\n
"
);
return
-
1
;
}
...
...
@@ -213,7 +211,7 @@ static uint64_t stat_get_int(struct lxc_container *c, const char *item)
len
=
c
->
get_cgroup_item
(
c
,
item
,
buf
,
sizeof
(
buf
));
if
(
len
<=
0
)
{
ERROR
(
"unable to read cgroup item %s
"
,
item
);
fprintf
(
stderr
,
"unable to read cgroup item %s
\n
"
,
item
);
return
0
;
}
...
...
@@ -232,7 +230,7 @@ static uint64_t stat_match_get_int(struct lxc_container *c, const char *item,
len
=
c
->
get_cgroup_item
(
c
,
item
,
buf
,
sizeof
(
buf
));
if
(
len
<=
0
)
{
ERROR
(
"unable to read cgroup item %s
"
,
item
);
fprintf
(
stderr
,
"unable to read cgroup item %s
\n
"
,
item
);
goto
out
;
}
...
...
@@ -411,13 +409,13 @@ static void ct_realloc(int active_cnt)
ct_free
();
ct
=
realloc
(
ct
,
sizeof
(
*
ct
)
*
active_cnt
);
if
(
!
ct
)
{
ERROR
(
"cannot alloc mem
"
);
fprintf
(
stderr
,
"cannot alloc mem
\n
"
);
exit
(
EXIT_FAILURE
);
}
for
(
i
=
0
;
i
<
active_cnt
;
i
++
)
{
ct
[
i
].
stats
=
malloc
(
sizeof
(
*
ct
[
0
].
stats
));
if
(
!
ct
[
i
].
stats
)
{
ERROR
(
"cannot alloc mem
"
);
fprintf
(
stderr
,
"cannot alloc mem
\n
"
);
exit
(
EXIT_FAILURE
);
}
}
...
...
@@ -437,7 +435,7 @@ int main(int argc, char *argv[])
ct_print_cnt
=
stdin_tios_rows
()
-
3
;
/* 3 -> header and total */
if
(
stdin_tios_setup
()
<
0
)
{
ERROR
(
"failed to setup terminal
"
);
fprintf
(
stderr
,
"failed to setup terminal
\n
"
);
goto
out
;
}
...
...
@@ -447,13 +445,13 @@ int main(int argc, char *argv[])
signal
(
SIGQUIT
,
sig_handler
);
if
(
lxc_mainloop_open
(
&
descr
))
{
ERROR
(
"failed to create mainloop
"
);
fprintf
(
stderr
,
"failed to create mainloop
\n
"
);
goto
out
;
}
ret
=
lxc_mainloop_add_handler
(
&
descr
,
0
,
stdin_handler
,
&
in_char
);
if
(
ret
)
{
ERROR
(
"failed to add stdin handler
"
);
fprintf
(
stderr
,
"failed to add stdin handler
\n
"
);
ret
=
EXIT_FAILURE
;
goto
err1
;
}
...
...
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