Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
c5308e96
Commit
c5308e96
authored
Dec 28, 2017
by
nikolay.samofatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CentOS 6 support
parent
4e04c945
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
0 deletions
+28
-0
introspection/bps.c
introspection/bps.c
+5
-0
src/cc/libbpf.c
src/cc/libbpf.c
+8
-0
src/cc/ns_guard.cc
src/cc/ns_guard.cc
+3
-0
src/cc/setns.h
src/cc/setns.h
+12
-0
No files found.
introspection/bps.c
View file @
c5308e96
...
...
@@ -11,6 +11,11 @@
#include "libbpf.h"
// TODO: Remove this when CentOS 6 support is not needed anymore
#ifndef CLOCK_BOOTTIME
#define CLOCK_BOOTTIME 7
#endif
static
const
char
*
const
prog_type_strings
[]
=
{
[
BPF_PROG_TYPE_UNSPEC
]
=
"unspec"
,
[
BPF_PROG_TYPE_SOCKET_FILTER
]
=
"socket filter"
,
...
...
src/cc/libbpf.c
View file @
c5308e96
...
...
@@ -48,6 +48,9 @@
#include "libbpf.h"
#include "perf_reader.h"
// TODO: Remove this when CentOS 6 support is not needed anymore
#include "setns.h"
// TODO: remove these defines when linux-libc-dev exports them properly
#ifndef __NR_bpf
...
...
@@ -74,6 +77,11 @@
#define PERF_FLAG_FD_CLOEXEC (1UL << 3)
#endif
// TODO: Remove this when CentOS 6 support is not needed anymore
#ifndef AF_ALG
#define AF_ALG 38
#endif
#define min(x, y) ((x) < (y) ? (x) : (y))
static
int
probe_perf_reader_page_cnt
=
8
;
...
...
src/cc/ns_guard.cc
View file @
c5308e96
...
...
@@ -21,6 +21,9 @@
#include "ns_guard.h"
// TODO: Remove this when CentOS 6 support is not needed anymore
#include "setns.h"
ProcMountNS
::
ProcMountNS
(
int
pid
)
:
target_ino_
(
0
)
{
if
(
pid
<
0
)
return
;
...
...
src/cc/setns.h
0 → 100644
View file @
c5308e96
// This file is only needed to support build for CentOS 6
// Remove it when no longer needed.
// File is trivial and therefore is in public domain.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <unistd.h>
#include <sys/syscall.h>
#define setns(FD, NSTYPE) syscall(__NR_setns, (int)(FD), (int)(NSTYPE))
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