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

Improve logging of BPF generation errors #990

Merged
merged 3 commits into from
Jun 17, 2017
Merged

Improve logging of BPF generation errors #990

merged 3 commits into from
Jun 17, 2017

Conversation

tgraf
Copy link
Member

@tgraf tgraf commented Jun 15, 2017

Produces clear and easy to understand error messages:

WARN[0002] + OPTS='-DSECLABEL=2 -DPOLICY_MAP=cilium_policy_reserved_2 -DCALLS_MAP=cilium_calls_overlay_2'
WARN[0002] + IN=bpf_overlay.c
WARN[0002] + OUT=bpf_overlay.o
WARN[0002] ++ ip link show cilium_vxlan


WARN[0002] ++ grep ether
WARN[0002] ++ awk '{print $2}'
WARN[0002] + NODE_MAC=76:f9:95:b7:8f:81
WARN[0002] ++ mac2array 76:f9:95:b7:8f:81
WARN[0002] ++ echo '{0x76,0xf9,0x95,0xb7,0x8f,0x81}'
WARN[0002] + NODE_MAC='{.addr={0x76,0xf9,0x95,0xb7,0x8f,0x81}}'
WARN[0002] + clang -D__NR_CPUS__=2 -O2 -target bpf -I/run/cilium/state/globals -I. -I/var/lib/cilium/bpf/include -DENABLE_ARP_RESPONDER -DHANDLE_NS -Wno-address-of-packed-member -Wno-unknown-warning-option -DSECLABEL=2 -DPOLICY_MAP=cilium_policy_reserved_2 -DCALLS_MAP=cilium_calls_overlay_2 '-DNODE_MAC={.addr={0x76,0xf9,0x95,0xb7,0x8f,0x81}}' -c /var/lib/cilium/bpf/bpf_overlay.c -o bpf_overlay.o
WARN[0002] In file included from /var/lib/cilium/bpf/bpf_overlay.c:27:
WARN[0002] In file included from /var/lib/cilium/bpf/lib/common.h:21:
WARN[0002] /run/cilium/state/globals/bpf_features.h:1:2: error: unterminated conditional directive
WARN[0002] #ifndef BPF_FEATURES_H_
WARN[0002]  ^
WARN[0002] 1 error generated.
ERRO[0002] Error while initializing daemon: exit status 1

FATA[0002] Error while creating daemon: exit status 1

@tgraf tgraf requested a review from ianvernon June 15, 2017 13:35
@tgraf tgraf added the kind/bug This is a bug in the Cilium logic. label Jun 15, 2017
@tgraf tgraf added this to the 0.10 milestone Jun 15, 2017
tgraf added 2 commits June 15, 2017 23:45
Signed-off-by: Thomas Graf <thomas@cilium.io>
@tgraf tgraf force-pushed the bpf-log-warning branch from 9b46c7a to 5fd7e20 Compare June 15, 2017 21:46
Signed-off-by: Thomas Graf <thomas@cilium.io>
@tgraf tgraf requested review from aanm and removed request for ianvernon June 16, 2017 22:32

scanner := bufio.NewScanner(bytes.NewReader(out))
for scanner.Scan() {
log.Warning(scanner.Text())
Copy link
Member

Choose a reason for hiding this comment

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

This is awesome!

@tgraf tgraf merged commit 178bbd3 into master Jun 17, 2017
@tgraf tgraf deleted the bpf-log-warning branch June 17, 2017 07:12
@ianvernon
Copy link
Member

This is great, thanks for taking care of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is a bug in the Cilium logic.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants