Skip to content
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

Closed
wants to merge 25 commits into from
Closed

add drop-only option to dae trace #3

wants to merge 25 commits into from

Conversation

linglilongyi
Copy link
Owner

Background

Checklist

Full Changelogs

  • [Implement ...]

Issue Reference

#2 [[https://github.com/daeuniverse/issues/524]]

Closes #[issue number]

Test Result

@linglilongyi linglilongyi self-assigned this Jul 31, 2024
trace/trace.go Outdated
fmt.Fprintf(writer, "\n")
}
}
case "__kfree_skb":

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,可见后者直接被优化掉了,在内核里经常没有被实际调用。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

也可以同时检查多个可能的函数

@linglilongyi linglilongyi deleted the drop-only branch September 29, 2024 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants