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
5f558b7e
Commit
5f558b7e
authored
Oct 30, 2017
by
Alastair Robertson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create ast subdirectory
parent
489c716c
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
35 additions
and
21 deletions
+35
-21
CMakeLists.txt
CMakeLists.txt
+2
-1
README.md
README.md
+7
-2
src/CMakeLists.txt
src/CMakeLists.txt
+2
-7
src/ast/CMakeLists.txt
src/ast/CMakeLists.txt
+16
-0
src/ast/ast.cpp
src/ast/ast.cpp
+0
-0
src/ast/ast.h
src/ast/ast.h
+0
-0
src/ast/codegen_llvm.cpp
src/ast/codegen_llvm.cpp
+0
-0
src/ast/codegen_llvm.h
src/ast/codegen_llvm.h
+0
-0
src/ast/irbuilderbpf.cpp
src/ast/irbuilderbpf.cpp
+0
-0
src/ast/irbuilderbpf.h
src/ast/irbuilderbpf.h
+0
-0
src/ast/printer.cpp
src/ast/printer.cpp
+0
-0
src/ast/printer.h
src/ast/printer.h
+0
-0
src/ast/semantic_analyser.cpp
src/ast/semantic_analyser.cpp
+0
-0
src/ast/semantic_analyser.h
src/ast/semantic_analyser.h
+0
-0
tests/CMakeLists.txt
tests/CMakeLists.txt
+8
-11
No files found.
CMakeLists.txt
View file @
5f558b7e
...
...
@@ -39,7 +39,7 @@ bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc)
flex_target
(
flex_lexer src/lexer.l
${
CMAKE_BINARY_DIR
}
/lex.yy.cc
)
add_flex_bison_dependency
(
flex_lexer bison_parser
)
add_library
(
parser
${
BISON_bison_parser_OUTPUTS
}
${
FLEX_flex_lexer_OUTPUTS
}
)
target_include_directories
(
parser PUBLIC src
${
CMAKE_BINARY_DIR
}
)
target_include_directories
(
parser PUBLIC src
src/ast
${
CMAKE_BINARY_DIR
}
)
find_package
(
LLVM REQUIRED CONFIG
)
include_directories
(
${
LLVM_INCLUDE_DIRS
}
)
...
...
@@ -48,5 +48,6 @@ add_definitions(${LLVM_DEFINITIONS})
set
(
DYNAMIC_LINKING OFF CACHE BOOL
"Build bpftrace as a dynamically linked executable"
)
add_subdirectory
(
src/arch
)
add_subdirectory
(
src/ast
)
add_subdirectory
(
src
)
add_subdirectory
(
tests
)
README.md
View file @
5f558b7e
...
...
@@ -136,10 +136,15 @@ Tracepoints are guaranteed to be stable between kernel versions, unlike kprobes.
Run the script at specified time intervals:
`profile:hz:99 { ... }`
`profile:ms:10 { ... }`
`profile:s:1 { ... }`
`profile:ms:20 { ... }`
`profile:us:1500 { ... }`
### Multiple attachment points
More than one function/tracepoint can be specified for a single probe
:
A single probe can be attached to multiple events
:
`kprobe:sys_read,kprobe:sys_write { ... }`
...
...
src/CMakeLists.txt
View file @
5f558b7e
...
...
@@ -3,30 +3,25 @@ if (NOT DYNAMIC_LINKING)
endif
()
add_executable
(
bpftrace
ast.cpp
attached_probe.cpp
bpftrace.cpp
codegen_llvm.cpp
driver.cpp
fake_map.cpp
irbuilderbpf.cpp
main.cpp
map.cpp
mapkey.cpp
printer.cpp
printf.cpp
semantic_analyser.cpp
types.cpp
)
target_link_libraries
(
bpftrace arch parser
)
target_link_libraries
(
bpftrace arch
ast
parser
)
llvm_map_components_to_libnames
(
llvm_libs bpfcodegen ipo irreader mcjit
)
target_link_libraries
(
bpftrace
${
llvm_libs
}
)
add_dependencies
(
bpftrace bcc-build
)
ExternalProject_Get_Property
(
bcc source_dir binary_dir
)
include_directories
(
${
source_dir
}
/src/cc
)
target_include_directories
(
bpftrace PUBLIC
${
source_dir
}
/src/cc
)
target_link_libraries
(
bpftrace
${
binary_dir
}
/src/cc/libbpf.a
)
target_link_libraries
(
bpftrace
${
binary_dir
}
/src/cc/libbcc-loader-static.a
)
target_link_libraries
(
bpftrace
${
binary_dir
}
/src/cc/libbcc.a
)
...
...
src/ast/CMakeLists.txt
0 → 100644
View file @
5f558b7e
add_library
(
ast
ast.cpp
codegen_llvm.cpp
irbuilderbpf.cpp
printer.cpp
semantic_analyser.cpp
)
target_include_directories
(
ast PUBLIC
${
CMAKE_SOURCE_DIR
}
/src
)
target_include_directories
(
ast PUBLIC
${
CMAKE_SOURCE_DIR
}
/src/ast
)
target_include_directories
(
ast PUBLIC
${
CMAKE_BINARY_DIR
}
)
target_link_libraries
(
ast arch
)
add_dependencies
(
ast bcc-build
)
ExternalProject_Get_Property
(
bcc source_dir
)
target_include_directories
(
ast PUBLIC
${
source_dir
}
/src/cc
)
src/ast.cpp
→
src/ast
/ast
.cpp
View file @
5f558b7e
File moved
src/ast.h
→
src/ast
/ast
.h
View file @
5f558b7e
File moved
src/codegen_llvm.cpp
→
src/
ast/
codegen_llvm.cpp
View file @
5f558b7e
File moved
src/codegen_llvm.h
→
src/
ast/
codegen_llvm.h
View file @
5f558b7e
File moved
src/irbuilderbpf.cpp
→
src/
ast/
irbuilderbpf.cpp
View file @
5f558b7e
File moved
src/irbuilderbpf.h
→
src/
ast/
irbuilderbpf.h
View file @
5f558b7e
File moved
src/printer.cpp
→
src/
ast/
printer.cpp
View file @
5f558b7e
File moved
src/printer.h
→
src/
ast/
printer.h
View file @
5f558b7e
File moved
src/semantic_analyser.cpp
→
src/
ast/
semantic_analyser.cpp
View file @
5f558b7e
File moved
src/semantic_analyser.h
→
src/
ast/
semantic_analyser.h
View file @
5f558b7e
File moved
tests/CMakeLists.txt
View file @
5f558b7e
...
...
@@ -6,9 +6,6 @@ add_compile_options("-Wno-undef")
add_compile_options
(
"-Wno-switch-default"
)
add_compile_options
(
"-Wno-switch-enum"
)
include_directories
(
${
CMAKE_SOURCE_DIR
}
/src
)
include_directories
(
${
CMAKE_BINARY_DIR
}
/src
)
add_executable
(
bpftrace_test
ast.cpp
bpftrace.cpp
...
...
@@ -16,19 +13,19 @@ add_executable(bpftrace_test
main.cpp
parser.cpp
semantic_analyser.cpp
${
CMAKE_SOURCE_DIR
}
/src/ast.cpp
${
CMAKE_SOURCE_DIR
}
/src/attached_probe.cpp
${
CMAKE_SOURCE_DIR
}
/src/bpftrace.cpp
${
CMAKE_SOURCE_DIR
}
/src/codegen_llvm.cpp
${
CMAKE_SOURCE_DIR
}
/src/driver.cpp
${
CMAKE_SOURCE_DIR
}
/src/irbuilderbpf.cpp
${
CMAKE_SOURCE_DIR
}
/src/fake_map.cpp
${
CMAKE_SOURCE_DIR
}
/src/map.cpp
${
CMAKE_SOURCE_DIR
}
/src/mapkey.cpp
${
CMAKE_SOURCE_DIR
}
/src/printer.cpp
${
CMAKE_SOURCE_DIR
}
/src/printf.cpp
${
CMAKE_SOURCE_DIR
}
/src/semantic_analyser.cpp
${
CMAKE_SOURCE_DIR
}
/src/types.cpp
${
CMAKE_SOURCE_DIR
}
/src/ast/ast.cpp
${
CMAKE_SOURCE_DIR
}
/src/ast/codegen_llvm.cpp
${
CMAKE_SOURCE_DIR
}
/src/ast/irbuilderbpf.cpp
${
CMAKE_SOURCE_DIR
}
/src/ast/printer.cpp
${
CMAKE_SOURCE_DIR
}
/src/ast/semantic_analyser.cpp
)
target_link_libraries
(
bpftrace_test arch parser
)
...
...
@@ -38,7 +35,7 @@ target_link_libraries(bpftrace_test ${llvm_libs})
add_dependencies
(
bpftrace_test bcc-build
)
ExternalProject_Get_Property
(
bcc source_dir binary_dir
)
include_directories
(
${
source_dir
}
/src/cc
)
target_include_directories
(
bpftrace_test PUBLIC
${
source_dir
}
/src/cc
)
target_link_libraries
(
bpftrace_test
${
binary_dir
}
/src/cc/libbpf.a
)
target_link_libraries
(
bpftrace_test
${
binary_dir
}
/src/cc/libbcc-loader-static.a
)
target_link_libraries
(
bpftrace_test
${
binary_dir
}
/src/cc/libbcc.a
)
...
...
@@ -55,8 +52,8 @@ ExternalProject_Add(gtest
)
add_dependencies
(
bpftrace_test gtest-build
)
ExternalProject_Get_Property
(
gtest source_dir binary_dir
)
include_directories
(
${
source_dir
}
/googletest/include
)
include_directories
(
${
source_dir
}
/googlemock/include
)
target_include_directories
(
bpftrace_test PUBLIC
${
source_dir
}
/googletest/include
)
target_include_directories
(
bpftrace_test PUBLIC
${
source_dir
}
/googlemock/include
)
target_link_libraries
(
bpftrace_test
${
binary_dir
}
/googlemock/gtest/libgtest.a
)
target_link_libraries
(
bpftrace_test
${
binary_dir
}
/googlemock/gtest/libgtest_main.a
)
target_link_libraries
(
bpftrace_test
${
binary_dir
}
/googlemock/libgmock.a
)
...
...
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