Skip to content

Commit

Permalink
ipfix probe: add common scheduling CLI opts
Browse files Browse the repository at this point in the history
(This disables profiling by default.)
  • Loading branch information
eugeneia committed Sep 22, 2022
1 parent 61b67a3 commit 22db66a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/program/ipfix/probe/README
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ Usage: snabb ipfix probe [options] <config>
snabb ipfix probe --help

Available options:
-n, --name Name of the Snabbflow instance.
-n, NAME --name NAME Name of the Snabbflow instance.
-b, --busywait Turn off idle sleep.
-r, --real-time Enable real-time SCHED_FIFO scheduler.
-p, --profile Enable VMProfile.
-h, --help Print this help text and exit.

The mandatory argument <config> must be a path to the initial
Expand Down
17 changes: 13 additions & 4 deletions src/program/ipfix/probe/probe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ local usage = require("program.ipfix.probe.README_inc")

local long_opts = {
help = "h",
name = "n"
name = "n",
busywait ="b",
["real-time"] = "r",
profile = "p"
}
local opt = "hn:"
local opt = "hn:brp"
local opt_handler = {}
local name
function opt_handler.n (arg) name = arg end
local busywait, real_time, profile = false, false, false
function opt_handler.h () print(usage) main.exit(0) end
function opt_handler.n (arg) name = arg end
function opt_handler.b () busywait = true end
function opt_handler.r () real_time = true end
function opt_handler.p () profile = true end

function run (args)
args = lib.dogetopt(args, opt_handler, opt, long_opts)
Expand Down Expand Up @@ -72,7 +79,9 @@ function start (name, confpath)
cpuset = probe_cpuset,
name = name,
worker_default_scheduling = {
busywait = false,
busywait = busywait,
real_time = real_time,
profile = profile,
jit_opt = {
sizemcode=256,
maxmcode=8192,
Expand Down

0 comments on commit 22db66a

Please sign in to comment.