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
de96cd60
Unverified
Commit
de96cd60
authored
Jan 30, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log: add lxc_log_trace() helper
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
4a888de1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
cgroup2_devices.c
src/lxc/cgroups/cgroup2_devices.c
+1
-1
log.h
src/lxc/log.h
+4
-0
seccomp.c
src/lxc/seccomp.c
+1
-1
No files found.
src/lxc/cgroups/cgroup2_devices.c
View file @
de96cd60
...
...
@@ -331,7 +331,7 @@ static int bpf_program_load_kernel(struct bpf_program *prog)
if
(
prog
->
kernel_fd
>=
0
)
return
0
;
if
(
lxc_log_
get_level
()
<=
LXC_LOG_LEVEL_TRACE
)
{
if
(
lxc_log_
trace
()
)
{
log_buf
=
zalloc
(
BPF_LOG_BUF_SIZE
);
if
(
!
log_buf
)
{
WARN
(
"Failed to allocate bpf log buffer"
);
...
...
src/lxc/log.h
View file @
de96cd60
...
...
@@ -568,6 +568,10 @@ __hidden extern void lxc_log_syslog_enable(void);
__hidden
extern
void
lxc_log_syslog_disable
(
void
);
__hidden
extern
int
lxc_log_set_level
(
int
*
dest
,
int
level
);
__hidden
extern
int
lxc_log_get_level
(
void
);
static
inline
bool
lxc_log_trace
(
void
)
{
return
lxc_log_get_level
()
<=
LXC_LOG_LEVEL_TRACE
;
}
__hidden
extern
bool
lxc_log_has_valid_level
(
void
);
__hidden
extern
int
lxc_log_set_file
(
int
*
fd
,
const
char
*
fname
);
__hidden
extern
const
char
*
lxc_log_get_file
(
void
);
...
...
src/lxc/seccomp.c
View file @
de96cd60
...
...
@@ -1260,7 +1260,7 @@ int lxc_seccomp_load(struct lxc_conf *conf)
/* After load seccomp filter into the kernel successfully, export the current seccomp
* filter to log file */
#if HAVE_SCMP_FILTER_CTX
if
(
lxc_log_
get_level
()
<=
LXC_LOG_LEVEL_TRACE
)
{
if
(
lxc_log_
trace
()
)
{
int
fd_log
;
fd_log
=
lxc_log_get_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