Commit 0637fb0e authored by Brenden Blanco's avatar Brenden Blanco

Merge pull request #334 from iovisor/ast_dev

use __builtin_memcpy() instead of unrolled loop
parents 143df809 7583a4e2
......@@ -21,7 +21,7 @@
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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment