Skip to content

Commit

Permalink
define CC_USING_FENTRY if CONFIG_FUNCTION_TRACER is defined
Browse files Browse the repository at this point in the history
Fix issue #2734.

In 4.18 and later, when CONFIG_FUNCTION_TRACER is defined, kernel Makefile adds
-DCC_USING_FENTRY. Let do the same for bpf programs.

Signed-off-by: Yonghong Song <yhs@fb.com>
  • Loading branch information
yonghong-song committed Feb 4, 2020
1 parent f727a00 commit 6878949
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cc/export/helpers.h
Expand Up @@ -40,6 +40,13 @@ R"********(
#endif
#define asm_volatile_goto(x...) asm volatile("invalid use of asm_volatile_goto")

/* In 4.18 and later, when CONFIG_FUNCTION_TRACER is defined, kernel Makefile adds
* -DCC_USING_FENTRY. Let do the same for bpf programs.
*/
#if defined(CONFIG_FUNCTION_TRACER)
#define CC_USING_FENTRY
#endif

#include <uapi/linux/bpf.h>
#include <uapi/linux/if_packet.h>
#include <linux/version.h>
Expand Down

0 comments on commit 6878949

Please sign in to comment.