ccp-project / ccp-kernel

A Linux Kernel module implementing support for CCP congestion control algorithms
https://ccp-project.github.io/
MIT License
21 stars 8 forks source link

function getnstimeofday64() been deprecated in new version of linux kernel #22

Closed oocococo closed 4 years ago

oocococo commented 4 years ago

while compiling

➜  ccp-kernel git:(master) make
make -C /lib/modules/5.6.3-arch1-1/build M=/home/oocococo/Tools/ccp/ccp-kernel modules
make[1]: Entering directory '/usr/lib/modules/5.6.3-arch1-1/build'
  CC [M]  /home/oocococo/Tools/ccp/ccp-kernel/libccp/serialize.o
  CC [M]  /home/oocococo/Tools/ccp/ccp-kernel/libccp/ccp_priv.o
  CC [M]  /home/oocococo/Tools/ccp/ccp-kernel/libccp/machine.o
  CC [M]  /home/oocococo/Tools/ccp/ccp-kernel/libccp/ccp.o
  CC [M]  /home/oocococo/Tools/ccp/ccp-kernel/ccpkp/ccpkp.o
  CC [M]  /home/oocococo/Tools/ccp/ccp-kernel/ccpkp/lfq/lfq.o
  CC [M]  /home/oocococo/Tools/ccp/ccp-kernel/tcp_ccp.o
/home/oocococo/Tools/ccp/ccp-kernel/tcp_ccp.c: In function ‘ccp_now’:
/home/oocococo/Tools/ccp/ccp-kernel/tcp_ccp.c:78:5: error: implicit declaration of function ‘getnstimeofday64’ [-Werror=implicit-function-declaration]
   78 |     getnstimeofday64(&now);
      |     ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:268: /home/oocococo/Tools/ccp/ccp-kernel/tcp_ccp.o] Error 1
make[1]: *** [Makefile:1683: /home/oocococo/Tools/ccp/ccp-kernel] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.6.3-arch1-1/build'
make: *** [Makefile:36: all] Error 2

and after some reference, it seems the function getnstimeofday() had been deprecated and can not be used on v5.6.3, the replacement is ktime_get_real_ts64(), it's been supported since v4.14 (I didn't check kernel older than it). So I replace all the four getnstimeofday64(&now) with ktime_get_real_ts64(&now), and it works.

akshayknarayan commented 4 years ago

Thank you for the report! I have fixed this in https://github.com/ccp-project/ccp-kernel/commit/f7caa05450779471fcf55a4237d80e6edad0b847 (tested on kernel 5.4.0)