From a56f2b59dc27b997cef41ea05e83508619b6c620 Mon Sep 17 00:00:00 2001 From: kangmingfa <1640528278@qq.com> Date: Thu, 20 Jun 2024 15:16:37 +0800 Subject: [PATCH] Add bpf log doc. Signed-off-by: kangmingfa <1640528278@qq.com> --- content/en/docs/setup/quickstart.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/content/en/docs/setup/quickstart.md b/content/en/docs/setup/quickstart.md index 145932d..955502b 100644 --- a/content/en/docs/setup/quickstart.md +++ b/content/en/docs/setup/quickstart.md @@ -132,6 +132,30 @@ Content-Length: 0 Note: 10.244.0.21 is the IP of httpbin +## Enable dataplane bpf log + +For current kmesh ebpf log, if kernel version is < 5.13, it only supports bpf log in tracepipe, else will support dump bpf log to userspace in kmesh daemon process. +So in order to print log in kemsh dataplane, enable different log level for your need. Support 4 bpf log level: +``` + BPF_LOG_ERR = 0, + BPF_LOG_WARN = 1, + BPF_LOG_INFO = 2, + BPF_LOG_DEBUG = 3, +``` +Currently default bpf log level is BPF_LOG_ERR, we can change bpf log level in every node by using below command, for example, 3 represents enable BPF_LOG_DEBUG log level: + +``` +kubectl exec ds/kmesh -n kmesh-system -- curl -s localhost:15200/debug/bpfLogLevel/3 +``` +Then, if kernel version < 5.13, we could see the bpf log use command: +``` +cat /sys/kernel/debug/tracing/trace_pipe +``` +Otherwise, we can view the bpf log in kemsh daemon process. +``` +kubectl logs -f -n kmesh-system ds/kmesh +``` + ## Clean Up If you don't want to use Kmesh to govern the application anymore, you can delete the labels on the namespace and restart the pod.