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
0a1dc297
Commit
0a1dc297
authored
Aug 07, 2015
by
Brenden Blanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some deprecated checks in bpf_module
Signed-off-by:
Brenden Blanco
<
bblanco@plumgrid.com
>
parent
00ee4fe8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
13 deletions
+4
-13
src/cc/bpf_module.cc
src/cc/bpf_module.cc
+3
-7
src/cc/bpf_module.h
src/cc/bpf_module.h
+1
-0
src/cc/frontends/b/loader.cc
src/cc/frontends/b/loader.cc
+0
-5
src/cc/frontends/b/loader.h
src/cc/frontends/b/loader.h
+0
-1
No files found.
src/cc/bpf_module.cc
View file @
0a1dc297
...
...
@@ -242,9 +242,9 @@ int BPFModule::annotate() {
}
}
auto
engine
=
finalize_reader
(
move
(
m
));
if
(
engine
)
engine
->
finalizeObject
();
reader_engine_
=
finalize_reader
(
move
(
m
));
if
(
reader_engine_
)
reader_engine_
->
finalizeObject
();
return
0
;
}
...
...
@@ -370,8 +370,6 @@ size_t BPFModule::num_tables() const {
}
int
BPFModule
::
table_fd
(
const
string
&
name
)
const
{
int
fd
=
b_loader_
?
b_loader_
->
get_table_fd
(
name
)
:
-
1
;
if
(
fd
>=
0
)
return
fd
;
auto
table_it
=
tables_
->
find
(
name
);
if
(
table_it
==
tables_
->
end
())
return
-
1
;
return
table_it
->
second
.
fd
;
...
...
@@ -415,7 +413,6 @@ size_t BPFModule::table_key_size(size_t id) const {
return
table_key_size
(
table_names_
[
id
]);
}
size_t
BPFModule
::
table_key_size
(
const
string
&
name
)
const
{
if
(
b_loader_
)
return
0
;
auto
table_it
=
tables_
->
find
(
name
);
if
(
table_it
==
tables_
->
end
())
return
0
;
return
table_it
->
second
.
key_size
;
...
...
@@ -426,7 +423,6 @@ size_t BPFModule::table_leaf_size(size_t id) const {
return
table_leaf_size
(
table_names_
[
id
]);
}
size_t
BPFModule
::
table_leaf_size
(
const
string
&
name
)
const
{
if
(
b_loader_
)
return
0
;
auto
table_it
=
tables_
->
find
(
name
);
if
(
table_it
==
tables_
->
end
())
return
0
;
return
table_it
->
second
.
leaf_size
;
...
...
src/cc/bpf_module.h
View file @
0a1dc297
...
...
@@ -82,6 +82,7 @@ class BPFModule {
std
::
string
proto_filename_
;
std
::
unique_ptr
<
llvm
::
LLVMContext
>
ctx_
;
std
::
unique_ptr
<
llvm
::
ExecutionEngine
>
engine_
;
std
::
unique_ptr
<
llvm
::
ExecutionEngine
>
reader_engine_
;
std
::
unique_ptr
<
llvm
::
Module
>
mod_
;
std
::
unique_ptr
<
BLoader
>
b_loader_
;
std
::
unique_ptr
<
ClangLoader
>
clang_loader_
;
...
...
src/cc/frontends/b/loader.cc
View file @
0a1dc297
...
...
@@ -73,9 +73,4 @@ int BLoader::parse(llvm::Module *mod, const string &filename, const string &prot
return
0
;
}
int
BLoader
::
get_table_fd
(
const
string
&
name
)
const
{
if
(
!
codegen_
)
return
-
1
;
return
codegen_
->
get_table_fd
(
name
);
}
}
// namespace ebpf
src/cc/frontends/b/loader.h
View file @
0a1dc297
...
...
@@ -39,7 +39,6 @@ class BLoader {
~
BLoader
();
int
parse
(
llvm
::
Module
*
mod
,
const
std
::
string
&
filename
,
const
std
::
string
&
proto_filename
,
std
::
unique_ptr
<
std
::
map
<
std
::
string
,
TableDesc
>>
*
tables
);
int
get_table_fd
(
const
std
::
string
&
name
)
const
;
private:
std
::
unique_ptr
<
cc
::
Parser
>
parser_
;
std
::
unique_ptr
<
cc
::
Parser
>
proto_parser_
;
...
...
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