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
033dcae4
Commit
033dcae4
authored
May 06, 2018
by
yonghong-song
Committed by
GitHub
May 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1734 from pchaigno/fix-old-tools
old/tools: Diverse fixes
parents
3fef513c
a1140168
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
+6
-8
tools/old/bashreadline.py
tools/old/bashreadline.py
+1
-1
tools/old/tcpaccept.py
tools/old/tcpaccept.py
+1
-1
tools/old/tcpconnect.py
tools/old/tcpconnect.py
+4
-6
No files found.
tools/old/bashreadline.py
View file @
033dcae4
...
...
@@ -22,7 +22,7 @@ int printret(struct pt_regs *ctx) {
return 0;
char str[80] = {};
bpf_probe_read(&str, sizeof(str), (void *)
ctx->ax
);
bpf_probe_read(&str, sizeof(str), (void *)
PT_REGS_RC(ctx)
);
bpf_trace_printk("%s
\
\
n", &str);
return 0;
...
...
tools/old/tcpaccept.py
View file @
033dcae4
...
...
@@ -47,7 +47,7 @@ bpf_text = """
int kretprobe__inet_csk_accept(struct pt_regs *ctx)
{
struct sock *newsk = (struct sock *)
ctx->ax
;
struct sock *newsk = (struct sock *)
PT_REGS_RC(ctx)
;
u32 pid = bpf_get_current_pid_tgid();
if (newsk == NULL)
...
...
tools/old/tcpconnect.py
View file @
033dcae4
...
...
@@ -55,7 +55,7 @@ int trace_connect_entry(struct pt_regs *ctx, struct sock *sk)
static int trace_connect_return(struct pt_regs *ctx, short ipver)
{
int ret =
ctx->ax
;
int ret =
PT_REGS_RC(ctx)
;
u32 pid = bpf_get_current_pid_tgid();
struct sock **skpp;
...
...
@@ -75,12 +75,10 @@ static int trace_connect_return(struct pt_regs *ctx, short ipver)
struct sock *skp = *skpp;
u32 saddr = 0, daddr = 0;
u16 dport = 0;
bpf_probe_read(&dport, sizeof(dport), &skp->__sk_common.skc_dport)
;
dport = skp->__sk_common.skc_dport
;
if (ipver == 4) {
bpf_probe_read(&saddr, sizeof(saddr),
&skp->__sk_common.skc_rcv_saddr);
bpf_probe_read(&daddr, sizeof(daddr),
&skp->__sk_common.skc_daddr);
saddr = skp->__sk_common.skc_rcv_saddr;
daddr = skp->__sk_common.skc_daddr;
// output
bpf_trace_printk("4 %x %x %d
\
\
n", saddr, daddr, ntohs(dport));
...
...
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