-
Notifications
You must be signed in to change notification settings - Fork 109
fix log cannot print in kernel 5.10 by bpf_trace_printk #1363
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
see 23 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
@nlgwcy can you please give some suggestion |
bpf_trace_printk cannot print two %s, need to fix remove redundant function definitions 'xdp_deny_packet' Signed-off-by: lec-bit <[email protected]>
ip2str(&sock_addr->ipv4, 1), | ||
bpf_ntohs(sock_addr->port)); | ||
// Since bpf_trace_printk cannot print two %s, the name and ipv4 are printed separately. | ||
BPF_LOG(INFO, CLUSTER, "cluster=\"%s\"\n", name); |
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.
BPF_LOG(INFO, CLUSTER, "cluster=\"%s\"\n", name); | |
BPF_LOG(INFO, CLUSTER, "cluster=\"%s\",", name); |
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.
BPF logs are printed on a new line each time in bpf_trace_printk. Adding \n here will not affect whether the log is continuous.
The restriction is fixed in this PR: torvalds/linux@d9c9e4db186ab |
Ok, so in 5.10 kernel we must fix it. Is this the right way? |
Can you also fix bpf/kmesh/workload/xdp.c |
Seems |
I don't know if this place can be repaired simply by taking it apart.
`
|
I think this function can be removed now |
ok |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: LiZhenCheng9527 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
bpf_trace_printk cannot print two %s, need to fix
What type of PR is this?
/kind bug
What this PR does / why we need it:
bpf_trace_printk cannot print two %s, need to fix
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: