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
b5e68221
Commit
b5e68221
authored
Oct 13, 2018
by
Alastair Robertson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use std::strings rather than C-strings
parent
e25f0498
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
src/ast/codegen_llvm.cpp
src/ast/codegen_llvm.cpp
+2
-2
src/bpftrace.cpp
src/bpftrace.cpp
+2
-2
src/bpftrace.h
src/bpftrace.h
+2
-2
No files found.
src/ast/codegen_llvm.cpp
View file @
b5e68221
...
...
@@ -320,14 +320,14 @@ void CodegenLLVM::visit(Call &call)
{
uint64_t
addr
;
auto
&
name
=
static_cast
<
String
&>
(
*
call
.
vargs
->
at
(
0
)).
str
;
addr
=
bpftrace_
.
resolve_kname
(
name
.
c_str
()
);
addr
=
bpftrace_
.
resolve_kname
(
name
);
expr_
=
b_
.
getInt64
(
addr
);
}
else
if
(
call
.
func
==
"uaddr"
)
{
uint64_t
addr
;
auto
&
name
=
static_cast
<
String
&>
(
*
call
.
vargs
->
at
(
0
)).
str
;
addr
=
bpftrace_
.
resolve_uname
(
name
.
c_str
(),
current_attach_point_
->
target
.
c_str
()
);
addr
=
bpftrace_
.
resolve_uname
(
name
,
current_attach_point_
->
target
);
expr_
=
b_
.
getInt64
(
addr
);
}
else
if
(
call
.
func
==
"join"
)
...
...
src/bpftrace.cpp
View file @
b5e68221
...
...
@@ -1248,7 +1248,7 @@ std::string BPFtrace::resolve_sym(uintptr_t addr, bool show_offset)
return
symbol
.
str
();
}
uint64_t
BPFtrace
::
resolve_kname
(
const
char
*
name
)
uint64_t
BPFtrace
::
resolve_kname
(
const
std
::
string
&
name
)
{
uint64_t
addr
=
0
;
std
::
string
file_name
=
"/proc/kallsyms"
;
...
...
@@ -1282,7 +1282,7 @@ uint64_t BPFtrace::resolve_kname(const char *name)
return
addr
;
}
uint64_t
BPFtrace
::
resolve_uname
(
const
char
*
name
,
const
char
*
path
)
uint64_t
BPFtrace
::
resolve_uname
(
const
std
::
string
&
name
,
const
std
::
string
&
path
)
{
uint64_t
addr
=
0
;
...
...
src/bpftrace.h
View file @
b5e68221
...
...
@@ -62,8 +62,8 @@ public:
std
::
string
resolve_sym
(
uintptr_t
addr
,
bool
show_offset
=
false
);
std
::
string
resolve_usym
(
uintptr_t
addr
,
int
pid
,
bool
show_offset
=
false
);
std
::
string
resolve_uid
(
uintptr_t
addr
);
uint64_t
resolve_kname
(
const
char
*
name
);
uint64_t
resolve_uname
(
const
char
*
name
,
const
char
*
path
);
uint64_t
resolve_kname
(
const
std
::
string
&
name
);
uint64_t
resolve_uname
(
const
std
::
string
&
name
,
const
std
::
string
&
path
);
std
::
string
resolve_name
(
uint64_t
name_id
);
std
::
vector
<
uint64_t
>
get_arg_values
(
std
::
vector
<
Field
>
args
,
uint8_t
*
arg_data
);
int
pid_
;
...
...
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