-
Notifications
You must be signed in to change notification settings - Fork 109
adapt BPF_LOG in route_config.h #1220
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 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
/retest |
maybe #1206 can help reduce instruction cost by log too |
DEBUG, | ||
ROUTER_CONFIG, | ||
"match virtual_host, name=\"%s\"\n", | ||
(char *)KMESH_GET_PTR_VAL(virt_host->name, char *)); |
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.
how can we know which is matched now
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.
in line 364, virt_host = virtual_host_match(route_config, &addr, ctx);
we can log here
bpf/kmesh/ads/include/route_config.h
Outdated
|
||
if (cluster_name != NULL) { | ||
BPF_LOG( | ||
DEBUG, ROUTER_CONFIG, "select cluster, name:weight %s:%d\n", cluster_name, route_cluster_weight->weight); |
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.
keep only cluster name, weight maybe not cared
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.
ok
/retest |
Signed-off-by: lec-bit <[email protected]>
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu 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 |
What type of PR is this?
/kind enhancement
What this PR does / why we need it:
Due to the excessive number of instructions consumed by BPF_LOG, using BPF_LOG within the loop can easily lead to exceeding 1,000,000 instructions. A small optimization is needed to avoid surpassing this limit.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: