-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add drop-only option to dae trace #3
Conversation
trace/trace.go
Outdated
fmt.Fprintf(writer, "\n") | ||
} | ||
} | ||
case "__kfree_skb": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用 kfree_skbmem 会不会更好?因为 __kfree_skb() 经常被优化掉。
比如 consume_skb() 的代码是
void consume_skb(struct sk_buff *skb)
{
if (!skb_unref(skb))
return;
trace_consume_skb(skb, __builtin_return_address(0));
__kfree_skb(skb);
}
但是在我 6.5.0-1027-oem 上检查内核的 consume_skb() 汇编:
$ sudo gdb -ex "x/100i 0x$(ksym consume_skb)" -ex q vmlinux /proc/kcore 2>/dev/null
[...]
0xffffffff853fe99f: call 0xffffffff853f9270
[...]
上面的 call 0xffffffff853f9270 是 call kfree_skbmem(),而不是 __kfree_skb,可见后者直接被优化掉了,在内核里经常没有被实际调用。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
也可以同时检查多个可能的函数
Co-authored-by: dae-prow[bot] <136105375+dae-prow[bot]@users.noreply.github.com>
3d6838c
to
addf3cf
Compare
Co-authored-by: mzz2017 <[email protected]>
Co-authored-by: dae-prow[bot] <136105375+dae-prow[bot]@users.noreply.github.com>
- refactor: also merge some line to simplify the code
Background
Checklist
Full Changelogs
Issue Reference
#2 [[https://github.com/daeuniverse/issues/524]]
Closes #[issue number]
Test Result