Re: [PATCH net-next] bpf: update perf event helper function signature and documentation
From: David Miller
Date: Thu May 25 2017 - 12:07:44 EST
From: Teng Qin <qinteng@xxxxxx>
Date: Tue, 23 May 2017 03:17:31 +0000
> Alexei said it was due to Clang not taking u64, u32 etc. for compilation.
> I didnʼt know the context and just used them. But apparently, something
> changed and now they build and run OK......
These types are %100 compiler agnostic. Clang doesn't care. All
compilers can understand:
typedef unsigned int u32;
So it's not a Clang specific issue.
The problem could only have to do with whether the types get typdef'd
or not with the header files that are used in conjunction with the
file we are talking about here.
And if we do get a proper set of defines from linux/types.h these days
we should:
1) Make that explicit, by including linux/types.h in bpf_helpers.h
2) Use those types universally in this file where we were avoiding
doing so
This header file also uses "SEC" and expects to get this definition
implicitly, and therefore there is another header file that
bpf_helpers.h must include in order to explicitly and reliably have
that definition.
Just changing one prototype, and relying on getting the types
indirectly by other header files including by whoever incudes
bpf_helpers.h is not the way to go.
Thanks.