<commit_before>#!../../snabb snsh

-- Snabb test script for testing that retrieving queue stats on
-- a process that isn't the stats-syncing process works

local basic_apps = require("apps.basic.basic_apps")
local intel      = require("apps.intel_mp.intel_mp")
local pcap       = require("apps.pcap.pcap")
local counter    = require("core.counter")
local lib        = require("core.lib")
local shm        = require("core.shm")
local worker     = require("core.worker")
local pci        = require("lib.hardware.pci")

local pciaddr0 = pci.canonical(lib.getenv("SNABB_PCI_INTEL0"))
local pciaddr1 = pci.canonical(lib.getenv("SNABB_PCI_INTEL1"))

local function make_worker(pci, rxq, rxc)
   local code = string.format([[
      local basic_apps = require("apps.basic.basic_apps")
      local intel      = require("apps.intel_mp.intel_mp")

      local c = config.new()
      config.app(c, "sink", basic_apps.Sink)
      config.app(c, "nic", intel.Intel,
                 { pciaddr = "%s",
                   master_stats = false,
                   run_stats = true,
                   rxq = %d,
                   rxcounter = %d,
                   wait_for_link = true })
      config.link(c, "nic.output -> sink.input")
      engine.configure(c)
      engine.main({ duration = 2 })<commit_msg>apps.intel_mp: fix race condition in test_10g_counters.sh<commit_after>#!../../snabb snsh

-- Snabb test script for testing that retrieving queue stats on
-- a process that isn't the stats-syncing process works

local basic_apps = require("apps.basic.basic_apps")
local intel      = require("apps.intel_mp.intel_mp")
local pcap       = require("apps.pcap.pcap")
local counter    = require("core.counter")
local lib        = require("core.lib")
local shm        = require("core.shm")
local worker     = require("core.worker")
local pci        = require("lib.hardware.pci")

local pciaddr0 = pci.canonical(lib.getenv("SNABB_PCI_INTEL0"))
local pciaddr1 = pci.canonical(lib.getenv("SNABB_PCI_INTEL1"))

local function make_worker(pci, rxq, rxc)
   local code = string.format([[
      local basic_apps = require("apps.basic.basic_apps")
      local intel      = require("apps.intel_mp.intel_mp")

      local c = config.new()
      config.app(c, "sink", basic_apps.Sink)
      config.app(c, "nic", intel.Intel,
                 { pciaddr = "%s",
                   master_stats = false,
                   run_stats = true,
                   rxq = %d,
                   rxcounter = %d,
                   wait_for_link = true })
      config.link(c, "nic.output -> sink.input")
      engine.configure(c)
      engine.main()
{'fraction_non_alphanumeric': 0.12853863810252486, 'fraction_numerical': 0.004208110175975516, 'mean_word_length': 2.486666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4996971', 'n_tokens_mistral': 829, 'n_tokens_neox': 818, 'n_words': 187}