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

go tests failing because change of defination of function in latest bcc master branch #202

Closed
devidasjadhav opened this issue Sep 4, 2019 · 2 comments

Comments

@devidasjadhav
Copy link

devidasjadhav commented Sep 4, 2019

bcc commit "Support for hardware offload" d147588ebe35b7cd2b4d253a7da18bef253ea78d

added extra argument "const char *dev_name" which is failing this test.

# go test -tags integration -v ./...
# github.com/iovisor/gobpf/bcc
  ../github.com/iovisor/gobpf/bcc/module.go:98:40: not enough arguments in call to _Cfunc_bpf_module_create_c_from_string
	have (*_Ctype_char, number, **_Ctype_char, _Ctype_int, _Ctype__Bool)
	want (*_Ctype_char, _Ctype_uint, **_Ctype_char, _Ctype_int, _Ctype__Bool, *_Ctype_char)
FAIL	gobpf [build failed]
# gobpf/bcc
bcc/module.go:98:40: not enough arguments in call to _Cfunc_bpf_module_create_c_from_string
	have (*_Ctype_char, number, **_Ctype_char, _Ctype_int, _Ctype__Bool)
	want (*_Ctype_char, _Ctype_uint, **_Ctype_char, _Ctype_int, _Ctype__Bool, *_Ctype_char)
@vincentmli
Copy link

I came across the same problem, do you have patch to fix it? still new to golang, not sure how to fix it myself

go test -tags integration -v ./... github.com/iovisor/gobpf/bcc
/usr/local/go/src/github.com/iovisor/gobpf/bcc/module.go:98:8: error: not enough arguments
  c := C.bpf_module_create_c_from_string(cs, 2, (**C.char)(&cflagsC[0]), C.int(len(cflagsC)), (C.bool)(true))
        ^
FAIL	_/usr/src/gobpf [build failed]
# _/usr/src/gobpf/bcc
bcc/module.go:98:8: error: not enough arguments
  c := C.bpf_module_create_c_from_string(cs, 2, (**C.char)(&cflagsC[0]), C.int(len(cflagsC)), (C.bool)(true))
        ^

how to add the "const char *dev_name" in C.bpf_module_create_c_from_string?

@devidasjadhav
Copy link
Author

Add nil as last argument.
C.bpf_module_create_c_from_string(cs, 2, (**C.char)(&cflagsC[0]), C.int(len(cflagsC)), (C.bool)(true),nil)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants