Comments (6)
I'll paste some commands I've run to test various things in development. These can be put in the runtime test suite:
bpftrace -e 'BEGIN { @aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1; exit(); }'
bpftrace -e 'BEGIN { $x = -123; printf("%d %lld %lld\n", $x, $x, - $x); exit(); }'
bpftrace -e 'BEGIN { $x = -2; printf("%d\n", $x >= 0 ? 0 : - $x); exit(); }'
bpftrace -e 'kprobe:vfs_read { @ = count(); } interval:s:1 { print(@); clear(@); exit(); }'
bpftrace -e 'kprobe:vfs_read { @a = count(); } interval:s:1 { print(@a); clear(@a); exit(); }'
bpftrace -e 'kprobe:vfs_read { @ab = count(); } interval:s:1 { print(@ab); clear(@ab); exit(); }'
bpftrace -e 'kprobe:vfs_read { @abc = count(); } interval:s:1 { print(@abc); clear(@abc); exit(); }'
bpftrace -e 'kprobe:vfs_read { @abcd = count(); } interval:s:1 { print(@abcd); clear(@abcd); exit(); }'
bpftrace -e 'kprobe:vfs_read { @abcde = count(); } interval:s:1 { print(@abcde); clear(@abcde); exit(); }'
bpftrace -e 'kprobe:vfs_read { @abcdef = count(); } interval:s:1 { print(@abcdef); clear(@abcdef); exit(); }'
bpftrace -e 'kprobe:vfs_read { @abcdefg = count(); } interval:s:1 { print(@abcdefg); clear(@abcdefg); exit(); }'
bpftrace -e 'kprobe:vfs_read { @abcdefgh = count(); } interval:s:1 { print(@abcdefgh); clear(@abcdefgh); exit(); }'
bpftrace -e 'kprobe:vfs_read { @abcdefghi = count(); } interval:s:1 { print(@abcdefghi); clear(@abcdefghi); exit(); }'
bpftrace -e 'kprobe:vfs_read { @abcdefghij = count(); } interval:s:1 { print(@abcdefghij); clear(@abcdefghij); exit(); }'
bpftrace -e 'kprobe:vfs_read { @abcdefghijk = count(); } interval:s:1 { print(@abcdefghijk); clear(@abcdefghijk); exit(); }'
bpftrace -e 'kprobe:vfs_read { @abcdefghijkl = count(); } interval:s:1 { print(@abcdefghijkl); clear(@abcdefghijkl); exit(); }'
I'll keep adding here when I remember.
from bpftrace.
Maybe we should mark this as priority to help us identify regressions like #103 sooner?
Also, it would be nice to have a CI for the project :)
from bpftrace.
Yeah, I'd thought about making this priority. And please file a separate ticket for CI.
I'll keep adding one-liners here for the runtime test. Just something basic that can run a bunch of one-liners and see if they fail would be great. bcc has a test suite for running tools, I haven't looked into it to see if that's the same approach we want.
I suppose each one-liner can end with 'interval:ms:50 { exit(); }', to ensure it exits quickly.
from bpftrace.
More one-liners:
bpftrace -e 'tracepoint:syscalls:sys_enter_r* { @[name] = count(); }'
bpftrace -e 'tracepoint:raw_syscalls:sys_enter { @ = count(); } interval:s:1 { print(@); clear(@); }'
bpftrace -e 'tracepoint:syscalls:sys_enter_open { @a = count(); } tracepoint:syscalls:sys_enter_open { @b = count(); }'
from bpftrace.
Should it run with the other tests or separated? The test suite takes about 20s to run.
Right now I'm running them with:
cd tests/python
sudo python -m unittest discover --pattern=*.py
from bpftrace.
I think it should have it's own separate way of running the tests as these new ones will require root and probably won't work in the CI
from bpftrace.
Related Issues (20)
- iter:task_file: invalid write to stack R10 off=8 size=4 HOT 2
- tests: variable.tracepoint behaves randomly on Linux v6.10 HOT 1
- tests: call.strcontains fails constantly on Linux v6.10 HOT 4
- Can't set uprobes using the appimage starting from v0.21.0 HOT 1
- `--dry-run` should not run programs HOT 3
- bpftrace fails to build with bfd support on openSUSE Tumbleweed
- Unable to pass 64bit hex values larger than LLONG_MAX as positional arguments HOT 3
- Docs update suggestion for installation on Ubuntu 22.04 and lower HOT 1
- kfunc feature discovery on power
- Debug output (`-d`) in AOT HOT 1
- RFC: Probe Attributes HOT 11
- RFC: Methods HOT 2
- `strcontains` fails with stack exceeded error HOT 7
- Support an optional size parameter for `path()` builtin HOT 5
- Split output on `-lv`, to `stdout` and `stderr` HOT 2
- join(args.argv) prints nothing HOT 15
- Tracing programs must provide btf_id HOT 2
- Add AOT support for uprobe probes that use Debug Info HOT 1
- Feature Request: perf the specific process/thread HOT 3
- Compilation error with gcc-15: uint64_t has not been declared
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bpftrace.