REDROOM
PHP 8.5.2
Path:
Logout
Edit File
Size: 1.10 KB
Close
//usr/share/doc/bpfcc-tools/examples/lua/kprobe-write.lua
Text
Base64
#!/usr/bin/env bcc-lua --[[ Copyright 2016 Marek Vavrusa <mvavrusa@cloudflare.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ]] -- Simple tracing example that executes a program on -- return from sys_write() and tracks the number of hits local ffi = require('ffi') local bpf = require('bpf') local S = require('syscall') -- Shared part of the program local map = bpf.map('array', 1) -- Kernel-space part of the program local probe = bpf.kprobe('myprobe:sys_write', function (ptregs) xadd(map[0], 1) end, true) -- User-space part of the program pcall(function() for _ = 1, 10 do print('hits: ', tonumber(map[0])) S.sleep(1) end end)
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 17
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
bashreadline.c
476 B
lrw-r--r--
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
bashreadline.lua
1.08 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
kprobe-latency.lua
2.46 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
kprobe-write.lua
1.10 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
memleak.lua
6.05 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
offcputime.lua
3.04 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
sock-parse-dns.lua
1.65 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
sock-parse-http.lua
1.98 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
sock-proto.lua
1.40 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
sock-protolen.lua
1.50 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
strlen_count.lua
1.27 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
task_switch.lua
1.38 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tracepoint-offcputime.lua
2.59 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
uprobe-readline-perf.lua
1.88 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
uprobe-readline.lua
1.52 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
uprobe-tailkt.lua
2.50 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
usdt_ruby.lua
1.19 KB
lrwxr-xr-x
2023-12-08 15:36:51
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).