Skip to content

How to Install NoDrop from the Source Code

Xiankun Chen edited this page Mar 29, 2026 · 5 revisions

Currently, NoDrop supports Linux systems only. This page describes how to build NoDrop from source.

Environment Requirements

Before compiling NoDrop, ensure the following tools are installed:

  • make
  • CMake
  • GCC/G++ > 8.0 (must support the --static-pie option)
  • pkg-config

You can install them using your system package manager. For example on Ubuntu:

sudo apt update
sudo apt install build-essential cmake pkg-config

Kernel Requirements

NoDrop relies on Linux kernel tracepoints to capture system events.

The following kernel options must be enabled (they are usually enabled in standard kernels):

  • CONFIG_TRACEPOINTS
  • CONFIG_HAVE_SYSCALL_TRACEPOINTS

If you are using a custom-built kernel, please verify that these options are enabled.

Fetch Required Dependencies

NoDrop depends on musl libc, Lua, and zlib.

Helper scripts are provided to automatically download these dependencies.

Run the following commands from the project root directory:

./scripts/getmusl.sh <absolute-path-to-NoDrop>
./scripts/getlua.sh
./scripts/getzlib.sh

Example:

./scripts/getmusl.sh $(pwd)
./scripts/getlua.sh
./scripts/getzlib.sh

These scripts will download the required source code and prepare it inside the project directory.

Build NoDrop

To compile NoDrop:

mkdir build
cd build

cmake ..
make load
make ctrl
make install

Explanation:

  • make load

    Builds and loads the NoDrop kernel module.

  • make ctrl

    Builds the user-space control utility used by the nodrop command.

  • make install

    Install nodrop command (/usr/local/bin/nodrop)

After this step, you can use the nodrop command system-wide.

Example:

nodrop start

Configuration Options

NoDrop provides several configuration options that can be specified when generating the CMake build files.

Available Options

Option Description Default
BUFFER_SIZE Size of each per-thread buffer 1*Mib
MONITOR_PATH Path to the monitor executable ${PROJECT_BINARY_PATH}/monitor/monitor
STORE_PATH Directory used to store event data /tmp/nodrop
PKEY_SUPPORT Intel Protection Keys support ON

Example

You can specify these options when running cmake:

cmake .. \
  -DBUFFER_SIZE=8*Mib \
  -DMONITOR_PATH=/my/path/to/monitor \
  -DSTORE_PATH=/my/path/to/store

PKEY Support

NoDrop uses Intel Protection Keys (PKEY) to protect its memory.

PKEY support is enabled by default.

If your CPU does not support PKEY, you must disable this feature. Otherwise, the program will trigger a SIGILL due to illegal instructions.

To disable PKEY support:

cmake .. -DPKEY_SUPPORT=off

Clone this wiki locally