-
Notifications
You must be signed in to change notification settings - Fork 70
Getting Started Guide
This guide covers the following topics:
- What is PFQ.
- HW and SW Requirements.
- Linux Distributions.
- Obtaining source codes.
- Satisfy library dependencies.
- Build the software.
- Software components.
PFQ is a multi-language network monitoring framework designed for the Linux Kernel 3.x. It is highly optimized for multi-core processors, as well as for network devices equipped with multiple hardware queues (i.e. Intel 82599 10G).
PFQ consists in a Linux Kernel module and user-space libraries, for the C, C++11/14 and Haskell languages.
- A 32/64-bit Linux operating system (Intel/AMD architectures are currently supported).
- Linux kernel 3.0 or higher.
- Kernel headers, required to compile modules for your kernel.
- A gcc compiler, the one used to compile the kernel in use.
- A g++ compiler (g++-4.8/clang-3.4 or higher), required to compile user-space tools and libraries.
- GHC Glasgow Haskell Compiler 7.8 or higher.
- Alex and happy tool.
- CMake and make.
PFQ is developed and tested on Linux Debian Jessie.
Debian Jessie is currently the stable distribution. Accidentally GHC 7.8 is not yet available from the stable
repository.
Hence it is recommended to either manually compile GHC or install it from a different repository. At the time of writing GHC 7.8 is available from jessie-backports
repository and GHC 7.10 is available from the testing
one.
To install a package from a different repository the APT pinning is required (which allows to install packages from one version (stable, testing, unstable) without the necessity of upgrading the entire system). More information is available on Debian site.
Use Hebert's PPA to install GHC and cabal-install as described at Stackage:
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:hvr/ghc
sudo apt-get update
sudo apt-get install -y cabal-install-1.20 ghc-7.8.4
cat >> ~/.bashrc <<EOF
export PATH=~/.cabal/bin:/opt/cabal/1.20/bin:/opt/ghc/7.8.4/bin:$PATH
EOF
export PATH=~/.cabal/bin:/opt/cabal/1.20/bin:/opt/ghc/7.8.4/bin:$PATH
cabal update
cabal install alex happy
Follow the instructions at Stackage site.
Clone the source codes from the GitHub repository with The following line:
git clone https://github.com/pfq/PFQ.git
master is the stable branch, while experimental is the branch of the most recent version (possibly untested).
Before building the framework, ensure the Haskell libraries on which it depends are installed.
You can use the cabal tool to install them. From the base directory launch the command:
cabal install --only-dep pfq-framework.cabal
Because of the strict dependencies of package versions imposed by authors, it could happen that this command fails. Hence, to relax upper bounds limits use the following one:
cabal install --only-dep --allow-newer pfq-framework.cabal
- To build and install the framework:
runhaskell Build.hs install --buildType=Release
The command configures, compiles and installs the framework satisfying the dependencies and the correct order to build of various components.
- Alternatively, you can specify the list of components you want to build from the command line. The following command shows the targets available:
runhaskell Build.hs show
Example:
runhaskell Build.hs install pfq.ko pfqd --buildType=Release
To avoid Cabal Hell, the SimpleBuilder supports building Haskell packages in cabal sandboxes.
You first need to create a cabal sandbox with the following commands:
mkdir shared-sandbox
cabal sandbox init --sandbox=shared-sandbox
Then you satisfy the pfq-framework dependency, running:
cabal install --only-dep -j4
All the required libraries will be installed in the sandbox.
After this you can build the framework with:
runhaskell Build.hs install --buildType=Release --sandbox=shared-sandbox
The PFQ Haskell library and packages will be installed in isolation within the specified sandbox directory.
The following components are currently part of the framework:
- pfq.ko
- pfq-clib
- pfq-cpplib
- pfq-haskell-lib
- pfq-hcounters
- pfq-htest
- irq-affinity
- pfq-omatic
- pfq-load
- pfq-stress
- pfqd
- tests
- tools