Skip to content

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

Merged
kmesh-bot merged 3 commits intokmesh-net:mainfrom
hzxuzhonghu:bpf-log
Jul 15, 2024
Merged

Provide a way to allow setting all logger level to debug#557
kmesh-bot merged 3 commits intokmesh-net:mainfrom
hzxuzhonghu:bpf-log

Conversation

@hzxuzhonghu
Copy link
Copy Markdown
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
Copy Markdown
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>
@codecov
Copy link
Copy Markdown

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
Copy Markdown
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

value = kmesh_map_lookup_elem(&bpf_log_level, &zero);
if (!value)
return 0;
return BPF_LOG_INFO;
Copy link
Copy Markdown
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_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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

nlgwcy commented Jul 15, 2024

/lgtm
/approve

@kmesh-bot
Copy link
Copy Markdown
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

Details 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
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