Skip to content

Commit

Permalink
Fix kernel 5 11 (#200)
Browse files Browse the repository at this point in the history
Fix compatibility with new kernels
  • Loading branch information
thiagoftsm authored Mar 3, 2021
1 parent 6d51a2a commit 457aca6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
fail-fast: false
matrix:
kernel_version:
- '5.11.2'
- '5.10.3'
- '5.4.85'
- '4.16.18'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
strategy:
matrix:
kernel_version:
- '5.11.2'
- '5.10.3'
- '5.4.85'
- '4.16.18'
Expand Down
Empty file added kernel-patches/5.11.2/.gitkeep
Empty file.
8 changes: 8 additions & 0 deletions kernel/process_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,11 +817,19 @@ int netdata_sys_clone(struct pt_regs *ctx)

#endif

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
#if NETDATASEL < 2
SEC("kretprobe/close_fd")
#else
SEC("kprobe/close_fd")
#endif
#else
#if NETDATASEL < 2
SEC("kretprobe/__close_fd")
#else
SEC("kprobe/__close_fd")
#endif
#endif
int netdata_close(struct pt_regs* ctx)
{
#if NETDATASEL < 2
Expand Down

0 comments on commit 457aca6

Please sign in to comment.