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

Provide a way to allow setting all logger level to debug #557

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

hzxuzhonghu
Copy link
Member

Fix: #547

#define BPF_LOGTYPE_SOCKOPS BPF_LOG_LEVEL
#define BPF_LOGTYPE_XDP BPF_LOG_LEVEL
#define BPF_LOGTYPE_SENDMSG BPF_LOG_LEVEL
#define BPF_LOGTYPE_PROBE BPF_LOG_LEVEL
Copy link
Member Author

Choose a reason for hiding this comment

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

These are now useless until we support fine-grained log level control

Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Copy link

codecov bot commented Jul 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.25%. Comparing base (098a402) to head (773f65e).
Report is 13 commits behind head on main.

see 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb0bd28...773f65e. Read the comment docs.

@hzxuzhonghu
Copy link
Member Author

@nlgwcy Because of the instruction limit of ebpf, this is the most we can do now.

Luckily with this, we can set log level to almost all the bpf prog, except COMMON

@@ -101,7 +101,7 @@ static inline int map_lookup_log_level()
int *value = NULL;
value = kmesh_map_lookup_elem(&bpf_log_level, &zero);
if (!value)
return 0;
return BPF_LOG_INFO;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a change, now no debug level log will be printed by default. Which can be tuned by user from kmesh-daemon.

#define BPF_LOGTYPE_FILTER BPF_DEBUG_ON
#define BPF_LOGTYPE_CLUSTER BPF_DEBUG_ON
#define BPF_LOGTYPE_ROUTER BPF_DEBUG_ON
#define BPF_LOGTYPE_ROUTER_CONFIG BPF_DEBUG_ON
#define BPF_LOGTYPE_COMMON BPF_DEBUG_OFF
Copy link
Contributor

Choose a reason for hiding this comment

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

image
In debug level, this log will be printed many times, but it does not provide useful information, So I think it would be removed, and then the switch of BPF_LOGTYPE_COMMON can be changed to BPF_DEBUG_ON.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will try

Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
@nlgwcy
Copy link
Contributor

nlgwcy commented Jul 15, 2024

/lgtm
/approve

@kmesh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nlgwcy

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kmesh-bot kmesh-bot merged commit 01e9c9d into kmesh-net:main Jul 15, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unused BPF_LOG_LEVEL macro
3 participants