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
e26019fc
Commit
e26019fc
authored
Apr 17, 2018
by
Cong Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use better kprobes for runqlat.py
parent
f4e1c334
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
tools/runqlat.py
tools/runqlat.py
+14
-5
No files found.
tools/runqlat.py
View file @
e26019fc
...
...
@@ -87,11 +87,8 @@ STORAGE
struct rq;
// record enqueue timestamp
int trace_enqueue(struct pt_regs *ctx, struct rq *rq, struct task_struct *p,
int flags)
static int trace_enqueue(u32 tgid, u32 pid)
{
u32 tgid = p->tgid;
u32 pid = p->pid;
if (FILTER)
return 0;
u64 ts = bpf_ktime_get_ns();
...
...
@@ -99,6 +96,17 @@ int trace_enqueue(struct pt_regs *ctx, struct rq *rq, struct task_struct *p,
return 0;
}
int trace_wake_up_new_task(struct pt_regs *ctx, struct task_struct *p)
{
return trace_enqueue(p->tgid, p->pid);
}
int trace_ttwu_do_wakeup(struct pt_regs *ctx, struct rq *rq, struct task_struct *p,
int wake_flags)
{
return trace_enqueue(p->tgid, p->pid);
}
// calculate latency
int trace_run(struct pt_regs *ctx, struct task_struct *prev)
{
...
...
@@ -178,7 +186,8 @@ if debug or args.ebpf:
# load BPF program
b
=
BPF
(
text
=
bpf_text
)
b
.
attach_kprobe
(
event_re
=
"enqueue_task_*"
,
fn_name
=
"trace_enqueue"
)
b
.
attach_kprobe
(
event
=
"ttwu_do_wakeup"
,
fn_name
=
"trace_ttwu_do_wakeup"
)
b
.
attach_kprobe
(
event
=
"wake_up_new_task"
,
fn_name
=
"trace_wake_up_new_task"
)
b
.
attach_kprobe
(
event
=
"finish_task_switch"
,
fn_name
=
"trace_run"
)
print
(
"Tracing run queue latency... Hit Ctrl-C to end."
)
...
...
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