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
cce028d8
Commit
cce028d8
authored
May 21, 2017
by
4ast
Committed by
GitHub
May 21, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1194 from palmtenor/minor_fixes
Minor fixes for example and compiler warning
parents
cb3d1618
9190ef5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
examples/cpp/TCPSendStack.cc
examples/cpp/TCPSendStack.cc
+1
-1
src/cc/libbpf.c
src/cc/libbpf.c
+1
-1
No files found.
examples/cpp/TCPSendStack.cc
View file @
cce028d8
...
...
@@ -32,7 +32,7 @@ BPF_HASH(counts, struct stack_key_t, uint64_t);
int on_tcp_send(struct pt_regs *ctx) {
struct stack_key_t key = {};
key.pid = bpf_get_current_pid_tgid();
key.pid = bpf_get_current_pid_tgid()
>> 32
;
bpf_get_current_comm(&key.name, sizeof(key.name));
key.kernel_stack = stack_traces.get_stackid(ctx, BPF_F_REUSE_STACKID);
key.user_stack = stack_traces.get_stackid(
...
...
src/cc/libbpf.c
View file @
cce028d8
...
...
@@ -159,7 +159,7 @@ int bpf_get_first_key(int fd, void *key, size_t key_size)
// trigger a page fault in kernel and affect performence. Hence we use
// ~0 which will fail and return fast.
// This should fail since we pass an invalid pointer for value.
if
(
bpf_lookup_elem
(
fd
,
key
,
~
0
)
>=
0
)
if
(
bpf_lookup_elem
(
fd
,
key
,
(
void
*
)
~
0
)
>=
0
)
return
-
1
;
// This means the key doesn't exist.
if
(
errno
==
ENOENT
)
...
...
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