doc/SystemTap_Beginners_Guide/testsuite/systemtap.bpf/asm_tests/pr23860.stp
raw| 1 | function foo:string () |
| 2 | %{ /* bpf */ /* pure */ /* unprivileged */ /* stable */ |
| 3 | 0xbf, $$, "key", -, -; /* mov $$, "key" */ |
| 4 | %} |
| 5 | |
| 6 | function bar:string () |
| 7 | { |
| 8 | return "kez" |
| 9 | } |
| 10 | |
| 11 | global t |
| 12 | |
| 13 | probe begin { |
| 14 | t[foo()] = 4 |
| 15 | t[bar()] = 6 |
| 16 | printf("U t[key]=%d, t[kez]=%d should be 4,6\n", t["key"], t["kez"]) |
| 17 | } |
| 18 | |
| 19 | probe kernel.function("vfs_read") { |
| 20 | t[foo()] = 5 |
| 21 | t[bar()] = 7 |
| 22 | printf("K t[key]=%d, t[kez]=%d should be 5,7\n", t["key"], t["kez"]) |
| 23 | exit() |
| 24 | } |