as created page: hardware timestamping authored by Andreas Schmidt's avatar Andreas Schmidt
## Usage
### Requirements
* Requirements are a kernel that supports physical timestamping.
### C/C++
* Hardware timestamping can be enabled per socket by calling `PrrtSocket_enable_hardware_timestamping()` in C and specifying the interface.
### Python
* WIP
## Compiling a Hardware Timestamping-Enabled Kernel on Ubuntu
* A detailed tutorial on kernel compilation can be found [here](https://help.ubuntu.com/community/Kernel/Compile).
* Create and enter a new folder, e.g. in your home directory that will store the newly compiled kernel.
* Run the following commands to download all resources required:
```bash
sudo apt install libncurses5 libncurses5-dev
sudo apt build-dep linux-image-`uname -r`
apt source linux-image-`uname -r`
cd linux-$(uname -r | awk '{split($1,a, "-"); print a[1]}')
```
* Copy the current kernel configuration to the current folder:
```bash
cp -vi /boot/config-`uname -r` .config
```
* Edit the `.config` file and ensure the following line is present (and the option is set to `y`):
```bash
...
CONFIG_NETWORK_PHY_TIMESTAMPING=y
...
```
* Call `make deb-pkg` (ideally with `-j5` or some other number to speed up the compilation by using multiple cores).
* Install the `linux-headers-*.deb` and `linux-image-*.deb` package via `dpkg -i` (where * stands for the respective kernel version).
* Reboot the system.