Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bpftrace
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
bpftrace
Commits
54afd828
Commit
54afd828
authored
Jan 24, 2017
by
Alastair Robertson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link to libbcc
parent
290333bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
src/CMakeLists.txt
src/CMakeLists.txt
+11
-0
src/map.cpp
src/map.cpp
+3
-4
src/map.h
src/map.h
+0
-1
No files found.
src/CMakeLists.txt
View file @
54afd828
...
...
@@ -34,3 +34,14 @@ add_executable(bpftrace main.cpp driver.cpp parser.tab.cc lex.yy.cc ast.cpp prin
llvm_map_components_to_libnames
(
llvm_libs irreader bpfcodegen mcjit
)
target_link_libraries
(
bpftrace
${
llvm_libs
}
)
include
(
ExternalProject
)
ExternalProject_Add
(
bcc
GIT_REPOSITORY https://github.com/iovisor/bcc
STEP_TARGETS build
EXCLUDE_FROM_ALL 1
)
add_dependencies
(
bpftrace bcc-build
)
ExternalProject_Get_Property
(
bcc source_dir binary_dir
)
include_directories
(
${
source_dir
}
/src/cc
)
target_link_libraries
(
bpftrace
${
binary_dir
}
/src/cc/libbcc.so
)
src/map.cpp
View file @
54afd828
#include <unistd.h>
#include "map.h"
#include "libbpf.h"
namespace
ebpf
{
namespace
bpftrace
{
int
Map
::
n
=
0
;
Map
::
Map
()
{
// TODO create map here
mapfd_
=
n
++
;
mapfd_
=
bpf_create_map
(
BPF_MAP_TYPE_HASH
,
8
,
8
,
128
,
0
);
// TODO check mapfd_ != -1
}
Map
::~
Map
()
{
...
...
src/map.h
View file @
54afd828
...
...
@@ -12,7 +12,6 @@ public:
~
Map
();
int
mapfd_
;
static
int
n
;
};
}
// namespace bpftrace
...
...
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