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
0637fb0e
Commit
0637fb0e
authored
Feb 03, 2016
by
Brenden Blanco
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #334 from iovisor/ast_dev
use __builtin_memcpy() instead of unrolled loop
parents
143df809
7583a4e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
33 deletions
+4
-33
tools/offwaketime.py
tools/offwaketime.py
+4
-33
No files found.
tools/offwaketime.py
View file @
0637fb0e
...
...
@@ -17,11 +17,11 @@
# Copyright 2016 Netflix, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 20-Jan-2016
Brendan Gregg
Created this.
# 20-Jan-2016
Brendan Gregg
Created this.
from
__future__
import
print_function
from
bcc
import
BPF
from
time
import
sleep
,
strftime
from
time
import
sleep
import
argparse
import
signal
...
...
@@ -184,37 +184,8 @@ int oncpu(struct pt_regs *ctx, struct task_struct *p) {
out:
woke = wokeby.lookup(&pid);
if (woke) {
// unrolled loop (MAXWDEPTH):
depth = 0;
key.wret[depth] = woke->ret[depth]; depth++;
key.wret[depth] = woke->ret[depth]; depth++;
key.wret[depth] = woke->ret[depth]; depth++;
key.wret[depth] = woke->ret[depth]; depth++;
key.wret[depth] = woke->ret[depth]; depth++;
key.wret[depth] = woke->ret[depth]; depth++;
key.wret[depth] = woke->ret[depth]; depth++;
key.wret[depth] = woke->ret[depth]; depth++;
key.wret[depth] = woke->ret[depth]; depth++;
key.wret[depth] = woke->ret[depth];
// unrolled loop (TASK_COMM_LEN):
depth = 0;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth]; depth++;
key.waker[depth] = woke->name[depth];
__builtin_memcpy(&key.wret, woke->ret, sizeof(key.wret));
__builtin_memcpy(&key.waker, woke->name, TASK_COMM_LEN);
wokeby.delete(&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