-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* change luaprobe to sleep=false * split systrack into two runtimes (driver and probes)
- Loading branch information
Showing
5 changed files
with
47 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
-- | ||
-- SPDX-FileCopyrightText: (c) 2023-2024 Ring Zero Desenvolvimento de Software LTDA | ||
-- SPDX-License-Identifier: MIT OR GPL-2.0-only | ||
-- | ||
|
||
local lunatik = require("lunatik") | ||
local probe = require("probe") | ||
local syscall = require("syscall.table") | ||
local data = require("data") | ||
|
||
local systrack = lunatik._ENV.systrack | ||
|
||
local function nop() end -- do nothing | ||
|
||
local function inc(counter) | ||
counter:setnumber(0, counter:getnumber(0) + 1) | ||
end | ||
|
||
local sizeofnumber = string.packsize("n") | ||
|
||
for symbol, address in pairs(syscall) do | ||
systrack[symbol] = data.new(sizeofnumber) | ||
|
||
local function handler() | ||
inc(systrack[symbol]) | ||
end | ||
|
||
probe.new(address, {pre = handler, post = nop}) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters