├── .gitignore ├── .mailmap ├── .tx └── config ├── ABOUT-NLS ├── AUTHORS ├── AUTHORS.sh ├── COPYING ├── HACKING ├── INSTALL ├── INTERNALS ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── README.security ├── README.unprivileged ├── aclocal.m4 ├── auto_free.h ├── buildrun.cxx ├── buildrun.h ├── cache.cxx ├── cache.h ├── cmdline.cxx ├── cmdline.h ├── compile ├── config.guess ├── config.in ├── config.rpath ├── config.sub ├── configure ├── configure.ac ├── coveragedb.cxx ├── coveragedb.h ├── csclient.cxx ├── csclient.h ├── cscommon.cxx ├── cscommon.h ├── depcomp ├── doc ├── .gitignore ├── .latex2html-init ├── Language_Reference_Guide │ ├── Makefile │ ├── README │ ├── en-US │ │ ├── Author_Group.xml │ │ ├── Book_Info.xml │ │ ├── Language_Reference_Guide.ent │ │ ├── Preface.xml │ │ ├── Revision_History.xml │ │ └── images │ │ │ └── icon.svg │ └── publicanize-langref.sh ├── Makefile.am ├── Makefile.in ├── SystemTap_Beginners_Guide │ ├── .gitignore │ ├── en-US │ │ ├── Appendix.xml │ │ ├── Array-Operations.xml │ │ ├── Arrays.xml │ │ ├── Author_Group.xml │ │ ├── Book_Info.xml │ │ ├── Chapter.xml │ │ ├── CrossInstrumenting.xml │ │ ├── Errors.xml │ │ ├── Feedback.xml │ │ ├── Installation.xml │ │ ├── Introduction.xml │ │ ├── Legal_Notice.xml │ │ ├── Preface.xml │ │ ├── References.xml │ │ ├── Revision_History.xml │ │ ├── ScriptConstructs.xml │ │ ├── Scripts.xml │ │ ├── Section.xml │ │ ├── SystemTap_Beginners_Guide.ent │ │ ├── SystemTap_Beginners_Guide.xml │ │ ├── Tips_Tricks.xml │ │ ├── Understanding_How_SystemTap_Works.xml │ │ ├── Useful_Advanced_Scripts.xml │ │ ├── Useful_Scripts-Disk.xml │ │ ├── Useful_Scripts-IO.xml │ │ ├── Useful_Scripts-Kernel.xml │ │ ├── Useful_Scripts-Network.xml │ │ ├── Useful_Scripts-Others.xml │ │ ├── Useful_Scripts-Signals.xml │ │ ├── Useful_Scripts-Syscalls.xml │ │ ├── Useful_Scripts-disktop.xml │ │ ├── Useful_Scripts-dropwatch.xml │ │ ├── Useful_Scripts-functioncalls.xml │ │ ├── Useful_Scripts-futexes.xml │ │ ├── Useful_Scripts-inodewatch.xml │ │ ├── Useful_Scripts-inodewatch2.xml │ │ ├── Useful_Scripts-ioblktime.xml │ │ ├── Useful_Scripts-iotime.xml │ │ ├── Useful_Scripts-iotop.xml │ │ ├── Useful_Scripts-kernelprofiling.xml │ │ ├── Useful_Scripts-nettop.xml │ │ ├── Useful_Scripts-paracallgraph.xml │ │ ├── Useful_Scripts-sockettrace.xml │ │ ├── Useful_Scripts-syscallsbyprocpid.xml │ │ ├── Useful_Scripts-tcp_connections.xml │ │ ├── Useful_Scripts-tcpdumplike.xml │ │ ├── Useful_Scripts-threadtimes.xml │ │ ├── Useful_Scripts-timeout.xml │ │ ├── Useful_Scripts-topsys.xml │ │ ├── Useful_Scripts-traceio.xml │ │ ├── Useful_Scripts-traceio2.xml │ │ ├── Useful_SystemTap_Scripts.xml │ │ ├── Userspace_probing.xml │ │ ├── Using_SystemTap.xml │ │ ├── extras │ │ │ ├── cast_example.stp │ │ │ ├── defined_example.stp │ │ │ ├── fedoradebugurl.sh │ │ │ ├── perror.stp │ │ │ ├── rhelchannels.sh │ │ │ ├── rheldebugurl.sh │ │ │ └── werror.stp │ │ └── images │ │ │ ├── gnuplotsample.png │ │ │ └── icon.svg │ └── publican.cfg.in ├── SystemTap_Tapset_Reference │ ├── .gitignore │ ├── Makefile.am │ ├── Makefile.in │ ├── docproc.c │ ├── dummy-tapsets.xml │ ├── manpager │ ├── sort-tapsets.xslt │ ├── tapcheck.sh │ └── tapsets.tmpl ├── Tapset_Reference_Guide │ ├── Makefile │ ├── README │ ├── en-US │ │ ├── Author_Group.xml │ │ ├── Book_Info.xml │ │ ├── Introduction.xml │ │ ├── Legal_Notice.xml │ │ ├── Preface.xml │ │ ├── Tapset_Dev_Guide.xml │ │ ├── Tapset_Reference_Guide.ent │ │ └── images │ │ │ └── icon.svg │ ├── manpager.sh │ └── publicanize.sh ├── beginners │ ├── Makefile.am │ └── Makefile.in ├── langref.tex ├── nomencl.sty ├── tutorial.tex └── tutorial │ ├── embedded-C.stp │ ├── functions.stp │ ├── hello-world.stp │ ├── inode-watch.stp │ ├── probe-alias.stp │ ├── socket-trace.stp │ ├── strace-open.stp │ ├── tapset-time-user.stp │ ├── tapset │ ├── time-common.stp │ └── time-default.stp │ └── timer-jiffies.stp ├── dtrace.1 ├── dtrace.in ├── dwarf_wrappers.cxx ├── dwarf_wrappers.h ├── dwflpp.cxx ├── dwflpp.h ├── elaborate.cxx ├── elaborate.h ├── git_version.sh ├── hash.cxx ├── hash.h ├── includes ├── stap-probe.h └── sys │ ├── .gitignore │ ├── sdt-config.h.in │ └── sdt.h ├── initscript ├── .gitignore ├── README.stap-server ├── README.systemtap ├── config.stap-server ├── config.systemtap ├── logrotate.stap-server ├── stap-server.in └── systemtap.in ├── install-sh ├── loc2c-test.c ├── loc2c.c ├── loc2c.h ├── m4 ├── gettext.m4 ├── iconv.m4 ├── lib-ld.m4 ├── lib-link.m4 ├── lib-prefix.m4 ├── nls.m4 ├── po.m4 └── progtest.m4 ├── main.cxx ├── mdfour.c ├── mdfour.h ├── missing ├── nsscommon.cxx ├── nsscommon.h ├── parse.cxx ├── parse.h ├── po ├── .gitignore ├── LINGUAS ├── Makefile.in.in ├── Makevars ├── POTFILES.in ├── README ├── Rules-quot ├── boldquot.sed ├── en.gmo ├── en.po ├── en@boldquot.header ├── en@quot.header ├── fr.gmo ├── fr.po ├── insert-header.sin ├── pl.gmo ├── pl.po ├── quot.sed ├── remove-potcdate.sin └── systemtap.pot ├── privilege.cxx ├── privilege.h ├── remote.cxx ├── remote.h ├── rpm_finder.cxx ├── rpm_finder.h ├── run-stap.in ├── runtest.sh ├── runtime ├── .gitignore ├── Doxyfile ├── README ├── README.doc ├── TODO ├── access_process_vm.h ├── addr-map.c ├── alloc.c ├── arith.c ├── autoconf-alloc-percpu-align.c ├── autoconf-asm-syscall.c ├── autoconf-blk-types.c ├── autoconf-constant-tsc.c ├── autoconf-dpath-path.c ├── autoconf-fs_supers-hlist.c ├── autoconf-generated-compile.c ├── autoconf-grsecurity.c ├── autoconf-hrtimer-getset-expires.c ├── autoconf-hrtimer-rel.c ├── autoconf-hw_breakpoint_context.c ├── autoconf-inode-private.c ├── autoconf-kallsyms-on-each-symbol.c ├── autoconf-kprobe-symbol-name.c ├── autoconf-ktime-get-real.c ├── autoconf-mm-context-vdso-base.c ├── autoconf-mm-context-vdso.c ├── autoconf-module-sect-attrs.c ├── autoconf-nameidata.c ├── autoconf-old-inode-uprobes.c ├── autoconf-oneachcpu-retry.c ├── autoconf-perf-structpid.c ├── autoconf-procfs-owner.c ├── autoconf-real-parent.c ├── autoconf-regset.c ├── autoconf-relay-umode_t.c ├── autoconf-ring_buffer-flags.c ├── autoconf-ring_buffer_lost_events.c ├── autoconf-ring_buffer_read_prepare.c ├── autoconf-save-stack-trace-no-bp.c ├── autoconf-save-stack-trace.c ├── autoconf-stacktrace_ops-warning.c ├── autoconf-task-uid.c ├── autoconf-trace-printk.c ├── autoconf-uaccess.c ├── autoconf-uprobe-get-pc.c ├── autoconf-utrace-regset.c ├── autoconf-utrace-via-tracepoints.c ├── autoconf-vm-area-pte.c ├── autoconf-walk-stack.c ├── autoconf-x86-gs.c ├── autoconf-x86-uniregs.c ├── bench2 │ ├── Makefile │ ├── README │ ├── a.st │ ├── b.st │ ├── bench.rb │ ├── const.st │ ├── itest.c │ ├── print_bench │ ├── results.txt │ ├── run_bench │ ├── run_binary_print │ ├── stap_bench │ ├── test_bench │ ├── var.st │ └── var_bench ├── common_probe_context.h ├── common_session_state.h ├── compatdefs.h ├── copy.c ├── debug.h ├── docs │ ├── examples │ │ ├── argv.c │ │ ├── foreach.c │ │ ├── list.c │ │ ├── map.c │ │ └── template.c │ ├── footer.html │ └── header.html ├── io.c ├── itrace.c ├── kprobes-common.h ├── loc2c-runtime.h ├── map-gen.c ├── map-stat.c ├── map.c ├── map.doc ├── map.h ├── mempool.c ├── perf.c ├── perf.h ├── perf_event_counter_context.c ├── perf_probe_handler_nmi.c ├── pmap-gen.c ├── print.c ├── print.h ├── print_flush.c ├── probe_lock.h ├── procfs-probes.c ├── procfs.c ├── ptrace_compatibility.h ├── regs-ia64.c ├── regs.c ├── regs.h ├── runtime.h ├── runtime_context.h ├── runtime_defines.h ├── stack-arm.c ├── stack-dwarf.c ├── stack-ia64.c ├── stack-s390.c ├── stack.c ├── staprun │ ├── Makefile.am │ ├── Makefile.in │ ├── aclocal.m4 │ ├── common.c │ ├── config.in │ ├── configure │ ├── configure.ac │ ├── ctl.c │ ├── mainloop.c │ ├── modverify.c │ ├── modverify.h │ ├── relay.c │ ├── relay_old.c │ ├── run-staprun.in │ ├── stap_merge.c │ ├── stap_merge.tcl │ ├── stapio.c │ ├── staprun.8 │ ├── staprun.c │ ├── staprun.h │ ├── staprun_funcs.c │ └── stapsh.c ├── stat-common.c ├── stat.c ├── stat.h ├── stp_utrace.c ├── stp_utrace.h ├── string.c ├── string.h ├── sym.c ├── sym.h ├── syscall.h ├── task_finder.c ├── task_finder2.c ├── task_finder_map.c ├── task_finder_vma.c ├── time.c ├── transport │ ├── control.c │ ├── control.h │ ├── debugfs.c │ ├── procfs.c │ ├── relay_v2.c │ ├── relayfs.c │ ├── relayfs.h │ ├── ring_buffer.c │ ├── symbols.c │ ├── transport.c │ ├── transport.h │ ├── transport.txt │ └── transport_msgs.h ├── unwind.c ├── unwind │ ├── arm.h │ ├── i386.h │ ├── ppc64.h │ ├── s390x.h │ ├── unwind.h │ └── x86_64.h ├── uprobes-common.c ├── uprobes-common.h ├── uprobes-inc.h ├── uprobes-inode.c ├── uprobes │ ├── .gitignore │ ├── Makefile │ ├── uprobes.c │ ├── uprobes.h │ ├── uprobes.txt │ ├── uprobes_arch.c │ ├── uprobes_arch.h │ ├── uprobes_i386.c │ ├── uprobes_i386.h │ ├── uprobes_ppc.c │ ├── uprobes_ppc.h │ ├── uprobes_s390.c │ ├── uprobes_s390.h │ ├── uprobes_x86.c │ ├── uprobes_x86.h │ ├── uprobes_x86_64.c │ └── uprobes_x86_64.h ├── uprobes2 │ ├── uprobes.c │ ├── uprobes.h │ ├── uprobes_arch.c │ ├── uprobes_arch.h │ ├── uprobes_arm.c │ ├── uprobes_arm.h │ ├── uprobes_x86.c │ └── uprobes_x86.h ├── utrace_compatibility.h ├── vma.c ├── vsprintf.c └── vsprintf.h ├── scripts ├── kernel-doc ├── kprobes_test │ ├── .gitignore │ ├── README │ ├── config_opts.py │ ├── default.cfg │ ├── gen_code.py │ ├── gen_code_all.sh │ ├── is_probed.py │ ├── kprobe_module.c │ ├── kprobes_test.py │ ├── monitor_system.py │ ├── readelf.py │ └── run_module.py └── probe_perf │ ├── .gitignore │ ├── bench.c │ ├── bench.sh │ ├── bench.stp │ └── bench_.d ├── sdt_types.h ├── session.cxx ├── session.h ├── setupdwfl.cxx ├── setupdwfl.h ├── smileytap.svg ├── stap-authorize-cert.cxx ├── stap-env ├── stap-gen-cert.cxx ├── stap-merge.1 ├── stap-prep ├── stap-report ├── stap-server ├── stap-server.8 ├── stap-serverd.cxx ├── stap-sign-module.cxx ├── stap-start-server ├── stap-stop-server ├── stap.1 ├── stapex.3stap ├── staplog.c ├── stappaths.7.in ├── stapprobes.3stap ├── stapsslerr.h ├── staptree.cxx ├── staptree.h ├── stapvars.3stap ├── systemtap.spec ├── tapset-been.cxx ├── tapset-itrace.cxx ├── tapset-mark.cxx ├── tapset-netfilter.cxx ├── tapset-perfmon.cxx ├── tapset-procfs.cxx ├── tapset-timers.cxx ├── tapset-utrace.cxx ├── tapset ├── DEVGUIDE ├── README ├── ansi.stp ├── argv.stp ├── arm │ ├── aux_syscalls.stp │ └── registers.stp ├── atomic.stp ├── aux_syscalls.stp ├── context-caller.stp ├── context-envvar.stp ├── context-symbols.stp ├── context-unwind.stp ├── context.stp ├── conversions-guru.stp ├── conversions.stp ├── ctime.stp ├── dentry.stp ├── dev.stp ├── doc │ └── discrepancies.txt ├── endian.stp ├── errno.stp ├── guru-delay.stp ├── i386 │ ├── aux_syscalls.stp │ ├── nd_syscalls.stp │ ├── registers.stp │ └── syscalls.stp ├── ia64 │ ├── aux_syscalls.stp │ ├── nd_syscalls.stp │ ├── registers.stp │ └── syscalls.stp ├── indent-default.stp ├── indent.stp ├── inet.stp ├── inet_sock.stp ├── ioblock.stp ├── ioscheduler.stp ├── ip.stp ├── ipmib-filter-default.stp ├── ipmib.stp ├── irq.stp ├── kprocess.stp ├── kretprobe.stp ├── linuxmib-filter-default.stp ├── linuxmib.stp ├── logging.stp ├── memory.stp ├── nd_syscalls.stp ├── nd_syscalls2.stp ├── netfilter.stp ├── networking.stp ├── nfs.stp ├── nfs_proc.stp ├── nfsd.stp ├── nfsderrno.stp ├── null.stp ├── perf.stp ├── pn.stp ├── powerpc │ ├── aux_syscalls.stp │ ├── nd_syscalls.stp │ ├── registers.stp │ └── syscalls.stp ├── proc_mem.stp ├── pstrace.stp ├── queue_stats.stp ├── random.stp ├── registers.stp ├── rpc.stp ├── s390 │ ├── aux_syscalls.stp │ ├── nd_syscalls.stp │ ├── registers.stp │ └── syscalls.stp ├── scheduler.stp ├── scsi.stp ├── signal.stp ├── socket.stp ├── speculative.stp ├── stap_staticmarkers.stp ├── stopwatch.stp ├── string.stp ├── syscalls.stp ├── syscalls2.stp ├── syscalls_cfg_trunc.stp ├── system.stp ├── target_set.stp ├── task.stp ├── task_time.stp ├── tcp.stp ├── tcpmib-filter-default.stp ├── tcpmib.stp ├── test │ ├── README │ ├── build.sh │ ├── ctostp.sh │ ├── gencfiles.sh │ ├── master.c │ └── run.sh ├── timestamp.stp ├── timestamp_gtod.stp ├── timestamp_monotonic.stp ├── tokenize.stp ├── tty.stp ├── tzinfo.stp ├── ucontext-symbols.stp ├── ucontext-unwind.stp ├── ucontext.stp ├── uconversions.stp ├── udp.stp ├── utrace.stp ├── vfs.stp └── x86_64 │ ├── aux_syscalls.stp │ ├── nd_syscalls.stp │ ├── registers.stp │ └── syscalls.stp ├── tapsets.cxx ├── tapsets.h ├── task_finder.cxx ├── task_finder.h ├── testsuite ├── .gitignore ├── Makefile.am ├── Makefile.in ├── aclocal.m4 ├── buildko │ ├── one.stp │ ├── three.stp │ └── two.stp ├── buildok │ ├── array_size.stp │ ├── atomic.stp │ ├── aux_syscalls-embedded.stp │ ├── cmdline01.stp │ ├── context-embedded.stp │ ├── context-symbols-embedded.stp │ ├── context-unwind-embedded.stp │ ├── conversions-embedded.stp │ ├── conversions-guru-embedded.stp │ ├── conversions.stp │ ├── ctime-embedded.stp │ ├── delete.stp │ ├── dentry-embedded.stp │ ├── dev-embedded.stp │ ├── eight.stp │ ├── eighteen.stp │ ├── eleven.stp │ ├── endian-embedded.stp │ ├── errno-embedded.stp │ ├── fifteen.stp │ ├── five.stp │ ├── fortyfive.stp │ ├── fortyone.stp │ ├── fortysix.stp │ ├── fortytwo.stp │ ├── four.stp │ ├── fourteen-plus.stp │ ├── fourteen.stp │ ├── gtod_init.stp │ ├── gtod_noinit.stp │ ├── histogram_operator_in.stp │ ├── hwbkpt.stp │ ├── indent.stp │ ├── inet-embedded.stp │ ├── inet_sock-embedded.stp │ ├── ioblock-all-probes.stp │ ├── ioblock-detailed.stp │ ├── ioblock-embedded.stp │ ├── ioscheduler-all-probes.stp │ ├── ioscheduler-detailed.stp │ ├── ioscheduler-embedded.stp │ ├── ip-embedded.stp │ ├── ipmib-all-probes.stp │ ├── ipmib-detailed.stp │ ├── ipmib-embedded.stp │ ├── irq-all-probes.stp │ ├── irq-detailed.stp │ ├── iterate_histogram_buckets.stp │ ├── kprocess-all-probes.stp │ ├── kprocess-detailed.stp │ ├── kprocess-embedded.stp │ ├── linuxmib-all-probes.stp │ ├── linuxmib-detailed.stp │ ├── logging-embedded.stp │ ├── maxactive01.stp │ ├── memory-all-probes.stp │ ├── memory-detailed.stp │ ├── memory-embedded.stp │ ├── memory-mmap.stp │ ├── memory-write_shared_copy.stp │ ├── memory.stp │ ├── nd_syscalls-all-probes.stp │ ├── nd_syscalls-arch-detailed.stp │ ├── nd_syscalls-detailed.stp │ ├── nd_syscalls2-detailed.stp │ ├── netfilter01.stp │ ├── netfilter02.stp │ ├── netfilter03.stp │ ├── netfilter04.stp │ ├── networking-all-probes.stp │ ├── networking-change_rx_flag.stp │ ├── networking-detailed.stp │ ├── networking-embedded.stp │ ├── newlocals01.stp │ ├── nfs-all-probes.stp │ ├── nfs-detailed.stp │ ├── nfs-embedded.stp │ ├── nfs-fop.check_flags.stp │ ├── nfs_proc-detailed.stp │ ├── nfs_proc-embedded.stp │ ├── nfsd-all-probes.stp │ ├── nfsd-detailed.stp │ ├── nfsd-embedded.stp │ ├── nfsderrno-embedded.stp │ ├── nine.stp │ ├── nineteen.stp │ ├── null.stp │ ├── oldlocals01.stp │ ├── one.stp │ ├── per-process-syscall.stp │ ├── pmap_foreach.stp │ ├── pr10678.stp │ ├── pr13284.stp │ ├── pretty-uprobes.stp │ ├── pretty.stp │ ├── print_histogram_entry.stp │ ├── print_histograms.stp │ ├── printf.stp │ ├── proc_mem-embedded.stp │ ├── process_test.stp │ ├── procfs01.stp │ ├── queue_stats-embedded.stp │ ├── random-embedded.stp │ ├── rpc-all-probes.stp │ ├── rpc-detailed.stp │ ├── rpc-embedded.stp │ ├── scheduler-all-probes.stp │ ├── scheduler-cpu_off.stp │ ├── scheduler-ctxswitch.stp │ ├── scheduler-detailed.stp │ ├── scheduler-embedded.stp │ ├── scheduler-migrate.stp │ ├── scsi-all-probes.stp │ ├── scsi-detailed.stp │ ├── scsi-embedded.stp │ ├── semicolon.stp │ ├── seven.stp │ ├── seventeen.stp │ ├── signal-all-probes.stp │ ├── signal-check_ignored.stp │ ├── signal-detailed.stp │ ├── signal-embedded.stp │ ├── signal-handle.stp │ ├── six.stp │ ├── sixteen.stp │ ├── socket-all-probes.stp │ ├── socket-detailed.stp │ ├── socket-embedded.stp │ ├── stat_extract.stp │ ├── stat_insert.stp │ ├── stopwatches.stp │ ├── string-embedded.stp │ ├── syscall.stp │ ├── syscalls-arch-detailed.stp │ ├── syscalls-detailed.stp │ ├── syscalls2-detailed.stp │ ├── system-embedded.stp │ ├── task-embedded.stp │ ├── task_test.stp │ ├── task_time-embedded.stp │ ├── tcp-all-probes.stp │ ├── tcp-detailed.stp │ ├── tcp-embedded.stp │ ├── tcp_test.stp │ ├── tcpmib-all-probes.stp │ ├── tcpmib-detailed.stp │ ├── tcpmib-embedded.stp │ ├── ten.stp │ ├── thirteen.stp │ ├── thirty.stp │ ├── thirtyfour.stp │ ├── thirtyone.stp │ ├── thirtythree.stp │ ├── thirtytwo.stp │ ├── three.stp │ ├── timestamp-embedded.stp │ ├── timestamp_gtod-embedded.stp │ ├── timestamp_monotonic-embedded.stp │ ├── tty-detailed.stp │ ├── tty-resize.stp │ ├── twelve.stp │ ├── twenty.stp │ ├── twentyeight.stp │ ├── twentyeightprime.stp │ ├── twentyfive.stp │ ├── twentyfour.stp │ ├── twentynine.stp │ ├── twentyone.stp │ ├── twentyseven.stp │ ├── twentythree.stp │ ├── twentytwo.stp │ ├── two.stp │ ├── ucontext-embedded.stp │ ├── ucontext-symbols-embedded.stp │ ├── ucontext-unwind-embedded.stp │ ├── udp-all-probes.stp │ ├── udp-detailed.stp │ ├── udp_test.stp │ ├── utrace.stp │ ├── vfs-all-probes.stp │ ├── vfs-detailed.stp │ ├── vfs-embedded.stp │ └── xtime.stp ├── config │ └── unix.exp ├── configure ├── configure.ac ├── execrc ├── lib │ ├── cache_compile.exp │ ├── compile_flags.exp │ ├── stap_compile.exp │ ├── stap_run.exp │ ├── stap_run2.exp │ ├── stap_run_binary.exp │ ├── stap_run_error.exp │ ├── stap_run_exact.exp │ └── systemtap.exp ├── parseko │ ├── array01.stp │ ├── array02.stp │ ├── array03.stp │ ├── array04.stp │ ├── bad_tapset.stp │ ├── bad_tapset │ │ └── foo.stp │ ├── cmdline02.stp │ ├── cmdline03.stp │ ├── cmdline04.stp │ ├── cmdline06.stp │ ├── cmdline07.stp │ ├── cmdline08.stp │ ├── cmdline09.stp │ ├── cmdline10.stp │ ├── cmdline11.stp │ ├── cmdline12.stp │ ├── cmdline13.stp │ ├── cmdline14.stp │ ├── cmdline15.stp │ ├── cmdline16.stp │ ├── cmdline17.stp │ ├── cmdline18.stp │ ├── cmdline19.stp │ ├── cmdline20.stp │ ├── cmdline21.stp │ ├── cmdline22.stp │ ├── cmdlinearg01.stp │ ├── cmdlinearg02.stp │ ├── conditional.stp │ ├── deprecated01.stp │ ├── eight.stp │ ├── eighteen.stp │ ├── eleven.stp │ ├── fifteen.stp │ ├── five.stp │ ├── foreachstmt01.stp │ ├── foreachstmt02.stp │ ├── foreachstmt03.stp │ ├── foreachstmt04.stp │ ├── foreachstmt05.stp │ ├── foreachstmt06.stp │ ├── foreachstmt07.stp │ ├── forstmt01.stp │ ├── forstmt02.stp │ ├── forstmt03.stp │ ├── forstmt04.stp │ ├── four.stp │ ├── fourteen.stp │ ├── functiondecl01.stp │ ├── functiondecl02.stp │ ├── functiondecl03.stp │ ├── functiondecl04.stp │ ├── functiondecl05.stp │ ├── functiondecl06.stp │ ├── functiondecl07.stp │ ├── ifstmt01.stp │ ├── ifstmt02.stp │ ├── maxactive01.stp │ ├── maxactive02.stp │ ├── maxactive03.stp │ ├── maxactive04.stp │ ├── nine.stp │ ├── nineteen.stp │ ├── one.stp │ ├── preprocess01.stp │ ├── preprocess02.stp │ ├── preprocess03.stp │ ├── preprocess04.stp │ ├── preprocess05.stp │ ├── preprocess06.stp │ ├── preprocess07.stp │ ├── preprocess08.stp │ ├── preprocess08b.stp │ ├── preprocess09.stp │ ├── preprocess10.stp │ ├── preprocess11.stp │ ├── preprocess12.stp │ ├── preprocess13.stp │ ├── preprocess14.stp │ ├── preprocess15.stp │ ├── preprocess16.stp │ ├── preprocess17.stp │ ├── printd01.stp │ ├── printd02.stp │ ├── printd03.stp │ ├── printd04.stp │ ├── probepoint01.stp │ ├── probepoint02.stp │ ├── probepoint03.stp │ ├── probepoint04.stp │ ├── probepoint05.stp │ ├── probepoint06.stp │ ├── probepoint07.stp │ ├── probepoint08.stp │ ├── probepoint09.stp │ ├── procfs01.stp │ ├── procfs02.stp │ ├── procfs03.stp │ ├── seven.stp │ ├── seventeen.stp │ ├── six.stp │ ├── sixteen.stp │ ├── ternarystmt01.stp │ ├── thirteen.stp │ ├── three.stp │ ├── twelve.stp │ ├── twenty.stp │ ├── twentyfive.stp │ ├── twentyfour.stp │ ├── twentyone.stp │ ├── twentyseven.stp │ ├── twentysix.stp │ ├── twentythree.stp │ ├── twentytwo.stp │ ├── two.stp │ ├── utrace01.stp │ ├── whilestmt01.stp │ └── whilestmt02.stp ├── parseok │ ├── all_tapsets.stp │ ├── bad_tapset.stp │ ├── cmdline01.stp │ ├── cmdline02.stp │ ├── deprecated01.stp │ ├── eight.stp │ ├── eighteen.stp │ ├── eleven.stp │ ├── end_string.stp │ ├── fifteen.stp │ ├── five.stp │ ├── foreachstmt01.stp │ ├── four.stp │ ├── fourteen.stp │ ├── kconfig.stp │ ├── nine.stp │ ├── nineteen.stp │ ├── one.stp │ ├── preprocess-wildcard.stp │ ├── semko.stp │ ├── seven.stp │ ├── seventeen.stp │ ├── six.stp │ ├── sixteen.stp │ ├── ten.stp │ ├── thirteen.stp │ ├── three.stp │ ├── twelve.stp │ ├── twenty.stp │ ├── twentyone.stp │ ├── two.stp │ ├── umask01.stp │ ├── umask02.stp │ ├── umask03.stp │ ├── umask04.stp │ ├── umask05.stp │ ├── umask06.stp │ ├── umask07.stp │ └── unparser.stp ├── semko │ ├── array01.stp │ ├── array02.stp │ ├── doubleglob.stp │ ├── eight.stp │ ├── eighteen.stp │ ├── eleven.stp │ ├── entry01.stp │ ├── entry02.stp │ ├── entry03.stp │ ├── fifteen.stp │ ├── fifty.stp │ ├── five.stp │ ├── foreachstmt01.stp │ ├── foreachstmt02.stp │ ├── foreachstmt03.stp │ ├── forty.stp │ ├── fortyeight.stp │ ├── fortyfive.stp │ ├── fortyfour.stp │ ├── fortynine.stp │ ├── fortyone.stp │ ├── fortyseven.stp │ ├── fortysix.stp │ ├── fortythree.stp │ ├── fortytwo.stp │ ├── four.stp │ ├── fourteen.stp │ ├── gurufunc.stp │ ├── inb_blacklisted.stp │ ├── local_array.stp │ ├── local_stat.stp │ ├── logging-embedded.stp │ ├── map_wrap_bad.stp │ ├── maxactive01.stp │ ├── maxactive02.stp │ ├── maxactive03.stp │ ├── maxactive04.stp │ ├── maxactive05.stp │ ├── netfilter01.stp │ ├── netfilter02.stp │ ├── netfilter03.stp │ ├── netfilter04.stp │ ├── netfilter05.stp │ ├── netfilter06.stp │ ├── netfilter07.stp │ ├── netfilter08.stp │ ├── netfilter09.stp │ ├── netfilter10.stp │ ├── netfilter11.stp │ ├── nine.stp │ ├── nodwf01.stp │ ├── nodwf02.stp │ ├── nodwf03.stp │ ├── nodwf04.stp │ ├── nodwf05.stp │ ├── nodwf06.stp │ ├── nodwf07.stp │ ├── nodwf08.stp │ ├── nodwf09.stp │ ├── nofunc.stp │ ├── one.stp │ ├── plt1.stp │ ├── plt2.stp │ ├── procfs01.stp │ ├── procfs02.stp │ ├── procfs03.stp │ ├── procfs04.stp │ ├── procfs05.stp │ ├── procfs06.stp │ ├── procfs07.stp │ ├── procfs08.stp │ ├── procfs09.stp │ ├── procfs10.stp │ ├── procfs11.stp │ ├── procfs12.stp │ ├── procfs13.stp │ ├── procfs14.stp │ ├── procfs15.stp │ ├── return01.stp │ ├── return02.stp │ ├── seven.stp │ ├── seventeen.stp │ ├── six.stp │ ├── sixteen.stp │ ├── source_context.stp │ ├── target_addr1.stp │ ├── target_addr2.stp │ ├── target_addr3.stp │ ├── target_lvalue.stp │ ├── ten.stp │ ├── thirteen.stp │ ├── thirty.stp │ ├── thirtyeight.stp │ ├── thirtyfive.stp │ ├── thirtyfour.stp │ ├── thirtynine.stp │ ├── thirtyone.stp │ ├── thirtyseven.stp │ ├── thirtysix.stp │ ├── thirtythree.stp │ ├── thirtytwo.stp │ ├── three.stp │ ├── twelve.stp │ ├── twenty.stp │ ├── twentyeight.stp │ ├── twentyfive.stp │ ├── twentyfour.stp │ ├── twentynine.stp │ ├── twentyone.stp │ ├── twentyseven.stp │ ├── twentysix.stp │ ├── twentythree.stp │ ├── twentytwo.stp │ ├── two.stp │ ├── twotwo.stp │ ├── typemismatch.stp │ ├── utrace.stp │ ├── utrace03.stp │ ├── utrace04.stp │ ├── utrace05.stp │ ├── utrace06.stp │ ├── utrace07.stp │ ├── utrace14.stp │ ├── utrace15.stp │ ├── utrace16.stp │ ├── utrace17.stp │ ├── utrace18.stp │ ├── utrace19.stp │ ├── utrace20.stp │ ├── utrace21.stp │ ├── utrace22.stp │ └── zero.stp ├── semlib │ ├── f1.stp │ ├── g1.stp │ └── g2.stp ├── semok │ ├── args.stp │ ├── badvar.stp │ ├── badvar_undefined.stp │ ├── beginend.stp │ ├── bz10475.stp │ ├── bz11911.stp │ ├── cast.stp │ ├── config_config.stp │ ├── config_number.stp │ ├── config_wildcard.stp │ ├── defined_list_vars.stp │ ├── doubleglob.stp │ ├── eight.stp │ ├── eighteen.stp │ ├── eleven.stp │ ├── entry01.stp │ ├── entry02.stp │ ├── entry03.stp │ ├── fifteen.stp │ ├── five.stp │ ├── four.stp │ ├── fourteen.stp │ ├── gurufunc.stp │ ├── kretprobe-data.stp │ ├── mangled.stp │ ├── map_wrap_good.stp │ ├── netfilter01.stp │ ├── nine.stp │ ├── nineteen.stp │ ├── nodwf01.stp │ ├── nodwf02.stp │ ├── nodwf03.stp │ ├── nodwf04.stp │ ├── nodwf05.stp │ ├── nodwf06.stp │ ├── nodwf07.stp │ ├── one.stp │ ├── optimize.stp │ ├── plt1.stp │ ├── plt2.stp │ ├── pr11808.stp │ ├── pr11809.stp │ ├── pretty-uprobes.stp │ ├── pretty.stp │ ├── pretty2.stp │ ├── seven.stp │ ├── seventeen.stp │ ├── six.stp │ ├── sixteen.stp │ ├── syscall_return.stp │ ├── target_addr.stp │ ├── ten.stp │ ├── thirteen.stp │ ├── thirty.stp │ ├── thirtyeight.stp │ ├── thirtyfive.stp │ ├── thirtyfour.stp │ ├── thirtynine.stp │ ├── thirtyone.stp │ ├── thirtyseven.stp │ ├── thirtysix-utrace.stp │ ├── thirtysix.stp │ ├── thirtythree.stp │ ├── thirtytwo.stp │ ├── three.stp │ ├── transko.stp │ ├── twelve.stp │ ├── twenty.stp │ ├── twentyeight.stp │ ├── twentyfive.stp │ ├── twentyfour.stp │ ├── twentynine.stp │ ├── twentyone.stp │ ├── twentyseven.stp │ ├── twentysix.stp │ ├── twentythree.stp │ ├── twentytwo.stp │ ├── two.stp │ └── utrace01.stp ├── sys │ └── sdt.h ├── systemtap.apps │ ├── celsius-bt.stp │ ├── celsius-var.stp │ ├── celsius.py │ ├── mysql.exp │ ├── postgres.exp │ ├── python.exp │ ├── python2.patch │ ├── python2.stp │ ├── python3.patch │ ├── python3.stp │ ├── stap-tcl.sh │ ├── stap-tcl.stp │ ├── tcl.exp │ └── xulrunner.exp ├── systemtap.base │ ├── add.exp │ ├── add.stp │ ├── alias-condition.exp │ ├── alias-condition.stp │ ├── alias_tapset.exp │ ├── alias_tapset.stp │ ├── alias_tapset │ │ └── tapset_test.stp │ ├── alternatives.exp │ ├── arith.exp │ ├── arith.stp │ ├── arith_limits.exp │ ├── arith_limits.stp │ ├── array_size.exp │ ├── array_size.stp │ ├── array_string.exp │ ├── at_var.c │ ├── at_var.exp │ ├── at_var.stp │ ├── at_var_mark.exp │ ├── at_var_mark.stp │ ├── atomic.exp │ ├── backtrace.exp │ ├── backtrace.stp │ ├── bad-code.c │ ├── bad-code.exp │ ├── bad-code.stp │ ├── badkprobe.exp │ ├── be_order.exp │ ├── be_order.stp │ ├── beginenderror.exp │ ├── beginenderror.stp │ ├── bench.exp │ ├── bench.stp │ ├── bitfield.exp │ ├── bitfield.stp │ ├── buildid.c │ ├── buildid.exp │ ├── buildid.hex │ ├── buildid.stp │ ├── bz10078.c │ ├── bz10078.exp │ ├── bz10078.stp │ ├── bz10294.c │ ├── bz10294.stp │ ├── bz13338.exp │ ├── bz5274.a.stp │ ├── bz5274.c │ ├── bz5274.exp │ ├── bz5274.exp_out │ ├── bz5274.sh │ ├── bz5274.stp │ ├── bz6503.exp │ ├── bz6503.stp │ ├── bz6850.c │ ├── bz6850.exp │ ├── bz6850.stp │ ├── bz6905.c │ ├── bz6905.stp │ ├── cache.exp │ ├── cache_clean.exp │ ├── cast-scope.cxx │ ├── cast-scope.exp │ ├── cast-scope.stp │ ├── cast-user.c │ ├── cast-user.exp │ ├── cast-user.stp │ ├── cast.exp │ ├── cast.stp │ ├── cmd_parse.exp │ ├── const_value.c │ ├── const_value.exp │ ├── const_value.stp │ ├── const_value_func.c │ ├── const_value_func.stp │ ├── control_limits.exp │ ├── control_limits.stp │ ├── crash.exp │ ├── crash.sh │ ├── ctime.exp │ ├── ctime.stp │ ├── cu-decl-1.c │ ├── cu-decl-2.c │ ├── cu-decl.exp │ ├── cxxclass.cxx │ ├── cxxclass.exp │ ├── cxxclass.stp │ ├── debugpath.exp │ ├── deref.exp │ ├── deref.stp │ ├── deref2.exp │ ├── deref2.stp │ ├── div0.exp │ ├── div0.stp │ ├── dtrace.exp │ ├── equal.exp │ ├── equal.stp │ ├── error_fn.exp │ ├── error_fn.stp │ ├── externalvar.c │ ├── externalvar.exp │ ├── externalvar.stp │ ├── externalvar_lib.c │ ├── finloop2.exp │ ├── finloop2.stp │ ├── flightrec1.exp │ ├── flightrec2.exp │ ├── flightrec2.stp │ ├── flightrec3.exp │ ├── flightrec3.stp │ ├── flightrec4.exp │ ├── flightrec5.exp │ ├── foreach_value.exp │ ├── foreach_value.stp │ ├── func_alias.c │ ├── func_alias.exp │ ├── global_end.exp │ ├── global_end.stp │ ├── global_end2.stp │ ├── global_end_var.stp │ ├── global_init.exp │ ├── global_init.stp │ ├── global_opt.exp │ ├── global_stat.exp │ ├── global_var.exp │ ├── global_var.stp │ ├── global_var_distance.c │ ├── global_var_kernel.exp │ ├── global_var_kernel.stp │ ├── global_var_main.c │ ├── global_var_speed.c │ ├── global_vars.exp │ ├── global_vars.stp │ ├── gtod.c │ ├── gtod.exp │ ├── gtod.sh │ ├── gtod.stp │ ├── hash_add_buildid.exp │ ├── hash_add_buildid1.c │ ├── hash_add_buildid2.c │ ├── if.exp │ ├── if.stp │ ├── implicitptr.c │ ├── implicitptr.exp │ ├── implicitptr.stp │ ├── inc.exp │ ├── inc.stp │ ├── inherit.cxx │ ├── inherit.exp │ ├── inherit.stp │ ├── inlinedvars.c │ ├── inlinedvars.exp │ ├── inlinedvars.stp │ ├── ipaddr.exp │ ├── ipaddr.txt │ ├── ipaddr1.stp │ ├── ipaddr2.stp │ ├── itrace.exp │ ├── jennie.c │ ├── kallsyms_expand_symbol.exp │ ├── kallsyms_expand_symbol.stp │ ├── kbuildenv.exp │ ├── kfunct.exp │ ├── kfunct.stp │ ├── kmodule.exp │ ├── kmodule.stp │ ├── kprobes.exp │ ├── kprobes.stp │ ├── kretprobe-vars.exp │ ├── kretprobe-vars.stp │ ├── labels.exp │ ├── library.exp │ ├── library.stp │ ├── limits.exp │ ├── limits.stp │ ├── logical_and.exp │ ├── logical_and.stp │ ├── marker.exp │ ├── maxactive.exp │ ├── maxmemory.exp │ ├── modargs.exp │ ├── modargs.stp │ ├── modinfo.exp │ ├── net-sanity.exp │ ├── net-sanity.stp │ ├── not.exp │ ├── not.stp │ ├── onoffprobe.exp │ ├── onoffprobe.stp │ ├── optim.exp │ ├── optim.stp │ ├── optim_arridx.exp │ ├── optim_arridx.stp │ ├── optim_voidstmt.exp │ ├── optim_voidstmt.stp │ ├── optionalprobe.exp │ ├── optionalprobe.stp │ ├── overcatcher.exp │ ├── overcatcher.stp │ ├── overflow_error.exp │ ├── overflow_error.stp │ ├── overload.exp │ ├── plt.c │ ├── plt.exp │ ├── pointer_array.exp │ ├── pointer_array.stp │ ├── poll_map.exp │ ├── poll_map.stp │ ├── pp.exp │ ├── pp.stp │ ├── pr10854.exp │ ├── pr10854.stp │ ├── pr13158.exp │ ├── pr13306.exp │ ├── pr13306.stp │ ├── prcwildcard.exp │ ├── prepost_optim.exp │ ├── prepost_optim.stp │ ├── preprocessor.exp │ ├── print.exp │ ├── print.stp │ ├── probe_list.exp │ ├── probefunc.exp │ ├── proc_exec.c │ ├── proc_exec.exp │ ├── proc_fork_exec.c │ ├── proc_thread_exec.c │ ├── process_by_cmd.c │ ├── process_by_cmd.exp │ ├── process_by_cmd.stp │ ├── procfs.exp │ ├── procfs_maxsize.exp │ ├── procfs_umask.exp │ ├── procfs_write.exp │ ├── prologues.exp │ ├── prologues.stp │ ├── pt_user_mode.exp │ ├── pt_user_mode.stp │ ├── ptridx.c │ ├── ptridx.exp │ ├── ptridx.stp │ ├── rand.exp │ ├── rand.stp │ ├── remote.exp │ ├── remote.stp │ ├── rename_module.exp │ ├── rep_ret.c │ ├── rep_ret.exp │ ├── rlimit.exp │ ├── rlimit.stp │ ├── sdt.c │ ├── sdt.exp │ ├── sdt.stp │ ├── sdt_asm.S │ ├── sdt_asm.stp │ ├── sdt_misc.c │ ├── sdt_misc.exp │ ├── sdt_misc.stp │ ├── sdt_misc_.d │ ├── sdt_types.c │ ├── sdt_types.stp │ ├── sdt_va_args.c │ ├── sdt_va_args.exp │ ├── set_kernel.exp │ ├── set_kernel.stp │ ├── setjmp.c │ ├── setjmp.exp │ ├── setjmp.stp │ ├── simple.exp │ ├── simple.stp │ ├── skipped.exp │ ├── stapsh-unix.exp │ ├── stapsh-unix.stp │ ├── stapsh.exp │ ├── stapsh.stp │ ├── statement.exp │ ├── stmt_rel.c │ ├── stmt_rel.exp │ ├── stmt_rel_user.exp │ ├── stmtvars.exp │ ├── strftime.exp │ ├── sysroot_sysenv.exp │ ├── sysroot_sysenv.stp │ ├── system_func.exp │ ├── system_func.stp │ ├── tapset │ │ ├── alias.stp │ │ ├── function.stp │ │ └── global.stp │ ├── tapset_includes.exp │ ├── target_set.exp │ ├── target_set.stp │ ├── timeofday.exp │ ├── timers.exp │ ├── timers.stp │ ├── tracepoints.exp │ ├── tracepoints.stp │ ├── tracescripts.exp │ ├── tri.exp │ ├── tri.stp │ ├── trycatch.exp │ ├── unresolved-struct-typedef.c │ ├── unresolved-struct-typedef.exp │ ├── uprobes.exp │ ├── uprobes.stp │ ├── uprobes_call.stp │ ├── uprobes_return.stp │ ├── utrace_p4.exp │ ├── utrace_p5.exp │ ├── utrace_p5_multi.c │ ├── utrace_syscall_args.c │ ├── utrace_syscall_args.exp │ ├── utrace_syscall_args.stp │ ├── vars.exp │ ├── vma_vdso.c │ ├── vma_vdso.exp │ ├── vma_vdso.stp │ ├── vta-test.c │ ├── vta-test.exp │ ├── vta-test.stp │ ├── wakeup.exp │ ├── wakeup.stp │ ├── warn_overflow.exp │ ├── warn_overflow.stp │ ├── warnings.exp │ ├── warnings.stp │ ├── warnings2.exp │ ├── x86_gs.exp │ └── x86_gs.stp ├── systemtap.clone │ ├── Makefile.clone │ ├── Makefile.fork_exec │ ├── Makefile.probe_by_pid │ ├── Makefile.vfork_exec │ ├── dtrace_child.c │ ├── dtrace_child_probes.d │ ├── dtrace_clone.c │ ├── dtrace_clone.exp │ ├── dtrace_clone.stp │ ├── dtrace_clone_probes.d │ ├── dtrace_fork_exec.exp │ ├── dtrace_fork_exec.stp │ ├── dtrace_fork_parent.c │ ├── dtrace_fork_parent_probes.d │ ├── dtrace_vfork_exec.exp │ ├── dtrace_vfork_exec.stp │ ├── dtrace_vfork_parent.c │ ├── dtrace_vfork_parent_probes.d │ ├── probe_by_pid.c │ ├── probe_by_pid.exp │ ├── probe_by_pid_function.stp │ ├── probe_by_pid_utrace.stp │ └── test_progs.tcl ├── systemtap.context │ ├── args.stp │ ├── args.tcl │ ├── backtrace.stp │ ├── backtrace.tcl │ ├── context.exp │ ├── fib.c │ ├── fib.exp │ ├── fib.stp │ ├── makefile1 │ ├── makefile2 │ ├── num_args.stp │ ├── num_args.tcl │ ├── pid.stp │ ├── pid.tcl │ ├── symbols.exp │ ├── symbols.stp │ ├── systemtap_test_module1.c │ ├── systemtap_test_module2.c │ ├── uprobe_backtrace.stp │ ├── uprobe_stmt_num.c │ ├── uprobe_stmt_num.exp │ ├── uprobe_stmt_num.stp │ ├── uprobe_uaddr.exp │ ├── uprobe_uaddr.stp │ ├── usymbols.c │ ├── usymbols.exp │ └── usymbols_lib.c ├── systemtap.examples │ ├── README │ ├── check.exp │ ├── examples-index-gen.pl │ ├── general │ │ ├── ansi_colors.meta │ │ ├── ansi_colors.stp │ │ ├── ansi_colors2.meta │ │ ├── ansi_colors2.stp │ │ ├── badname.meta │ │ ├── badname.stp │ │ ├── click.wav │ │ ├── eventcount.meta │ │ ├── eventcount.stp │ │ ├── func_time_stats.meta │ │ ├── func_time_stats.stp │ │ ├── grapher.stp │ │ ├── graphs.meta │ │ ├── graphs.stp │ │ ├── helloworld.meta │ │ ├── helloworld.stp │ │ ├── key.stp │ │ ├── keyhack.stp │ │ ├── para-callgraph-verbose.meta │ │ ├── para-callgraph-verbose.stp │ │ ├── para-callgraph.meta │ │ ├── para-callgraph.stp │ │ ├── return.wav │ │ ├── sizeof.meta │ │ ├── sizeof.stp │ │ ├── stopwatches.meta │ │ ├── stopwatches.stp │ │ ├── varwatch.meta │ │ ├── varwatch.stp │ │ ├── watchdog.meta │ │ └── watchdog.stp │ ├── html │ │ ├── html_footer.tmpl │ │ ├── html_header.tmpl │ │ ├── systemtap.css │ │ ├── systemtapcorner.gif │ │ └── systemtaplogo.png │ ├── index.html │ ├── index.txt │ ├── interrupt │ │ ├── interrupts-by-dev.meta │ │ ├── interrupts-by-dev.stp │ │ ├── scf.meta │ │ └── scf.stp │ ├── io │ │ ├── deviceseeks.meta │ │ ├── deviceseeks.stp │ │ ├── disktop.meta │ │ ├── disktop.stp │ │ ├── enospc.meta │ │ ├── enospc.stp │ │ ├── inodewatch.meta │ │ ├── inodewatch.stp │ │ ├── inodewatch2.meta │ │ ├── inodewatch2.stp │ │ ├── io_submit.meta │ │ ├── io_submit.stp │ │ ├── ioblktime.meta │ │ ├── ioblktime.stp │ │ ├── iodevstats.meta │ │ ├── iodevstats.stp │ │ ├── iostat-scsi.meta │ │ ├── iostat-scsi.stp │ │ ├── iostat-scsi.txt │ │ ├── iostats.meta │ │ ├── iostats.stp │ │ ├── iotime.meta │ │ ├── iotime.stp │ │ ├── iotop.meta │ │ ├── iotop.stp │ │ ├── mbrwatch.meta │ │ ├── mbrwatch.stp │ │ ├── nfs_func_users.meta │ │ ├── nfs_func_users.stp │ │ ├── traceio.meta │ │ ├── traceio.stp │ │ ├── traceio2.meta │ │ ├── traceio2.stp │ │ ├── ttyspy.meta │ │ └── ttyspy.stp │ ├── keyword-index.html │ ├── keyword-index.txt │ ├── locks │ │ ├── bkl.meta │ │ ├── bkl.stp │ │ ├── bkl_stats.meta │ │ └── bkl_stats.stp │ ├── memory │ │ ├── hw_watch_addr.meta │ │ ├── hw_watch_addr.stp │ │ ├── hw_watch_sym.meta │ │ ├── hw_watch_sym.stp │ │ ├── kmalloc-top │ │ ├── kmalloc-top.meta │ │ ├── mmanonpage.meta │ │ ├── mmanonpage.stp │ │ ├── mmfilepage.meta │ │ ├── mmfilepage.stp │ │ ├── mmreclaim.meta │ │ ├── mmreclaim.stp │ │ ├── mmwriteback.meta │ │ ├── mmwriteback.stp │ │ ├── numa_faults.meta │ │ ├── numa_faults.stp │ │ ├── overcommit.meta │ │ ├── overcommit.stp │ │ ├── pfaults.meta │ │ ├── pfaults.stp │ │ ├── vm.tracepoints.meta │ │ └── vm.tracepoints.stp │ ├── network │ │ ├── autofs4.meta │ │ ├── autofs4.stp │ │ ├── dropwatch.meta │ │ ├── dropwatch.stp │ │ ├── netdev.meta │ │ ├── netdev.stp │ │ ├── netfilter_drop.meta │ │ ├── netfilter_drop.stp │ │ ├── netfilter_summary.meta │ │ ├── netfilter_summary.stp │ │ ├── nettop.meta │ │ ├── nettop.stp │ │ ├── nettop.txt │ │ ├── nfsd_unlink.meta │ │ ├── nfsd_unlink.stp │ │ ├── nfsdtop.meta │ │ ├── nfsdtop.stp │ │ ├── sk_stream_wait_memory.meta │ │ ├── sk_stream_wait_memory.stp │ │ ├── socket-trace.meta │ │ ├── socket-trace.stp │ │ ├── socktop │ │ ├── socktop.meta │ │ ├── socktop.txt │ │ ├── tcp.stp │ │ ├── tcp_connections.meta │ │ ├── tcp_connections.stp │ │ ├── tcp_init_cwnd.meta │ │ ├── tcp_init_cwnd.stp │ │ ├── tcp_trace.meta │ │ ├── tcp_trace.stp │ │ ├── tcp_trace.txt │ │ ├── tcpdumplike.meta │ │ ├── tcpdumplike.stp │ │ ├── tcpipstat.meta │ │ ├── tcpipstat.stp │ │ └── tcpipstat.txt │ ├── process │ │ ├── auditbt.meta │ │ ├── auditbt.stp │ │ ├── chng_cpu.meta │ │ ├── chng_cpu.stp │ │ ├── cycle_thief.meta │ │ ├── cycle_thief.stp │ │ ├── errsnoop.meta │ │ ├── errsnoop.stp │ │ ├── forktracker.meta │ │ ├── forktracker.stp │ │ ├── futexes.meta │ │ ├── futexes.stp │ │ ├── futexes.txt │ │ ├── migrate.meta │ │ ├── migrate.stp │ │ ├── noptrace.meta │ │ ├── noptrace.stp │ │ ├── pfiles.meta │ │ ├── pfiles.stp │ │ ├── plimit.meta │ │ ├── plimit.stp │ │ ├── proc_snoop.stp │ │ ├── proc_snoop_parser.xml │ │ ├── proc_snoop_parser_instructions.txt │ │ ├── psig.meta │ │ ├── psig.stp │ │ ├── pstrace_exec.meta │ │ ├── pstrace_exec.stp │ │ ├── schedtimes.meta │ │ ├── schedtimes.stp │ │ ├── sig_by_pid.meta │ │ ├── sig_by_pid.stp │ │ ├── sig_by_pid.txt │ │ ├── sig_by_proc.meta │ │ ├── sig_by_proc.stp │ │ ├── sig_by_proc.txt │ │ ├── sigkill.meta │ │ ├── sigkill.stp │ │ ├── sigmon.meta │ │ ├── sigmon.stp │ │ ├── sleepingBeauties.meta │ │ ├── sleepingBeauties.stp │ │ ├── sleeptime.meta │ │ ├── sleeptime.stp │ │ ├── syscalls_by_pid.meta │ │ ├── syscalls_by_pid.stp │ │ ├── syscalls_by_pid.txt │ │ ├── syscalls_by_proc.meta │ │ ├── syscalls_by_proc.stp │ │ ├── syscalls_by_proc.txt │ │ ├── syscalltimes │ │ ├── syscalltimes.meta │ │ ├── syscalltimes.txt │ │ ├── wait4time.meta │ │ └── wait4time.stp │ ├── profiling │ │ ├── errno.meta │ │ ├── errno.stp │ │ ├── fntimes.meta │ │ ├── fntimes.stp │ │ ├── functioncallcount.meta │ │ ├── functioncallcount.stp │ │ ├── graphcall.stp │ │ ├── latencytap.meta │ │ ├── latencytap.stp │ │ ├── linetimes.meta │ │ ├── linetimes.stp │ │ ├── periodic.meta │ │ ├── periodic.stp │ │ ├── pf2.meta │ │ ├── pf2.stp │ │ ├── pf2.txt │ │ ├── pf3.meta │ │ ├── pf3.stp │ │ ├── sched_switch.meta │ │ ├── sched_switch.stp │ │ ├── thread-times.meta │ │ ├── thread-times.stp │ │ ├── timeout.meta │ │ ├── timeout.stp │ │ ├── topsys.meta │ │ └── topsys.stp │ └── virtualization │ │ ├── kvm_service_time.meta │ │ ├── kvm_service_time.stp │ │ ├── qemu_count.meta │ │ ├── qemu_count.stp │ │ ├── qemu_io.meta │ │ └── qemu_io.stp ├── systemtap.exelib │ ├── cleanup.tcl │ ├── exelib.exp │ ├── lib.stp │ ├── lib.tcl │ ├── libmarkunamestack.stp │ ├── libmarkunamestack.tcl │ ├── mark.stp │ ├── mark.tcl │ ├── pthreadprobes.c │ ├── pthreadprobes.exp │ ├── uname.stp │ ├── uname.tcl │ ├── uprobes_exe.c │ ├── uprobes_lib.c │ ├── ustack.stp │ └── ustack.tcl ├── systemtap.maps │ ├── absentstats.exp │ ├── absentstats.stp │ ├── elision.exp │ ├── elision.stp │ ├── exists.exp │ ├── exists.stp │ ├── foreach_fail.exp │ ├── foreach_fail.stp │ ├── foreach_foreach.exp │ ├── foreach_foreach.stp │ ├── foreach_limit.exp │ ├── foreach_limit.stp │ ├── foreach_limit2.exp │ ├── foreach_limit2.stp │ ├── hist_in_string.exp │ ├── hist_in_string.stp │ ├── ii.exp │ ├── ii.stp │ ├── iiiiii.exp │ ├── iiiiii.stp │ ├── is.exp │ ├── is.stp │ ├── ix.exp │ ├── ix.stp │ ├── ix_clear.exp │ ├── ix_clear.stp │ ├── ix_clear2.exp │ ├── ix_clear2.stp │ ├── ix_clear3.exp │ ├── ix_clear3.stp │ ├── ix_hist.exp │ ├── ix_hist.stp │ ├── linear.exp │ ├── linear.stp │ ├── linear_0.exp │ ├── linear_0.stp │ ├── linear_bad.exp │ ├── linear_bad.stp │ ├── linear_empty.exp │ ├── linear_empty.stp │ ├── linear_large.exp │ ├── linear_large.stp │ ├── linear_large_neg.exp │ ├── linear_large_neg.stp │ ├── linear_nearlyempty.exp │ ├── linear_nearlyempty.stp │ ├── linear_neg.exp │ ├── linear_neg.stp │ ├── linear_over.exp │ ├── linear_over.stp │ ├── linear_overunder.exp │ ├── linear_overunder.stp │ ├── linear_under.exp │ ├── linear_under.stp │ ├── log.exp │ ├── log.stp │ ├── log_edge.exp │ ├── log_edge.stp │ ├── map_hash.exp │ ├── map_hash_II.stp │ ├── map_hash_SI.stp │ ├── map_hash_SSI.stp │ ├── map_hash_stat_II.stp │ ├── map_hash_stat_SI.stp │ ├── map_hash_stat_SSI.stp │ ├── map_wrap.exp │ ├── map_wrap1.stp │ ├── map_wrap2.stp │ ├── pmap_agg_overflow.exp │ ├── pmap_agg_overflow.stp │ ├── si.exp │ ├── si.stp │ ├── ss.exp │ └── ss.stp ├── systemtap.pass1-4 │ ├── buildko.exp │ ├── buildok.exp │ ├── debugtypes.cxx │ ├── debugtypes.exp │ ├── debugtypes.stp │ ├── parseko.exp │ ├── parseok.exp │ ├── semko.exp │ ├── semok.exp │ ├── transko.exp │ └── transok.exp ├── systemtap.printf │ ├── basic1.exp │ ├── basic1.stp │ ├── basic2.exp │ ├── basic2.stp │ ├── basic3.exp │ ├── basic3.stp │ ├── basic4.exp │ ├── basic4.stp │ ├── basic5.exp │ ├── basic5.stp │ ├── basic6.exp │ ├── basic6.stp │ ├── bin1.exp │ ├── bin1.stp │ ├── bin2.exp │ ├── bin2.stp │ ├── bin3.exp │ ├── bin3.stp │ ├── bin4.exp │ ├── bin4.stp │ ├── bin5.exp │ ├── bin5.stp │ ├── bin6.exp │ ├── bin6.stp │ ├── char1.exp │ ├── char1.stp │ ├── char2.exp │ ├── char2.stp │ ├── end1.exp │ ├── end1.stp │ ├── end1b.exp │ ├── hello.stp │ ├── hello2.stp │ ├── int1.exp │ ├── int1.stp │ ├── large_output │ ├── memory1.exp │ ├── memory1.stp │ ├── mixed_out.exp │ ├── mixed_out.stp │ ├── mixed_outb.exp │ ├── oct.exp │ ├── oct.stp │ ├── out1.exp │ ├── out1.stp │ ├── out1b.exp │ ├── out2.exp │ ├── out2.stp │ ├── out2b.exp │ ├── out3.exp │ ├── out3.stp │ ├── out3b.exp │ ├── pretty-bits.exp │ ├── pretty-bits.h │ ├── pretty-bits.stp │ ├── pretty-char.exp │ ├── pretty-char.h │ ├── pretty-char.stp │ ├── print.exp │ ├── print.stp │ ├── print_char.exp │ ├── print_char.stp │ ├── printd.exp │ ├── printd.stp │ ├── printdln.stp │ ├── println.exp │ ├── println.stp │ ├── ptr-1.2.exp │ ├── ptr-1.2.stp │ ├── ptr-1.3.exp │ ├── ptr-1.3.stp │ ├── ring_buffer.exp │ ├── sharedbuf.exp │ ├── sharedbuf.stp │ ├── stap_merge.tcl │ ├── string1.exp │ ├── string1.stp │ ├── string2.exp │ └── string2.stp ├── systemtap.samples │ ├── examples.exp │ ├── tcptest.exp │ ├── tcptest.stp │ └── tcptest.tcl ├── systemtap.server │ ├── client.exp │ ├── client_args.exp │ ├── hello.stp │ ├── server.exp │ ├── server_args.exp │ ├── server_concurency1.stp │ ├── server_concurency2.stp │ ├── server_concurency3.stp │ ├── server_concurrency.exp │ ├── server_locale.exp │ ├── test.stp │ └── uprobes.stp ├── systemtap.speculate │ ├── speculate.c │ ├── speculate.exp │ └── speculate.stp ├── systemtap.stress │ ├── all_kernel_functions.exp │ ├── conversions.exp │ ├── conversions.stp │ ├── conversions_perf.stp │ ├── conversions_profile.stp │ ├── conversions_trace.stp │ ├── current.exp │ ├── current.stp │ └── whitelist.exp ├── systemtap.string │ ├── dot.exp │ ├── dot.stp │ ├── isinstr.exp │ ├── isinstr.stp │ ├── sprint.exp │ ├── sprint.stp │ ├── str_replace.exp │ ├── str_replace.stp │ ├── strcmp.exp │ ├── strcmp.stp │ ├── strlen.exp │ ├── strlen.stp │ ├── strtol.exp │ ├── strtol.stp │ ├── substr.exp │ ├── substr.stp │ ├── text_str.exp │ ├── text_str.stp │ ├── tokenize.exp │ └── tokenize.stp ├── systemtap.syscall │ ├── README │ ├── access.c │ ├── acct.c │ ├── alarm.c │ ├── all_syscalls.stp │ ├── chmod.c │ ├── clock.c │ ├── coverage.tcl │ ├── dir.c │ ├── dup.c │ ├── eventfd.c │ ├── forkwait.c │ ├── futimes.c │ ├── inotify.c │ ├── itimer.c │ ├── link.c │ ├── mmap.c │ ├── mount.c │ ├── nd_sys.stp │ ├── nd_syscall.exp │ ├── net1.c │ ├── openclose.c │ ├── pipe.c │ ├── poll.c │ ├── readwrite.c │ ├── rt_signal.c │ ├── select.c │ ├── sendfile.c │ ├── signal.c │ ├── signalfd.c │ ├── stat.c │ ├── statfs.c │ ├── swap.c │ ├── sync.c │ ├── sys.stp │ ├── syscall.exp │ ├── test-debug-cmd-nd.tcl │ ├── test-debug-cmd.tcl │ ├── test-debug.tcl │ ├── test.tcl │ ├── timer.c │ ├── trunc.c │ ├── uid.c │ ├── uid16.c │ ├── umask.c │ └── unlink.c ├── systemtap.unprivileged │ ├── delayedkill │ ├── embeddedc.awk │ ├── foo.c │ ├── libfoo.c │ ├── libloop.c │ ├── loop.c │ ├── unprivileged_embedded_C.exp │ ├── unprivileged_myproc.exp │ ├── unprivileged_options.exp │ └── unprivileged_probes.exp ├── systemtap │ └── notest.exp ├── transko │ ├── two.stp │ └── varargs.stp └── transok │ ├── buildko.stp │ ├── eight.stp │ ├── eleven.stp │ ├── five.stp │ ├── four.stp │ ├── nine.stp │ ├── one.stp │ ├── seven.stp │ ├── six.stp │ ├── ten.stp │ ├── three.stp │ ├── tval-opt.stp │ ├── two.stp │ └── varargs.stp ├── translate.cxx ├── translate.h ├── unordered.h ├── util.cxx ├── util.h └── vim ├── filetype.vim ├── ftplugin └── stap.vim ├── indent └── stap.vim └── syntax └── stap.vim /.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.net 3 | 4 | [systemtap.systemtappot] 5 | file_filter = po/.po 6 | source_file = po/systemtap.pot 7 | source_lang = en 8 | trans.fr = po/fr.po 9 | trans.pl = po/pl.po 10 | 11 | -------------------------------------------------------------------------------- /AUTHORS.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Create the AUTHORS file, by searching the git history. 4 | 5 | # Run as "AUTHORS.sh" to get complete history 6 | # Run with "AUTHORS.sh commitish..commitish" for history between tags 7 | 8 | # shortlog will canonicalize the names using the file .mailmap 9 | git shortlog -s ${1-} | 10 | cut -b8- # strip the commit counts 11 | -------------------------------------------------------------------------------- /cache.h: -------------------------------------------------------------------------------- 1 | void add_script_to_cache(systemtap_session& s); 2 | bool get_script_from_cache(systemtap_session& s); 3 | 4 | void add_stapconf_to_cache(systemtap_session& s); 5 | bool get_stapconf_from_cache(systemtap_session& s); 6 | 7 | void clean_cache(systemtap_session& s); 8 | 9 | /* vim: set sw=2 ts=8 cino=>4,n-2,{2,^-2,t0,(0,u0,w1,M1 : */ 10 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.glo 3 | *.idx 4 | *.log 5 | *.lot 6 | *.out 7 | *.pdf 8 | *.toc 9 | *.dvi 10 | _region_.* 11 | beginners 12 | langref 13 | -------------------------------------------------------------------------------- /doc/Language_Reference_Guide/en-US/Language_Reference_Guide.ent: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /doc/SystemTap_Beginners_Guide/.gitignore: -------------------------------------------------------------------------------- 1 | tmp 2 | -------------------------------------------------------------------------------- /doc/SystemTap_Beginners_Guide/en-US/SystemTap_Beginners_Guide.ent: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /doc/SystemTap_Beginners_Guide/en-US/extras/cast_example.stp: -------------------------------------------------------------------------------- 1 | function task_state:long (task:long) 2 | { 3 | return @cast(task, "task_struct", "kernel")->state 4 | } 5 | -------------------------------------------------------------------------------- /doc/SystemTap_Beginners_Guide/en-US/extras/defined_example.stp: -------------------------------------------------------------------------------- 1 | probe vm.pagefault = kernel.function("__handle_mm_fault@mm/memory.c") ?, 2 | kernel.function("handle_mm_fault@mm/memory.c") ? 3 | { 4 | name = "pagefault" 5 | write_access = (@defined($flags) 6 | ? $flags & FAULT_FLAG_WRITE : $write_access) 7 | address = $address 8 | } 9 | -------------------------------------------------------------------------------- /doc/SystemTap_Beginners_Guide/en-US/extras/perror.stp: -------------------------------------------------------------------------------- 1 | probe vfs.read 2 | probe vfs.write 3 | -------------------------------------------------------------------------------- /doc/SystemTap_Beginners_Guide/en-US/extras/rheldebugurl.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | pkg="redhat-release" 3 | releasever=`rpm -q --qf "%{version}" $pkg` 4 | base=`uname -m` 5 | echo "ftp://ftp.redhat.com/pub/redhat/linux/\ 6 | enterprise/$releasever/en/os/$base/Debuginfo" 7 | -------------------------------------------------------------------------------- /doc/SystemTap_Beginners_Guide/en-US/extras/werror.stp: -------------------------------------------------------------------------------- 1 | probe begin { printf("x") = 1 } 2 | -------------------------------------------------------------------------------- /doc/SystemTap_Beginners_Guide/en-US/images/gnuplotsample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jav/systemtap/2da355dd02a18bf4f67e2ceeb504b351b4bd5b83/doc/SystemTap_Beginners_Guide/en-US/images/gnuplotsample.png -------------------------------------------------------------------------------- /doc/SystemTap_Beginners_Guide/publican.cfg.in: -------------------------------------------------------------------------------- 1 | debug: 0 2 | xml_lang: en-US 3 | brand: @PUBLICAN_BRAND@ 4 | condition: @PUBLICAN_BRAND@ 5 | tmp_dir: build 6 | -------------------------------------------------------------------------------- /doc/SystemTap_Tapset_Reference/.gitignore: -------------------------------------------------------------------------------- 1 | /docproc 2 | stamp-* 3 | tapsets/ 4 | tapsets.xml 5 | -------------------------------------------------------------------------------- /doc/Tapset_Reference_Guide/en-US/Tapset_Reference_Guide.ent: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /doc/tutorial/hello-world.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | print ("hello world\n") 4 | exit () 5 | } 6 | -------------------------------------------------------------------------------- /doc/tutorial/socket-trace.stp: -------------------------------------------------------------------------------- 1 | probe kernel.function("*@net/socket.c").call { 2 | printf ("%s -> %s\n", thread_indent(1), probefunc()) 3 | } 4 | probe kernel.function("*@net/socket.c").return { 5 | printf ("%s <- %s\n", thread_indent(-1), probefunc()) 6 | } 7 | -------------------------------------------------------------------------------- /doc/tutorial/strace-open.stp: -------------------------------------------------------------------------------- 1 | probe syscall.open 2 | { 3 | printf ("%s(%d) open (%s)\n", execname(), pid(), argstr) 4 | } 5 | probe timer.ms(4000) # after 4 seconds 6 | { 7 | exit () 8 | } 9 | -------------------------------------------------------------------------------- /doc/tutorial/tapset-time-user.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | timer_begin ("bench") 4 | for (i=0; i<100; i++) ; 5 | printf ("%d cycles\n", timer_end ("bench")) 6 | exit () 7 | } 8 | function __time_value () { return get_cycles () } # override 9 | -------------------------------------------------------------------------------- /doc/tutorial/tapset/time-common.stp: -------------------------------------------------------------------------------- 1 | global __time_vars 2 | function timer_begin (name) { __time_vars[name] = __time_value () } 3 | function timer_end (name) { return __time_value() - __time_vars[name] } 4 | 5 | -------------------------------------------------------------------------------- /doc/tutorial/tapset/time-default.stp: -------------------------------------------------------------------------------- 1 | function __time_value () { return gettimeofday_us () } 2 | 3 | -------------------------------------------------------------------------------- /doc/tutorial/timer-jiffies.stp: -------------------------------------------------------------------------------- 1 | global count_jiffies, count_ms 2 | probe timer.jiffies(100) { count_jiffies ++ } 3 | probe timer.ms(100) { count_ms ++ } 4 | probe timer.ms(12345) 5 | { 6 | hz=(1000*count_jiffies) / count_ms 7 | printf ("jiffies:ms ratio %d:%d => CONFIG_HZ=%d\n", 8 | count_jiffies, count_ms, hz) 9 | exit () 10 | } 11 | -------------------------------------------------------------------------------- /includes/sys/.gitignore: -------------------------------------------------------------------------------- 1 | sdt-config.h 2 | -------------------------------------------------------------------------------- /includes/sys/sdt-config.h.in: -------------------------------------------------------------------------------- 1 | /* @configure_input@ 2 | 3 | This file just defines _SDT_ASM_SECTION_AUTOGROUP_SUPPORT to 0 or 1 to 4 | indicate whether the assembler supports "?" in .pushsection directives. */ 5 | 6 | #define _SDT_ASM_SECTION_AUTOGROUP_SUPPORT @support_section_question@ 7 | -------------------------------------------------------------------------------- /initscript/.gitignore: -------------------------------------------------------------------------------- 1 | systemtap 2 | stap-server 3 | -------------------------------------------------------------------------------- /initscript/logrotate.stap-server: -------------------------------------------------------------------------------- 1 | /var/log/stap-server/log { 2 | rotate 2 3 | missingok 4 | notifempty 5 | size 30k 6 | create 0664 stap-server stap-server 7 | } 8 | -------------------------------------------------------------------------------- /po/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | POTFILES 3 | stamp-po 4 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | en 2 | pl 3 | fr 4 | -------------------------------------------------------------------------------- /po/boldquot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | s/“/“/g 8 | s/”/”/g 9 | s/‘/‘/g 10 | s/’/’/g 11 | -------------------------------------------------------------------------------- /po/en.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jav/systemtap/2da355dd02a18bf4f67e2ceeb504b351b4bd5b83/po/en.gmo -------------------------------------------------------------------------------- /po/fr.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jav/systemtap/2da355dd02a18bf4f67e2ceeb504b351b4bd5b83/po/fr.gmo -------------------------------------------------------------------------------- /po/pl.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jav/systemtap/2da355dd02a18bf4f67e2ceeb504b351b4bd5b83/po/pl.gmo -------------------------------------------------------------------------------- /po/quot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | -------------------------------------------------------------------------------- /runtime/.gitignore: -------------------------------------------------------------------------------- 1 | !staprun 2 | -------------------------------------------------------------------------------- /runtime/README: -------------------------------------------------------------------------------- 1 | To build everything (relayfs, transport, staprun, and example probes): 2 | > make 3 | 4 | To clean up: 5 | > make clean 6 | 7 | To build docs 8 | > doxygen Doxyfile 9 | 10 | -------------------------------------------------------------------------------- /runtime/autoconf-alloc-percpu-align.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* kernel commit f2a8205c */ 4 | void foo (void) { 5 | (void) __alloc_percpu(sizeof(int), 8); 6 | } 7 | -------------------------------------------------------------------------------- /runtime/autoconf-asm-syscall.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | -------------------------------------------------------------------------------- /runtime/autoconf-blk-types.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | -------------------------------------------------------------------------------- /runtime/autoconf-constant-tsc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int x = X86_FEATURE_CONSTANT_TSC; 4 | -------------------------------------------------------------------------------- /runtime/autoconf-dpath-path.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void ____autoconf_func(struct path *p) 5 | { 6 | (void)d_path(p, NULL, 0); 7 | } 8 | -------------------------------------------------------------------------------- /runtime/autoconf-generated-compile.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char* x = UTS_VERSION; 4 | 5 | -------------------------------------------------------------------------------- /runtime/autoconf-grsecurity.c: -------------------------------------------------------------------------------- 1 | /* PR10551: pax/grsecurity changes linux/module.h */ 2 | 3 | #include 4 | 5 | struct module *t; 6 | unsigned size; 7 | 8 | void foo (void) 9 | { 10 | size += t->init_size_rw + t->init_size_rx + t->core_size_rw + t->core_size_rx; 11 | } 12 | -------------------------------------------------------------------------------- /runtime/autoconf-hrtimer-getset-expires.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void ____autoconf_func(struct hrtimer *t) 4 | { 5 | hrtimer_set_expires(t, hrtimer_get_expires(t)); 6 | } 7 | -------------------------------------------------------------------------------- /runtime/autoconf-hrtimer-rel.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int x = HRTIMER_REL; /* as opposed to HRTIMER_MODE_REL */ 4 | -------------------------------------------------------------------------------- /runtime/autoconf-inode-private.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* check 2.6.18 inode diet patch which changed */ 4 | /* u.generic_ip to i_private */ 5 | 6 | struct inode i __attribute__ ((unused)) = {.i_private=(void *)0}; 7 | -------------------------------------------------------------------------------- /runtime/autoconf-kallsyms-on-each-symbol.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef CONFIG_PPC64 4 | #error kallsyms_on_each_symbol optimization not supported on ppc64. 5 | #endif 6 | 7 | void foo (void) { 8 | (void) kallsyms_on_each_symbol(NULL, NULL); 9 | } 10 | -------------------------------------------------------------------------------- /runtime/autoconf-kprobe-symbol-name.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void func(struct kprobe *kp) 4 | { 5 | kp->symbol_name = "dummy"; 6 | } 7 | -------------------------------------------------------------------------------- /runtime/autoconf-ktime-get-real.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void ____autoconf_func(struct timespec *ts) 4 | { 5 | ktime_get_real_ts(ts); 6 | } 7 | -------------------------------------------------------------------------------- /runtime/autoconf-mm-context-vdso-base.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int context_vdso(struct task_struct *tsk) 4 | { 5 | return (tsk->mm->context.vdso_base == 0L); 6 | } 7 | -------------------------------------------------------------------------------- /runtime/autoconf-mm-context-vdso.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int context_vdso(struct task_struct *tsk) 4 | { 5 | return (tsk->mm->context.vdso == NULL); 6 | } 7 | -------------------------------------------------------------------------------- /runtime/autoconf-module-sect-attrs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | unsigned long foobar(struct module_sect_attrs *moosas) 4 | { 5 | struct module_sect_attr msa = moosas->attrs[0]; 6 | return msa.address; 7 | } 8 | -------------------------------------------------------------------------------- /runtime/autoconf-nameidata.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct nameidata nd __attribute__ ((unused)) = {.path={(void *)0}}; 4 | 5 | -------------------------------------------------------------------------------- /runtime/autoconf-procfs-owner.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* kernel commit 4d38a69c6 */ 4 | 5 | void bar (void) { 6 | struct proc_dir_entry foo; 7 | foo.owner = (void*) 0; 8 | (void) foo; 9 | } 10 | -------------------------------------------------------------------------------- /runtime/autoconf-regset.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int foobar(int n) { 4 | const struct user_regset_view *rsv = task_user_regset_view(current); 5 | const struct user_regset *rs = & rsv->regsets[0]; 6 | return rsv->n + n + (rs->get)(current, rs, 0, 0, NULL, NULL); 7 | } 8 | -------------------------------------------------------------------------------- /runtime/autoconf-ring_buffer-flags.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void ___autoconf_func(void) 4 | { 5 | (void)ring_buffer_lock_reserve(NULL, 0, 0); 6 | } 7 | -------------------------------------------------------------------------------- /runtime/autoconf-ring_buffer_read_prepare.c: -------------------------------------------------------------------------------- 1 | /* Some kernels have split preparing and starting ring_buffers. */ 2 | #include 3 | #include 4 | 5 | void foo (void) 6 | { 7 | ring_buffer_read_prepare(NULL, 1); 8 | } 9 | -------------------------------------------------------------------------------- /runtime/autoconf-stacktrace_ops-warning.c: -------------------------------------------------------------------------------- 1 | /* Some kernels have warning fields in stacktrace_ops. */ 2 | #include 3 | #include 4 | 5 | void foo (void) 6 | { 7 | struct stacktrace_ops t; 8 | t.warning = 0; 9 | (void) t; 10 | } 11 | -------------------------------------------------------------------------------- /runtime/autoconf-task-uid.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int bar (struct task_struct *foo) { 4 | return (foo->uid = 0); 5 | } 6 | /* as opposed to linux/cred.h wrappers current_uid() etc. */ 7 | -------------------------------------------------------------------------------- /runtime/autoconf-trace-printk.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int bar (void) { 4 | static char *fmt = "%s\n"; 5 | trace_printk (fmt, "hello world"); 6 | return 0; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /runtime/autoconf-uaccess.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | -------------------------------------------------------------------------------- /runtime/autoconf-utrace-regset.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* old rhel5 utrace regset */ 4 | int foobar(int n) { 5 | const struct utrace_regset_view *rsv = utrace_native_view(current); 6 | const struct utrace_regset *rs = & rsv->regsets[0]; 7 | return rsv->n + n + (rs->get)(current, rs, 0, 0, NULL, NULL); 8 | } 9 | -------------------------------------------------------------------------------- /runtime/autoconf-vm-area-pte.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* kernel commit cd12909cb576d373 */ 4 | struct vm_struct * foo (void) { 5 | return alloc_vm_area(PAGE_SIZE, NULL); 6 | } 7 | -------------------------------------------------------------------------------- /runtime/autoconf-walk-stack.c: -------------------------------------------------------------------------------- 1 | /* Some kernels have an extra stacktrace_ops field walk_stack. */ 2 | #include 3 | #include 4 | 5 | void foo (void) 6 | { 7 | struct stacktrace_ops t; 8 | t.walk_stack = print_context_stack; 9 | (void) t; 10 | } 11 | -------------------------------------------------------------------------------- /runtime/autoconf-x86-gs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if defined (__i386__) 4 | struct pt_regs regs = {.gs = 0x0}; 5 | #endif 6 | -------------------------------------------------------------------------------- /runtime/autoconf-x86-uniregs.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if defined (__i386__) || defined (__x86_64__) 4 | struct pt_regs regs = {.ax = 0x0}; 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /runtime/bench2/Makefile: -------------------------------------------------------------------------------- 1 | all: itest 2 | 3 | itest: itest.c 4 | gcc -D_GNU_SOURCE -Wall -Wextra -Wstrict-prototypes -Werror -O3 -o itest itest.c -lpthread 5 | 6 | clean: 7 | /bin/rm -f itest 8 | -------------------------------------------------------------------------------- /runtime/bench2/a.st: -------------------------------------------------------------------------------- 1 | # printf probefunc 2 | 3 | # You can put initialization in here 4 | probe begin { 5 | printf("BEGIN\n") 6 | } 7 | 8 | # This gets probed millions of times. TEST gets replaces 9 | # by the real probe point. 10 | probe TEST { 11 | printf("%s\n",probefunc()) 12 | } 13 | 14 | -------------------------------------------------------------------------------- /runtime/bench2/b.st: -------------------------------------------------------------------------------- 1 | # printf execname 2 | 3 | # You can put initialization in here 4 | probe begin { 5 | printf("FOO\n") 6 | } 7 | 8 | # This gets probed millions of times. TEST gets replaces 9 | # by the real probe point. 10 | probe TEST { 11 | printf("%s\n", execname()) 12 | } 13 | 14 | probe end { 15 | printf("DONE\n") 16 | } 17 | -------------------------------------------------------------------------------- /runtime/docs/examples/foreach.c: -------------------------------------------------------------------------------- 1 | /* example showing how to print all the stats in a map using foreach() */ 2 | 3 | struct map_node *ptr; 4 | 5 | foreach (mapsst, ptr) 6 | _stp_printf ("mapsst[%09s,%09s] = %llX\n", key1str(ptr), key2str(ptr), _stp_get_stat(ptr)->sum); 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /runtime/docs/examples/map.c: -------------------------------------------------------------------------------- 1 | 2 | /* create a map with a max of 100 elements */ 3 | MAP mymap = _stp_map_new(100, INT64); 4 | 5 | /* mymap[birth year] = 2000 */ 6 | map_key_str (mymap, "birth year"); 7 | map_set_int64 (mymap, 2000); 8 | -------------------------------------------------------------------------------- /runtime/docs/footer.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /runtime/perf_probe_handler_nmi.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* nmi parameter was removed with linux commit a8b0ca. */ 4 | static void enter_perf_probe(struct perf_event *e, 5 | int nmi, 6 | struct perf_sample_data *d, 7 | struct pt_regs *r) { } 8 | 9 | perf_overflow_handler_t callback = enter_perf_probe; 10 | -------------------------------------------------------------------------------- /runtime/uprobes/.gitignore: -------------------------------------------------------------------------------- 1 | /*.o 2 | /*.cmd 3 | /.tmp_versions 4 | /Module.* 5 | /modules.order 6 | /uprobes.ko 7 | /uprobes.mod.c 8 | -------------------------------------------------------------------------------- /runtime/uprobes/uprobes_arch.c: -------------------------------------------------------------------------------- 1 | #if defined (__x86_64__) 2 | #include "uprobes_x86_64.c" 3 | #elif defined (__i386__) 4 | #include "uprobes_i386.c" 5 | #elif defined (__powerpc__) 6 | #include "uprobes_ppc.c" 7 | #elif defined (__s390__) || defined (__s390x__) 8 | #include "uprobes_s390.c" 9 | #else 10 | #error "Unsupported architecture" 11 | #endif 12 | -------------------------------------------------------------------------------- /runtime/uprobes/uprobes_arch.h: -------------------------------------------------------------------------------- 1 | #if defined (__x86_64__) 2 | #include "uprobes_x86_64.h" 3 | #elif defined (__i386__) 4 | #include "uprobes_i386.h" 5 | #elif defined (__powerpc__) 6 | #include "uprobes_ppc.h" 7 | #elif defined (__s390__) || defined (__s390x__) 8 | #include "uprobes_s390.h" 9 | #else 10 | #error "Unsupported architecture" 11 | #endif 12 | -------------------------------------------------------------------------------- /scripts/kprobes_test/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.pyc 3 | .kprobe* 4 | *.log 5 | Module.symvers 6 | Module.markers 7 | kprobe_module.ko* 8 | kprobe_module.mod.c 9 | modules.order 10 | .tmp_versions 11 | probes.* 12 | kprobe_defs.h 13 | *.cfg 14 | -------------------------------------------------------------------------------- /scripts/probe_perf/.gitignore: -------------------------------------------------------------------------------- 1 | /bench_.h 2 | /bench-*.x 3 | /stapbench*.ko 4 | -------------------------------------------------------------------------------- /tapset/indent-default.stp: -------------------------------------------------------------------------------- 1 | function __indent_timestamp() { return gettimeofday_us() } 2 | -------------------------------------------------------------------------------- /tapset/null.stp: -------------------------------------------------------------------------------- 1 | 2 | global NULL = 0 3 | -------------------------------------------------------------------------------- /tapset/syscalls_cfg_trunc.stp: -------------------------------------------------------------------------------- 1 | 2 | # Default length for string truncation in e.g. read/write syscall arguments. 3 | global syscall_string_trunc = 50 4 | -------------------------------------------------------------------------------- /tapset/test/gencfiles.sh: -------------------------------------------------------------------------------- 1 | mkdir cfiles 2 | cp build.sh cfiles 3 | while read line 4 | do 5 | if [ `echo $line | grep "~~~~~~~~~~~~~~" | wc -l` -gt 0 ] 6 | then 7 | file=`echo $line |cut -d" " -f1` 8 | else 9 | echo "$line" >> cfiles/$file 10 | fi 11 | done < master.c 12 | -------------------------------------------------------------------------------- /testsuite/.gitignore: -------------------------------------------------------------------------------- 1 | .systemtap-* 2 | site.exp 3 | systemtap.log 4 | systemtap.sum 5 | dbg.log 6 | server.log 7 | *.so 8 | *_exe 9 | *.exe.[0-9] 10 | -------------------------------------------------------------------------------- /testsuite/buildko/one.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap -p4 -g - $@ <<'END' 4 | 5 | %{ 6 | #include 7 | %} 8 | 9 | function get_release () %{ 10 | /* this is a type error, detected by gcc */ 11 | STAP_RETVALUE = 5; 12 | %} 13 | 14 | probe begin 15 | { 16 | log("hello from systemtap, kernel version " . get_release()) 17 | } 18 | 19 | END 20 | -------------------------------------------------------------------------------- /testsuite/buildko/three.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp4 2 | 3 | probe begin { 4 | %{ /* not pure */ SYNTAX ERROR %} 5 | } 6 | 7 | -------------------------------------------------------------------------------- /testsuite/buildko/two.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # tests overwide arrays 4 | global a10 5 | global b10 6 | global c10 7 | global d10 8 | 9 | probe begin { 10 | a10[0,"a",0,"a",0,"a",0,"a",0,"a"]="a"; 11 | b10["b",0,"b",0,"b",0,"b",0,"b",0]=0; 12 | c10[0,"a",0,"a",0,"a",0,"a",0,"a"]<<<0; 13 | d10["b",0,"b",0,"b",0,"b",0,"b",0]<<<0; 14 | } 15 | -------------------------------------------------------------------------------- /testsuite/buildok/atomic.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | printf("%d\n", atomic_read(0)) 5 | printf("%d\n", atomic_long_read(0)) 6 | exit() 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/buildok/context-symbols-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print_stack(backtrace()) 5 | log(sprint_stack(backtrace())) 6 | log(probefunc()) 7 | log(probemod()) 8 | log(modname(0)) 9 | log(symname(0)) 10 | log(symdata(0)) 11 | } 12 | -------------------------------------------------------------------------------- /testsuite/buildok/context-unwind-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print_backtrace() 5 | printf("%s\n", backtrace()) 6 | printf("%s\n", sprint_backtrace()) 7 | printf("%s\n", caller()) 8 | printf("%d\n", caller_addr()) 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/buildok/ctime-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print(ctime(0)) 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/buildok/dentry-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin 4 | { 5 | print(__dentry_IS_ROOT(0)) 6 | print(__dentry_prepend(0, "abc")) 7 | println(d_name(0)) 8 | println(reverse_path_walk(0)) 9 | println(real_mount(0)) 10 | println(d_path(0)) 11 | println(inode_name(0)) 12 | println(task_dentry_path(0, 0, 0)) 13 | } 14 | -------------------------------------------------------------------------------- /testsuite/buildok/dev-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print(MAJOR(0)) 5 | print(MINOR(0)) 6 | print(MKDEV(0, 0)) 7 | print(usrdev2kerndev(0)) 8 | print(bdevname(0)) 9 | } 10 | 11 | -------------------------------------------------------------------------------- /testsuite/buildok/eight.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | global foo 4 | 5 | probe begin { 6 | foo[1] = 1 7 | delete foo[1] 8 | delete foo[foo[foo[foo[1]]]] 9 | delete foo 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/buildok/eleven.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin 4 | { 5 | a = -1 / -1; 6 | b = 2147483647 + a; 7 | c = 4294967295 / b; 8 | d = (-2147483647-1) % c; 9 | e = 9223372036854775807 * d; 10 | f /= b % e; 11 | g %= 0 / f; 12 | h = 1 / 0; 13 | println (h) 14 | } 15 | probe end 16 | { 17 | y %= 0; 18 | println (y) 19 | } 20 | -------------------------------------------------------------------------------- /testsuite/buildok/endian-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print(big_endian2(0)) 5 | print(big_endian4(0)) 6 | print(big_endian8(0)) 7 | print(little_endian2(0)) 8 | print(little_endian4(0)) 9 | print(little_endian8(0)) 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/buildok/errno-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print(errno_str(0)) 5 | print(errno_p(0)) 6 | print(returnval()) 7 | print(returnstr(0)) 8 | print(return_str(0, 0)) 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/buildok/five.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe kernel.function("schedule") { log ("arrival") } 4 | probe kernel.function("schedule").return { log ("departure") } 5 | -------------------------------------------------------------------------------- /testsuite/buildok/fortyfive.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | probe syscall.write { if (target_set_pid (pid())) printf ("%d (%d)\n", pid(), ppid()) } 3 | probe end { target_set_report () } 4 | -------------------------------------------------------------------------------- /testsuite/buildok/fortysix.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | // PR 3498 + wildcarded modules 3 | probe module("*scsi*").function("*").call { } 4 | -------------------------------------------------------------------------------- /testsuite/buildok/four.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe module("ext3").function("*") ? 4 | { 5 | log ("ext3 fn") 6 | } 7 | 8 | /*to avoid empty file*/ 9 | probe begin 10 | { 11 | log("begin") 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/buildok/gtod_init.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp4 2 | 3 | # check that STAP_NEED_GETTIMEOFDAY is defined with a gettimeofday 4 | function check() %{ 5 | #ifndef STAP_NEED_GETTIMEOFDAY 6 | #error "gettimeofday should define STAP_NEED_GETTIMEOFDAY!" 7 | #endif 8 | %} 9 | 10 | probe begin { 11 | check() 12 | println(gettimeofday_s()) 13 | } 14 | -------------------------------------------------------------------------------- /testsuite/buildok/gtod_noinit.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp4 2 | 3 | # check that STAP_NEED_GETTIMEOFDAY is NOT defined without a gettimeofday 4 | function check() %{ 5 | #ifdef STAP_NEED_GETTIMEOFDAY 6 | #error "STAP_NEED_GETTIMEOFDAY should not be defined!" 7 | #endif 8 | %} 9 | 10 | probe begin { 11 | check() 12 | println(get_cycles()) 13 | } 14 | -------------------------------------------------------------------------------- /testsuite/buildok/hwbkpt.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | probe 4 | %(CONFIG_PERF_EVENTS=="y" && CONFIG_HAVE_HW_BREAKPOINT=="y" %? 5 | kernel.data("pid_max").write 6 | %: 7 | never 8 | %) {} 9 | probe 10 | %(CONFIG_PERF_EVENTS=="y" && CONFIG_HAVE_HW_BREAKPOINT=="y" %? 11 | kernel.data("pid_max").rw 12 | %: 13 | never 14 | %) {} 15 | -------------------------------------------------------------------------------- /testsuite/buildok/indent.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print (thread_indent (1)) print ("yo\n") 5 | print (thread_indent (-1)) print ("ta\n") 6 | exit () 7 | } 8 | 9 | -------------------------------------------------------------------------------- /testsuite/buildok/inet-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | # 3 | probe begin { 4 | print (ntohll(0xfedcba9876543210) + ntohl(0xdeadbeef) + ntohs(0xd00d) + 5 | htonll(0x0123456789abcdef) + htonl(0xff0000ff) + htons(0xabcd)) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/buildok/inet_sock-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print (inet_get_local_port (0)) 5 | print (inet_get_ip_source (0)) 6 | %(systemtap_v <= "1.8" %? 7 | print (daddr_to_string(0)) 8 | %) 9 | } 10 | 11 | -------------------------------------------------------------------------------- /testsuite/buildok/ioblock-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in ioblock.stp are resolvable. 4 | 5 | probe ioblock.*, 6 | ioblock_trace.* ? {} 7 | -------------------------------------------------------------------------------- /testsuite/buildok/ioblock-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print (__bio_ino (0) + 5 | bio_rw_num (0) + 6 | __bio_start_sect (0)) 7 | 8 | print (__bio_devname (0)) 9 | print (bio_rw_str(0)) 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/buildok/ioscheduler-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in the ioscheduler tapset are resolvable. 4 | 5 | probe ioscheduler.*, ioscheduler.*.return {} 6 | 7 | probe ioscheduler_trace.* ? {} 8 | -------------------------------------------------------------------------------- /testsuite/buildok/ioscheduler-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print (disk_major_from_request (0) + 5 | disk_minor_from_request (0)) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/buildok/irq-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in irq tapset are resolvable 4 | 5 | probe workqueue.* !, never {} 6 | probe irq_handler.* !, never {} 7 | probe softirq.* !, never {} 8 | -------------------------------------------------------------------------------- /testsuite/buildok/kprocess-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in the process tapset are resolvable. 4 | 5 | probe kprocess.* 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/buildok/kprocess-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin 4 | { 5 | printf("%d\n", _IS_ERR(0)) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/buildok/linuxmib-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | // Tests if all probes in the linuxmib tapset are resolvable. 4 | 5 | probe linuxmib.* {} 6 | -------------------------------------------------------------------------------- /testsuite/buildok/linuxmib-detailed.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe linuxmib.DelayedACKs, linuxmib.ListenOverflows, 4 | linuxmib.ListenDrops, linuxmib.TCPMemoryPressures 5 | { 6 | printf("%p %d\n", sk, op) 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/buildok/logging-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp4 2 | 3 | // build-test the logging tapset functions 4 | 5 | probe begin { 6 | log("log") 7 | warn("warn") 8 | exit() 9 | error("error") 10 | stp_print_binary(1, 0, 0, 0, 0) 11 | ftrace("ftrace") 12 | printk(0,"Zoink! The paper tape punch is burning chads!") 13 | } 14 | -------------------------------------------------------------------------------- /testsuite/buildok/maxactive01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe kernel.function("vfs_read").return.maxactive(3) 4 | { 5 | printf("."); 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/buildok/memory-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in memory.stp are resolvable. 4 | 5 | probe vm.*, 6 | vm.*.* {} 7 | -------------------------------------------------------------------------------- /testsuite/buildok/memory-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin 4 | { 5 | printf("%d\n", vm_fault_contains(0, 0) 6 | + addr_to_node(0) + _IS_ZERO_PAGE(0, 0) 7 | + GFP_KERNEL()) 8 | printf("%s\n", __gfp_flag_str(0)) 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/buildok/memory-mmap.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # This fails on some kernels because we can't find the arguments to 4 | # this inline function (PR 1155). 5 | probe vm.mmap 6 | { 7 | printf("%s: %p %d\n", name, address, length) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/buildok/memory.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | probe vm.pagefault 3 | { 4 | printf("ppname: %s, %d, %p\n", probefunc(), write_access, address) 5 | } 6 | 7 | probe vm.pagefault.return 8 | { 9 | printf("ppname: %s, %d\n", probefunc(), fault_type) 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/buildok/nd_syscalls-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | probe nd_syscall.* 4 | { 5 | printf("%s (%s)\n", name, argstr) 6 | } 7 | 8 | probe nd_syscall.*.return 9 | { 10 | printf("%s\n", retstr) 11 | } 12 | -------------------------------------------------------------------------------- /testsuite/buildok/netfilter01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # use string as priority value 4 | probe netfilter.hook("NF_INET_PRE_ROUTING").pf("NFPROTO_IPV4").priority("-1") { printf("a") } 5 | probe netfilter.hook("NF_INET_PRE_ROUTING").pf("NFPROTO_IPV4") { printf("b") } 6 | probe netfilter.hook("NF_INET_PRE_ROUTING").pf("NFPROTO_IPV4").priority("3") { printf("c\n") } 7 | 8 | -------------------------------------------------------------------------------- /testsuite/buildok/netfilter02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # use string as priority value 4 | probe netfilter.hook("NF_INET_PRE_ROUTING").pf("NFPROTO_IPV4").priority("1") { } 5 | probe netfilter.hook("NF_INET_PRE_ROUTING").pf("NFPROTO_IPV4") { } 6 | 7 | -------------------------------------------------------------------------------- /testsuite/buildok/netfilter03.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp4 2 | 3 | # setting verdict in guru mode should succeed 4 | probe netfilter.pf("NFPROTO_IPV4").hook("NF_INET_PRE_ROUTING") { $verdict = 0 /* NF_DROP */ } 5 | -------------------------------------------------------------------------------- /testsuite/buildok/netfilter04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe netfilter.pf("NFPROTO_IPV4").hook("NF_INET_PRE_ROUTING") { } 4 | -------------------------------------------------------------------------------- /testsuite/buildok/networking-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in networking.stp are resolvable. 4 | 5 | probe netdev.* { } 6 | -------------------------------------------------------------------------------- /testsuite/buildok/networking-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | printf("%s\n", get_netdev_name(0)) 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/buildok/nfs-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in nfs.stp and nfs_proc.stp are resolvable. 4 | 5 | probe nfs.*.*, nfs.*.*.* {} 6 | -------------------------------------------------------------------------------- /testsuite/buildok/nfs-fop.check_flags.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # This test fails on some kernels because we can't find the arguments to 4 | # this inline function (PR 1155). 5 | probe nfs.fop.check_flags { 6 | printf("%s(%s)\n", name, argstr) 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/buildok/nfsd-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in nfsd.stp are resolvable. 4 | 5 | probe nfsd.*, nfsd.*.*, nfsd.*.*.* {} 6 | -------------------------------------------------------------------------------- /testsuite/buildok/nfsd-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print (__svc_fh (0)) 5 | print (nfs3_cmode(0)) 6 | print (nfs4_ctype(0)) 7 | print (ftype(0)) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/buildok/nfsderrno-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print (nfsderror (0)) 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/buildok/nine.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp2 2 | 3 | function f () { } 4 | function g (arg) { } 5 | 6 | probe begin { 7 | (true=1) ? f() : g(1); 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/buildok/null.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # PR10298 4 | global foo = 5 5 | probe begin { if (foo == NULL) log("hello") } 6 | -------------------------------------------------------------------------------- /testsuite/buildok/per-process-syscall.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | # 3 | # per-process syscall trace test 4 | 5 | probe process.syscall { 6 | print($syscall) 7 | print($arg1) 8 | print($arg2) 9 | print($arg3) 10 | print($arg4) 11 | print($arg5) 12 | print($arg6) 13 | } 14 | 15 | probe process.syscall.return { 16 | print($syscall) 17 | print($return) 18 | } 19 | -------------------------------------------------------------------------------- /testsuite/buildok/pr10678.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # The ne2k_pci module dwarf refers to both kernel and 8390 module symbols 4 | %( CONFIG_NE2K_PCI == "m" %? 5 | probe module("ne2k_pci").function("ne2k_pci_open") { log($$parms); } 6 | %: 7 | probe begin { log("No ne2k-pci module, this test skipped.");exit(); } 8 | %) 9 | -------------------------------------------------------------------------------- /testsuite/buildok/pr13284.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # jiffies is a global that needs to be pulled from the symbol table. 4 | probe kernel.function("schedule_timeout") { println($jiffies) } 5 | -------------------------------------------------------------------------------- /testsuite/buildok/procfs01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | global foo_value = "100\n" 4 | 5 | probe procfs("foo").read { 6 | $value = foo_value 7 | } 8 | 9 | probe procfs("foo").write { 10 | foo_value = $value 11 | printf("value is %s", foo_value) 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/buildok/random-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin 4 | { 5 | printf("%d\n", randint(10)) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/buildok/rpc-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in rpc.stp are resolvable. 4 | 5 | probe sunrpc.*, sunrpc.*.*, sunrpc.*.*.* {} 6 | -------------------------------------------------------------------------------- /testsuite/buildok/scheduler-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in the scheduler tapset are resolvable. 4 | 5 | probe scheduler.* {} 6 | -------------------------------------------------------------------------------- /testsuite/buildok/scheduler-cpu_off.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe scheduler.cpu_off 4 | { 5 | printf("%s: %p %p %d\n", name, task_prev, task_next, idle) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/buildok/scheduler-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin 4 | { 5 | printf("%d\n", __is_idle() + container_of_task_rcu(0)) 6 | } 7 | 8 | -------------------------------------------------------------------------------- /testsuite/buildok/scsi-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in the scsi tapset are resolvable. 4 | 5 | probe scsi.* {} 6 | -------------------------------------------------------------------------------- /testsuite/buildok/scsi-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | println(describe_data_direction(0)) 5 | println(describe_device_state(0)) 6 | println(timer_pending(0)) 7 | println(scsi_timer_pending(0)) 8 | println(get_devstate_from_req (0)) 9 | } 10 | 11 | -------------------------------------------------------------------------------- /testsuite/buildok/signal-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in the signal tapset are resolvable. 4 | 5 | probe signal.*, 6 | signal.*.* 7 | {} 8 | -------------------------------------------------------------------------------- /testsuite/buildok/signal-check_ignored.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # This test fails on some kernels because we can't find the arguments to 4 | # this inline function (PR 1155). 5 | probe signal.check_ignored 6 | { 7 | printf("%s(%d(%s), %d(%s))\n", name, sig, sig_name, sig_pid, pid_name) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/buildok/signal-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | print (get_sigset(0)) 5 | print (get_sa_flags(0)) 6 | print (get_sa_handler(0)) 7 | print (sigset_mask_str(0)) 8 | print (is_sig_blocked(0, 0)) 9 | print (sa_flags_str(0)) 10 | } 11 | 12 | -------------------------------------------------------------------------------- /testsuite/buildok/signal-handle.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # This test fails on some kernels because we can't find the arguments to 4 | # this inline function (PR 1155). 5 | probe signal.handle 6 | { 7 | printf("%s(%d(%s), %p\n", name, sig, sig_name, sinfo) 8 | printf("%d %p %p %d\n", sig_code, ka_addr, oldset_addr, regs) 9 | printf("%s\n", sig_mode) 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/buildok/socket-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in the socket tapset are resolvable. 4 | 5 | probe socket.*, 6 | socket.*.* {} 7 | -------------------------------------------------------------------------------- /testsuite/buildok/syscall.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | probe syscall.*, syscall.*.return { 4 | if (retstr != "") 5 | printf("%s\n", retstr) 6 | else 7 | printf("%s: %s (%s) = ", execname(), name, argstr) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/buildok/system-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin 4 | { 5 | system("ls") 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/buildok/tcp-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in the tcp tapset are resolvable. 4 | 5 | probe tcp.*, 6 | tcp.*.*, 7 | tcp.*.*.* {} 8 | -------------------------------------------------------------------------------- /testsuite/buildok/tcp-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | # 3 | probe begin { 4 | print (tcp_get_info_rto (0) + 5 | tcp_get_info_snd_cwnd (0) + 6 | tcp_ts_get_info_state (0) + 7 | tcp_ts_get_info_snd_ssthresh (0) + 8 | tcp_ts_get_info_rcv_mss (0)) 9 | printf("%s %s\n", tcp_sockopt_str(0), tcp_ipv6_sockopt_str(0)) 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/buildok/tcpmib-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | // Tests if all probes in the tcpmib tapset are resolvable. 4 | 5 | probe tcpmib.* {} 6 | -------------------------------------------------------------------------------- /testsuite/buildok/tcpmib-detailed.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | probe tcpmib.ActiveOpens, tcpmib.AttemptFails ?, tcpmib.CurrEstab ?, 4 | tcpmib.EstabResets ?, tcpmib.OutRsts, tcpmib.OutSegs, 5 | tcpmib.PassiveOpens, tcpmib.RetransSegs 6 | { 7 | printf("%p %d\n", sk, op) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/buildok/thirteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe kernel.function("vfs_read") 4 | { 5 | printf ("count=%d\n", $count) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/buildok/thirtyone.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | probe kprobe.function("vfs_stat") {} 4 | probe kprobe.function("do_sys_open") {} 5 | probe kernel.function("filp_close") {} 6 | -------------------------------------------------------------------------------- /testsuite/buildok/thirtythree.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap --ldd -vvv -p4 -e 'probe begin {}' -t -d /bin/ls 4 | 5 | 6 | -------------------------------------------------------------------------------- /testsuite/buildok/thirtytwo.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap -t -p4 -DKRETACTIVE=8888 -e ' 4 | probe kprobe.function("sys_open").return {} 5 | probe kprobe.function("sys_open").return.maxactive(100) {} 6 | probe kernel.function("sys_open").return {} 7 | probe kernel.function("sys_open").return.maxactive(100) {} 8 | probe syscall.*.return {} 9 | ' 10 | 11 | -------------------------------------------------------------------------------- /testsuite/buildok/timestamp-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | println(get_cycles()) 5 | println(tz_gmtoff()) 6 | println(tz_name()) 7 | println(tz_ctime(0)) 8 | println(jiffies()) 9 | println(HZ()) 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/buildok/timestamp_gtod-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | println(gettimeofday_ns()) 5 | println(gettimeofday_us()) 6 | println(gettimeofday_ms()) 7 | println(gettimeofday_s()) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/buildok/timestamp_monotonic-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | println(cpu_clock_ns(0)) 5 | println(cpu_clock_us(1)) 6 | println(cpu_clock_ms(2)) 7 | println(cpu_clock_s(3)) 8 | 9 | println(local_clock_ns()) 10 | println(local_clock_us()) 11 | println(local_clock_ms()) 12 | println(local_clock_s()) 13 | } 14 | -------------------------------------------------------------------------------- /testsuite/buildok/twenty.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp4 2 | 3 | # Test for writing to target variables, PR 1131 4 | 5 | probe kernel.function("vfs_readdir") 6 | { 7 | %( kernel_v >= "2.6.20" %? 8 | $file->f_path->dentry->d_name->len = 1 9 | %: 10 | $file->f_dentry->d_name->len = 1 11 | %) 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/buildok/twentyeight.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp4 2 | 3 | probe kernel.statement(0).absolute { log("absolute zero reached") } 4 | -------------------------------------------------------------------------------- /testsuite/buildok/twentyeightprime.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe process(0).statement(0).absolute { log("absolute zero reached") } 4 | -------------------------------------------------------------------------------- /testsuite/buildok/twentyfive.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # PR 3522. 4 | 5 | probe module("ext3").function("ext3_check_dir_entry")? { 6 | print ($ext3_filetype_table[1]) # static global in CU 7 | } 8 | probe timer.s(4) { exit () } 9 | 10 | -------------------------------------------------------------------------------- /testsuite/buildok/twentyfour.stp: -------------------------------------------------------------------------------- 1 | #! stap -wgp4 2 | 3 | # If the optimizer is working, this function will get elided, 4 | # and thus will compile successfully. 5 | 6 | function pure() %{ /* pure */ 7 | #error "should have been elided" 8 | %} 9 | 10 | 11 | probe begin 12 | { 13 | pure () 14 | } 15 | -------------------------------------------------------------------------------- /testsuite/buildok/twentynine.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp4 2 | 3 | probe kernel.function("icmp_rcv") { 4 | printf("skb = %x\n", $skb); 5 | $skb = 0; 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/buildok/twentyseven.stp: -------------------------------------------------------------------------------- 1 | #! stap -up4 2 | 3 | probe syscall.execve 4 | { 5 | print(@defined($__argv) ? $__argv[0] : $argv[0]) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/buildok/twentythree.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp4 2 | 3 | # Test for writing 64-bit target variable, PR 1271 4 | 5 | probe kernel.function("deactivate_super") 6 | { 7 | $s->s_maxbytes = 22; 8 | printf("set to 22 => %d\n", $s->s_maxbytes) 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/buildok/twentytwo.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # Test for reading 64-bit target variable, PR 1271 4 | 5 | probe kernel.function("deactivate_super") 6 | { 7 | printf("s_maxbytes %d\n", $s->s_maxbytes) 8 | } 9 | 10 | probe kernel.function("vfs_llseek").call 11 | { 12 | printf("offset %d\n", $offset) 13 | } 14 | -------------------------------------------------------------------------------- /testsuite/buildok/ucontext-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | log(umodname(uaddr())) 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/buildok/ucontext-unwind-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | probe begin { 4 | # On platforms without uprobes, this will fail. But, 5 | # buildok.exp will figure that out and kfail this test. 6 | print_ubacktrace() 7 | print_ubacktrace_brief() 8 | printf("%s\n", ubacktrace()) 9 | printf("%s\n", sprint_ubacktrace()) 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/buildok/udp-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in the udp tapset are resolvable. 4 | 5 | probe udp.*, 6 | udp.*.* {} 7 | -------------------------------------------------------------------------------- /testsuite/buildok/utrace.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | probe process.begin { } 4 | -------------------------------------------------------------------------------- /testsuite/buildok/vfs-all-probes.stp: -------------------------------------------------------------------------------- 1 | #! stap -wp4 2 | 3 | // Tests if all probes in the vfs.stp are resolvable. 4 | 5 | probe vfs.*, 6 | vfs.*.*, 7 | generic.*.*, 8 | generic.*.*.* {} 9 | -------------------------------------------------------------------------------- /testsuite/buildok/xtime.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # Test for getting at an external global variable PR10622 4 | probe kernel.function("do_gettimeofday") 5 | { 6 | printf("xtime.tv_sec:%d\n", 7 | (@defined($timekeeper->xtime->tv_sec) ? $timekeeper->xtime->tv_sec 8 | : $xtime->tv_sec)) 9 | exit(); 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/config/unix.exp: -------------------------------------------------------------------------------- 1 | load_lib "systemtap.exp" 2 | load_lib "stap_run2.exp" 3 | load_lib "stap_run_exact.exp" 4 | load_lib "stap_run_binary.exp" 5 | load_lib "stap_run.exp" 6 | load_lib "stap_compile.exp" 7 | load_lib "stap_run_error.exp" 8 | load_lib "cache_compile.exp" 9 | load_lib "compile_flags.exp" 10 | -------------------------------------------------------------------------------- /testsuite/execrc: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Run given program, but return a successful rc anyway. 4 | eval $@ 5 | exit 0 6 | -------------------------------------------------------------------------------- /testsuite/parseko/array01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # array size must be >0 4 | global a[0] 5 | -------------------------------------------------------------------------------- /testsuite/parseko/array02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # array size must have a reasonable upper limit 4 | global a[1000000000] 5 | -------------------------------------------------------------------------------- /testsuite/parseko/array03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # arrays can't be initialized with a scalar number 4 | global a[10] = 42 5 | -------------------------------------------------------------------------------- /testsuite/parseko/array04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # arrays can't be initialized with a scalar string 4 | global a[10] = "foobar" 5 | -------------------------------------------------------------------------------- /testsuite/parseko/bad_tapset.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # PR11405: with -W, bad tapsets should still be an error 4 | 5 | TAPSET=`dirname $0`/bad_tapset/ 6 | stap -p1 -e 'probe begin {}' -I $TAPSET -W 7 | -------------------------------------------------------------------------------- /testsuite/parseko/bad_tapset/foo.stp: -------------------------------------------------------------------------------- 1 | # this is an intentional syntax error for testing PR11405 2 | probe foo = .bar {} 3 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdline02.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # -sNUM Use NUM megabyte buffers for kernel-to-user data transfer. On a 4 | # multiprocessor in bulk mode, this is a per-processor amount. 5 | # 6 | # NUM must be between 1 and 64 7 | 8 | stap -p1 -s 0 -e 'probe begin { exit() }' 9 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdline03.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # -p NUM Stop after pass NUM. The passes are numbered 1-5: parse, elabo- 4 | # rate, translate, compile, run. 5 | # 6 | # NUM must be between 1 and 5 7 | 8 | stap -p0 -e 'probe begin { exit() }' 9 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdline04.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # multiple '-e' (script) options cannot be specified 4 | 5 | stap -p1 -e 'probe begin { exit() }' -e 'probe end { exit() }' 6 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdline06.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Bad TMPDIR environment variable should cause exit 4 | 5 | TMPDIR=/dev/null/BADTMPDIR stap -p1 -e 'probe begin { exit() }' 6 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdline07.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A module name must be specified when using '-m' - the module name 4 | # can't be empty 5 | 6 | stap -p1 -m "" -e 'probe begin { exit() }' 7 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdline08.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A module name can only be composed of chars [_a-zA-Z0-9] 4 | stap -p1 -m x^y -e 'probe begin { exit() }' 5 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdline09.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A module name can't have more than 60 chars (stap truncates the 4 | # module name before creating the kernel module but staprun can't 5 | # truncate an existing module name). 6 | staprun stap_123456789012345678901234567890123456789012345678901234567890 7 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdline11.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # options '-L' and '-A' are mutually exclusive 4 | # 5 | # -L Load module and start probes, then detach. 6 | # -A Attach to loaded systemtap module. 7 | 8 | staprun -L -A fake_module 9 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdline14.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # options '-A' and '-x pid' are mutually exclusive 4 | # 5 | # -A Attach to loaded systemtap module. 6 | # -x pid Sets the '_stp_target' variable to pid. 7 | staprun -A -x 100 fake_module 8 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdline15.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # options '-c cmd' and '-x pid' are mutually exclusive 4 | # 5 | # -c CMD start the probes, run CMD, and exit when it finishes 6 | # -x PID sets target() to PID 7 | stap -p1 -c /bin/ls -x 100 -e 'probe begin { exit() }' 8 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdline17.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # options '-D' and '-L' are mutually exclusive 4 | # 5 | #-D Run in background. This requires '-o' option. 6 | #-L Load module and start probes, then detach. 7 | 8 | staprun -L -D fake_module 9 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdline20.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # You have to specify ouput FILE with '-D' option 4 | # 5 | #-D Run in background. This requires '-o' option. 6 | #-o FILE Send output to FILE. This supports strftime(3) 7 | # formats for FILE. 8 | 9 | staprun -D fake_module 10 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdlinearg01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad command line argument number - must start at 1 4 | probe begin { 5 | arg = $0 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/parseko/cmdlinearg02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad command line argument number - bad number 4 | probe begin { 5 | arg = $12A3 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/parseko/conditional.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe begin { 4 | %( 1 == 0 %? print(1) %? print(2) %) 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/parseko/deprecated01.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # We shouldn't be able to parse a deprecated function 4 | 5 | stap --check-version --compatible=1.4 -W -p2 -e 'probe nd_syscall.accept { println(flag_str++) }' 6 | -------------------------------------------------------------------------------- /testsuite/parseko/eight.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | probe foo { 3 | foreach ([a, b, c] in) ; 4 | } 5 | -------------------------------------------------------------------------------- /testsuite/parseko/eighteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad global 4 | global 123 5 | -------------------------------------------------------------------------------- /testsuite/parseko/eleven.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | function foo () {} 4 | function foo () {} 5 | -------------------------------------------------------------------------------- /testsuite/parseko/fifteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe begin 4 | { 5 | foreach ([x+,y-] in a) {} 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/parseko/five.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe foo( { 4 | } 5 | 6 | probe bar() { 7 | } 8 | 9 | probe baz.(1) { 10 | } 11 | 12 | probe faz(2), { 13 | } 14 | 15 | probe kaz,goo. { 16 | } 17 | -------------------------------------------------------------------------------- /testsuite/parseko/foreachstmt01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # missing parens after foreach keyword 4 | 5 | global array 6 | 7 | function decl() 8 | { 9 | array[0] = 1 10 | foreach key in array 11 | printf("key %d, value %d\n", key, array[key]) 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/parseko/foreachstmt02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # no identifier after opening paren after foreach keyword 4 | 5 | global array 6 | 7 | function decl() 8 | { 9 | array[0] = 1 10 | foreach (* in array) 11 | printf("key %d, value %d\n", key, array[key]) 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/parseko/foreachstmt03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # missing closing bracket after opening paren after foreach keyword 4 | 5 | global array 6 | 7 | function decl() 8 | { 9 | array[0] = 1 10 | foreach ([key in array) 11 | printf("key %d, value %d\n", key, array[key]) 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/parseko/foreachstmt04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # multiple sort directives in foreach statement 4 | 5 | global array 6 | 7 | function decl() 8 | { 9 | array[0] = 1 10 | foreach (key- in array-) 11 | printf("key %d, value %d\n", key, array[key]) 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/parseko/foreachstmt05.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # missing closing paren after foreach keyword 4 | 5 | global array 6 | 7 | function decl() 8 | { 9 | array[0] = 1 10 | foreach (key in array 11 | printf("key %d, value %d\n", key, array[key]) 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/parseko/foreachstmt06.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # missing expression after limit 4 | 5 | global array 6 | 7 | function decl() 8 | { 9 | array[0] = 1 10 | foreach (key in array limit) 11 | printf("key %d, value %d\n", key, array[key]) 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/parseko/foreachstmt07.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # missing limit keyword but with an expression 4 | 5 | global array 6 | 7 | function decl() 8 | { 9 | array[0] = 1 10 | foreach (key in array 5) 11 | printf("key %d, value %d\n", key, array[key]) 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/parseko/forstmt01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # no '(' following 'for' 4 | 5 | function decl() 6 | { 7 | for i = 0; i < 10; i++ 8 | j = i 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/parseko/forstmt02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # no ';' following for initialization 4 | 5 | function decl() 6 | { 7 | for (i = 0) 8 | j = i 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/parseko/forstmt03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # no ';' following for condition 4 | 5 | function decl() 6 | { 7 | for (i = 0; i < 5) 8 | j = i 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/parseko/forstmt04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # 'for' missing closing ')' 4 | 5 | function decl() 6 | { 7 | for (i = 0; i < 5; i++ 8 | j = i 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/parseko/four.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe foo { 4 | somethingawful->foo = 1; 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/parseko/fourteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | function zoo () %{ /* invalid embedded code */ %} 4 | 5 | probe begin 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/parseko/functiondecl01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad function declaration 4 | function 123 (arg1, arg2) 5 | { 6 | return arg1 + arg2 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/parseko/functiondecl02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad function declaration 4 | function function (arg1, arg2) 5 | { 6 | return arg1 + arg2 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/parseko/functiondecl03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad function declaration - only "string" or "long" are valid 4 | # function return types 5 | function decl:foo (arg1, arg2) 6 | { 7 | return arg1 + arg2 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/parseko/functiondecl04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad function declaration - no "()" after name 4 | function decl 5 | { 6 | return 0 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/parseko/functiondecl05.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad function declaration - bad parameter list 4 | function decl(*) 5 | { 6 | return 0 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/parseko/functiondecl06.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad function declaration - bad argument type 4 | function decl(a:foo) 5 | { 6 | return 0 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/parseko/functiondecl07.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad function declaration - needs a ',' between arguments 4 | function decl(a b) 5 | { 6 | return 0 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/parseko/ifstmt01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # missing parens after if statment 4 | 5 | function decl() 6 | { 7 | if a == b 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/parseko/ifstmt02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # missing closing paren in if statment 4 | 5 | function decl() 6 | { 7 | if (a == b 8 | printf("in decl\n") 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/parseko/maxactive01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # maxactive with "begin" probe 4 | 5 | probe begin.maxactive(3) 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/parseko/maxactive02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # maxactive with a non-number argument 4 | 5 | global N = 2 6 | 7 | probe kernel.function("*").return.maxactive(N) 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/parseko/maxactive03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # maxactive with a non-number argument 4 | 5 | function four() { return 4 } 6 | 7 | probe kernel.function("*").return.maxactive(four()) 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/parseko/maxactive04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # maxactive with a numeric expression argument 4 | 5 | probe kernel.function("*").return.maxactive(3 + 2) 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/parseko/nine.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | probe foo { 3 | /*/ 0 4 | } 5 | -------------------------------------------------------------------------------- /testsuite/parseko/nineteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # 'next' in function context 4 | 5 | function decl() 6 | { 7 | next 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/parseko/one.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | "not a probe" 3 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad kernel version - not a string 4 | %( kernel_v <= 2.6 %? 5 | probe begin { } 6 | %) 7 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad comparison operator 4 | %( kernel_v * "2.6" %? 5 | probe begin { } 6 | %) 7 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad arch - not a string 4 | %( arch == foo %? 5 | probe begin { } 6 | %) 7 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad arch comparison operator - not '==' or '!=' 4 | %( arch >= "foo" %? 5 | probe begin { } 6 | %) 7 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess05.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad preprocess condition start - not "arch", "kernel_v", or "kernel_vr" 4 | %( foo == "2.6" %? 5 | probe begin { } 6 | %) 7 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess06.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # no "%?" 4 | %( arch == "2.6" %) 5 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess07.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # incomplete condition 4 | %( arch == 5 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess08.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # premature EOF during THEN tokens 4 | %( 0 == 0 %? 5 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess08b.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # premature EOF during ELSE tokens 4 | %( 0 == 1 %? %: 5 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess09.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # missing "else" token 4 | %( arch == "2.6" %? probe begin { } %: 5 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess10.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # expected number as right value in comparison 4 | %( $# != "2" %? probe begin { } %) 5 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess11.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # expected string as right value in comparison 4 | %( @# != 2 %? probe begin { } %) 5 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess12.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # command line argument index invalid or out of range 4 | # (try to access to an unavailable argument) 5 | %( $# < 2 %? probe begin { print @1 } %) 6 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess13.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # recursive 4 | stap -p1 -e '$1' '$1' 5 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess14.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # incomplete compound condition 4 | %( arch == "2.6" && %? probe begin() { } %) 5 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess15.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad compound condition 4 | %( arch == "2.6" && || arch == "2.66" %? probe begin() { } %) 5 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess16.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # recursive after the first token (PR11195) 4 | stap -p1 -e 'probe begin {$1}' 'x $1' 5 | -------------------------------------------------------------------------------- /testsuite/parseko/preprocess17.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap --compatible=1.0 -p1 -e 'global %( systemtap_v >= "1.2" %? PASS %: "FAIL" %)' 4 | -------------------------------------------------------------------------------- /testsuite/parseko/printd01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe begin { 4 | // missing the delimiter 5 | printd(1, 2, 3, 4, 5) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/parseko/printd02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe begin { 4 | // missing the delimiter 5 | printdln(1, 2, 3, 4, 5) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/parseko/printd03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe begin { 4 | // need more than one value to join 5 | printd(", ", 1) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/parseko/printd04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe begin { 4 | // need more than one value to join 5 | printdln(", ", 1) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/parseko/probepoint01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad probe point 4 | probe foo bar 5 | -------------------------------------------------------------------------------- /testsuite/parseko/probepoint02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad probe point 4 | probe foo(5( 5 | -------------------------------------------------------------------------------- /testsuite/parseko/probepoint03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad probe point 4 | probe foo(5)(6) 5 | -------------------------------------------------------------------------------- /testsuite/parseko/probepoint04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad probe point 4 | probe foo(5) if (1)? 5 | -------------------------------------------------------------------------------- /testsuite/parseko/probepoint05.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad probe point 4 | probe foo(5) if (1)(10) 5 | -------------------------------------------------------------------------------- /testsuite/parseko/probepoint06.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad probe point 4 | probe if (1) foo(5) 5 | -------------------------------------------------------------------------------- /testsuite/parseko/probepoint07.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad probe point 4 | probe foo(5) if (1( 5 | -------------------------------------------------------------------------------- /testsuite/parseko/probepoint08.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad probe point 4 | probe foo(5) if 5 | -------------------------------------------------------------------------------- /testsuite/parseko/probepoint09.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad probe point 4 | probe foo(5) if(1) bar(2) 5 | -------------------------------------------------------------------------------- /testsuite/parseko/procfs01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs.umask(0880).write {} 4 | 5 | 6 | -------------------------------------------------------------------------------- /testsuite/parseko/procfs02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs.umask(0880).read {} 4 | 5 | 6 | -------------------------------------------------------------------------------- /testsuite/parseko/procfs03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs("bar2").umask(0002).write { 4 | printf("The user wrote: %s", $value) 5 | } 6 | 7 | probe procfs("bar2").umask(0888).read {} 8 | 9 | 10 | -------------------------------------------------------------------------------- /testsuite/parseko/seven.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe foo { 4 | [a,] in b; 5 | [,c] in d; 6 | [] in e; 7 | a in e[2]; 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/parseko/seventeen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # empty file 4 | -------------------------------------------------------------------------------- /testsuite/parseko/six.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe foo { 4 | a = -9999999999999999999999999; 5 | b = 0xzoopoo; 6 | c = 00011122233344455566677788; 7 | d = 07777777777777777777777777; 8 | e = 18446744073709551616; # ULLONG_MAX+1 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/parseko/sixteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp1 2 | 3 | %{ 4 | -------------------------------------------------------------------------------- /testsuite/parseko/ternarystmt01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # missing ':' in ternary statement 4 | 5 | function decl() 6 | { 7 | a = (a == 1) ? 0 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/parseko/thirteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | %{ /* embedded code not permitted since -g not supplied */ %} 4 | 5 | probe begin 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/parseko/three.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | probe foo { 3 | foreach (a) ; 4 | } 5 | -------------------------------------------------------------------------------- /testsuite/parseko/twelve.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | global foo 4 | global foo 5 | -------------------------------------------------------------------------------- /testsuite/parseko/twenty.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # 'return' in probe context 4 | 5 | probe begin 6 | { 7 | return 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/parseko/twentyfive.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | global a,;b 4 | -------------------------------------------------------------------------------- /testsuite/parseko/twentyfour.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | global a;,b 4 | -------------------------------------------------------------------------------- /testsuite/parseko/twentyone.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # bad stat operator 4 | 5 | probe begin 6 | { 7 | v <<< 1 8 | printf("foo %d\n", @foo(v)) 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/parseko/twentyseven.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # PR 11208 4 | probe kernel.function ("sys_" /* this comment prevents string gluing */ "open") {} 5 | -------------------------------------------------------------------------------- /testsuite/parseko/twentysix.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # PR 5376 case 3 4 | probe foo ? = begin { } 5 | -------------------------------------------------------------------------------- /testsuite/parseko/twentythree.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap -p1 $SYSTEMTAP_TAPSET/indent.stp 4 | -------------------------------------------------------------------------------- /testsuite/parseko/twentytwo.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # wildcard with space 4 | 5 | probe a * b { } 6 | -------------------------------------------------------------------------------- /testsuite/parseko/two.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | probe foo { 3 | a + 4 | } 5 | -------------------------------------------------------------------------------- /testsuite/parseko/utrace01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # process NAME must be a string 4 | probe process(/bin/cat).end { } 5 | -------------------------------------------------------------------------------- /testsuite/parseko/whilestmt01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # missing parens after while statment 4 | 5 | function decl() 6 | { 7 | while 0 == 1 8 | printf("here\n") 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/parseko/whilestmt02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # missing closing paren after while statment 4 | 5 | function decl() 6 | { 7 | while (0 == 1 8 | printf("here\n") 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/parseok/all_tapsets.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # PR11405: all the default tapsets should succeed even with -W 4 | 5 | stap -p1 -e 'probe begin {}' -W 6 | -------------------------------------------------------------------------------- /testsuite/parseok/bad_tapset.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # PR11405: without -W, bad tapsets will be warned but shouldn't be an error 4 | 5 | TAPSET=`dirname $0`/../parseko/bad_tapset/ 6 | stap -p1 -e 'probe begin {}' -I $TAPSET 7 | -------------------------------------------------------------------------------- /testsuite/parseok/cmdline01.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | echo "output version" 4 | stap -V 5 | if [ $? != 0 ]; then 6 | exit $? 7 | fi 8 | 9 | echo "output version and help" 10 | stap -h 11 | -------------------------------------------------------------------------------- /testsuite/parseok/cmdline02.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # Make sure verbose ('-v') option is accepted. 4 | 5 | stap -v -p1 -e 'probe begin { exit() }' 6 | -------------------------------------------------------------------------------- /testsuite/parseok/deprecated01.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # We should be able to parse this function 4 | 5 | stap --check-version --compatible=1.5 -p2 -e 'probe nd_syscall.accept { println(flag_str++) }' 6 | -------------------------------------------------------------------------------- /testsuite/parseok/eight.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe all 4 | { 5 | "1" in a1; ["1", 2] in a2; [a] in a3; [("1").("2"), "1"."2"] in a4; 6 | a = [akbar(("foo").("bar"))] in it_s_a_trap 7 | foreach ([a, b] in a4) { foreach ([c, d] in a2) ; } 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/parseok/eighteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | global c, a = 1 4 | global b = "hello", d 5 | 6 | probe begin { } 7 | -------------------------------------------------------------------------------- /testsuite/parseok/end_string.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe begin { log(last_var_is_last_string); exit(); } 4 | 5 | // Parser used to barf when last token in a file was a string 6 | global last_var_is_last_string="HelloWorld" 7 | -------------------------------------------------------------------------------- /testsuite/parseok/fifteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | /* the epilogue style alias definitions */ 4 | probe syscall.read += kernel.function("sys_read") { 5 | fildes = $fd 6 | } 7 | 8 | -------------------------------------------------------------------------------- /testsuite/parseok/foreachstmt01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe one 4 | { 5 | foreach ([x+,y] in a limit 5) ; 6 | n = 5 ; 7 | foreach ([x,y-] in a limit n) ; 8 | foreach ([x,y] in a+ limit n + 2) ; 9 | foreach ([x,y] in a+ limit ++n) ; 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/parseok/four.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe syscall ("foo").foo.bar , syscall ("bar"), syscall ("*").return 4 | { # no comment 5 | $a = /* comment */ a$a = /**/ a$a$ = 0; // more comment 6 | } 7 | /* empty comment lines */ 8 | /**/ 9 | # 10 | // 11 | -------------------------------------------------------------------------------- /testsuite/parseok/kconfig.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | %( CONFIG_NO_SUCH_CONFIG == "" %? probe never {} %: %) 4 | -------------------------------------------------------------------------------- /testsuite/parseok/nine.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe one 4 | { 5 | if (a) if (b) d else e 6 | } 7 | 8 | probe two 9 | { 10 | a = b 11 | c = d 12 | _e = $f; 13 | _g = h_; 14 | ; 15 | } 16 | -------------------------------------------------------------------------------- /testsuite/parseok/nineteen.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap -p1 -e '$1 {log (@1.@2)}' 'probe foo' ' ' # <- control codes 4 | -------------------------------------------------------------------------------- /testsuite/parseok/one.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | # test 3 | function k () { } 4 | -------------------------------------------------------------------------------- /testsuite/parseok/seventeen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # Make sure you can use keywords in target symbol structure 4 | # references (Bugzilla 2193). 5 | 6 | probe kernel.function("add_timer_on") { 7 | printf("%x\n", $timer->function) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/parseok/six.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe nothing 4 | { 5 | a = 1+01+0x1-1-01-0x1; 6 | 7 | long_max = 2147483647; 8 | ulong_max = 4294967295; 9 | long_min = -2147483647-1; 10 | 11 | llong_max = 9223372036854775807; 12 | ullong_max = 18446744073709551615; 13 | llong_min = -9223372036854775807-1; 14 | } 15 | -------------------------------------------------------------------------------- /testsuite/parseok/sixteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | # complicated probe point wildcard 4 | probe abcX { } 5 | 6 | probe *abc* { } 7 | 8 | -------------------------------------------------------------------------------- /testsuite/parseok/thirteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe one 4 | { 5 | foreach ([x+,y] in a) ; 6 | foreach ([x,y-] in a) ; 7 | foreach ([x,y] in a+) ; 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/parseok/three.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe syscall ("foo") 4 | { 5 | $a = a$a = a$a$ = 0; 6 | str = "a" . $a . "b"; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /testsuite/parseok/twelve.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap -p1 -g $@ - <<'END' 4 | 5 | %{ 6 | /* hello world */ 7 | %} 8 | 9 | function foo:long (p1:string, p2:long, p3) %{ 10 | /* goodbye world */ 11 | %} 12 | 13 | END 14 | -------------------------------------------------------------------------------- /testsuite/parseok/twentyone.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp1 2 | 3 | probe one 4 | { 5 | println(%{ 1 %}) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/parseok/two.stp: -------------------------------------------------------------------------------- 1 | #! stap -p1 2 | 3 | probe syscall (231) 4 | { 5 | array[idx] <<< value; 6 | if (gbl > 5) { gbl -- } else ; 7 | } 8 | 9 | function foo () { 10 | delete array[4]; 11 | return 0; 12 | } 13 | 14 | probe end 15 | { 16 | foo ("value", 4+8); 17 | } 18 | -------------------------------------------------------------------------------- /testsuite/parseok/umask01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs("foo1").umask(0000).read { 4 | $value = "100\n" 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/parseok/umask02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs("foo2").umask(0004).read { 4 | $value = "100\n" 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/parseok/umask03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs("foo3").umask(0404).read { 4 | $value = "100\n" 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/parseok/umask04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs("foo4").umask(0002).write { 4 | printf("The user wrote: %s", $value) 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/parseok/umask05.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs("foo5").umask(0222).write { 4 | printf("The user wrote, %s", $value) 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/parseok/umask06.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs("foo").umask(0002).read { 4 | $value = "100\n" 5 | } 6 | 7 | probe procfs("foo").umask(0040).write { 8 | printf("The user wrote, %s", $value) 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/parseok/umask07.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs("foo7").read { 4 | $value = "100\n" 5 | } 6 | 7 | probe procfs("foo7").umask(0040).write { 8 | printf("The user wrote, %s", $value) 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/semko/array01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # arrays can't be inferred as anything else 4 | global a[10] 5 | probe begin { 6 | printf("%d\n", @count(a)) # try to make 'a' a stat 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/array02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # no local arrays allowed 4 | 5 | probe end { 6 | array[1,2] = 5 7 | print (array[4,6]) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semko/doubleglob.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe foo**bar {} 4 | -------------------------------------------------------------------------------- /testsuite/semko/eight.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global stats 4 | probe begin { 5 | stats <<< "string" # stats only collect numbers 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/semko/eighteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe kernel.function("schedule") { 4 | log ($no_such_variable_anywhere) 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/semko/entry01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global stat 4 | 5 | # dwarf probes can only use @entry in .return 6 | probe kernel.function("do_filp_open").call { 7 | stat <<< get_cycles() - @entry(get_cycles()) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semko/entry02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global stat 4 | 5 | # @entry is only valid in dwarf .return probes 6 | probe begin { 7 | stat <<< get_cycles() - @entry(get_cycles()) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semko/entry03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global stat 4 | 5 | # the type must agree between what was saved and how it's used 6 | probe kernel.function("do_filp_open").return { 7 | stat <<< get_cycles() - @entry(execname()) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semko/fifteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global tangle 4 | 5 | probe begin 6 | { 7 | foreach (state in tangle) 8 | { 9 | state = tangle[state]++ 10 | } 11 | log("hello from systemtap") 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /testsuite/semko/five.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | function bar () 4 | { 5 | return 0 6 | } 7 | 8 | probe begin { 9 | bar (1, 2) # arg count mismatch 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/semko/foreachstmt01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # limit keyword with string expression 4 | 5 | global array 6 | 7 | probe begin 8 | { 9 | array[0] = 1 10 | foreach (key in array limit "hi") 11 | printf("key %d, value %d\n", key, array[key]) 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/semko/foreachstmt03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # no value which is a statistic (b/c we don't have stat locals) 4 | 5 | global array 6 | 7 | probe begin 8 | { 9 | array[0] <<< 1 10 | foreach (val = key in array) 11 | printf("key %d, value %d\n", key, @sum(val)) 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/semko/forty.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global x 4 | probe kernel.function("do_sys_open") if (x = 1) { } # bad side-effect 5 | -------------------------------------------------------------------------------- /testsuite/semko/fortyeight.stp: -------------------------------------------------------------------------------- 1 | #! stap -Wp2 2 | 3 | # PR 11075 4 | 5 | global foo # evokes warning 6 | probe begin { exit() } 7 | -------------------------------------------------------------------------------- /testsuite/semko/fortyfive.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe kernel.function("*@kernel/kprobes.c").call {} // blacklisted 4 | -------------------------------------------------------------------------------- /testsuite/semko/fortyfour.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe foo = bar {} 4 | probe bar = foo {} 5 | probe foo {} 6 | -------------------------------------------------------------------------------- /testsuite/semko/fortynine.stp: -------------------------------------------------------------------------------- 1 | #! stap -up2 2 | 3 | probe begin { try {} catch (er) {println(er+2)} } 4 | -------------------------------------------------------------------------------- /testsuite/semko/fortyone.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe kernel.function("vfs_read") if (x > 1) { } # not a global 4 | -------------------------------------------------------------------------------- /testsuite/semko/fortyseven.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # PR5049 4 | 5 | probe kernel.function("*@ket.c") {} # must not match "....packet.c" 6 | -------------------------------------------------------------------------------- /testsuite/semko/fortysix.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe begin { if ("foo" == NULL) log ("boo") } # check NULL as integral global 4 | -------------------------------------------------------------------------------- /testsuite/semko/fortythree.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe foo.bar = foo.* { } 4 | probe foo.* { } 5 | -------------------------------------------------------------------------------- /testsuite/semko/four.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global a, b # types unknown 4 | 5 | function bar () 6 | { 7 | # no return statement 8 | } 9 | 10 | probe begin { 11 | a = b; 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/semko/fourteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global foo 4 | 5 | function bar() 6 | { 7 | a = foo["hello"]++ 8 | return 10 9 | } 10 | 11 | probe begin 12 | { 13 | foreach (a in foo) 14 | { 15 | bar() 16 | } 17 | log("hello from systemtap") 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /testsuite/semko/gurufunc.stp: -------------------------------------------------------------------------------- 1 | #! stap -up2 2 | 3 | # set_kernel_long should only be allowed with -g 4 | probe begin { set_kernel_long(0, 0) } 5 | -------------------------------------------------------------------------------- /testsuite/semko/inb_blacklisted.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | /* PR13112 (and PR13108) 4 | probing functions from blacklisted files shouldn't be possible. */ 5 | probe kernel.function("inb@*.h") 6 | { 7 | log("blacklisted") 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semko/local_array.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # missing global declaration 4 | probe begin 5 | { 6 | a[1] = 1 7 | println(a[1]) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semko/local_stat.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # missing global declaration 4 | probe begin 5 | { 6 | a <<< 1 7 | println(@count(a)) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semko/logging-embedded.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | // build-test the guru-only function (note lack of -g above) 4 | 5 | probe begin { 6 | printk(0,"Zoink! The paper tape punch is burning chads!") 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/map_wrap_bad.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global foo% 4 | 5 | probe begin { 6 | foo = 2; 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/maxactive01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # maxactive not on a return probe 4 | 5 | probe kernel.function("*").maxactive(3) 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/maxactive02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # maxactive with a string argument 4 | 5 | probe kernel.function("*").return.maxactive("hi") 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/maxactive03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # maxactive on a timer probe 4 | 5 | probe timer.sec(100).maxactive(3) 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/maxactive04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe kernel.function("vfs_read").return.maxactive(-4) 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/semko/maxactive05.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe kernel.function("vfs_read").return.maxactive(99999999) 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/semko/netfilter01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe netfilter { } 4 | -------------------------------------------------------------------------------- /testsuite/semko/netfilter02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe netfilter.hook { } 4 | -------------------------------------------------------------------------------- /testsuite/semko/netfilter03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe netfilter.hook("NF_INET_NONEXISTENT_HOOK") { } 4 | -------------------------------------------------------------------------------- /testsuite/semko/netfilter04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe netfilter.hook("NF_INET_PRE_ROUTING") { printf("%d\n", $verdict) } 4 | -------------------------------------------------------------------------------- /testsuite/semko/netfilter05.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # use non-string as priority value 4 | probe netfilter.hook("NF_INET_PRE_ROUTING").priority(2) { } 5 | -------------------------------------------------------------------------------- /testsuite/semko/netfilter06.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # no priority value 4 | probe netfilter.hook("NF_INET_PRE_ROUTING").priority { $verdict = "DROP" } 5 | -------------------------------------------------------------------------------- /testsuite/semko/netfilter07.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # setting verdict in non-guru mode should fail 4 | probe netfilter.hook("NF_INET_PRE_ROUTING") { $verdict = NF_DROP } 5 | -------------------------------------------------------------------------------- /testsuite/semko/netfilter08.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # using nonexistent protocol family should fail 4 | probe netfilter.hook("NF_INET_PRE_ROUTING").pf("INTERGALACTIC_IPV3000") { } 5 | -------------------------------------------------------------------------------- /testsuite/semko/netfilter09.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # use string as priority value 4 | probe netfilter.hook("NF_INET_PRE_ROUTING").priority("-1") { printf("a") } 5 | probe netfilter.hook("NF_INET_PRE_ROUTING") { printf("b") } 6 | probe netfilter.hook("NF_INET_PRE_ROUTING").priority("3") { printf("c\n") } 7 | 8 | -------------------------------------------------------------------------------- /testsuite/semko/netfilter10.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | 3 | # use string as priority value 4 | probe netfilter.hook("NF_INET_PRE_ROUTING").priority("1") { } 5 | probe netfilter.hook("NF_INET_PRE_ROUTING") { } 6 | 7 | -------------------------------------------------------------------------------- /testsuite/semko/netfilter11.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp4 2 | 3 | probe netfilter.hook("NF_INET_PRE_ROUTING") { $verdict = NF_DROP } 4 | -------------------------------------------------------------------------------- /testsuite/semko/nine.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global a 4 | 5 | probe begin { 6 | a[4] = 1; 7 | a = 2; 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semko/nodwf01.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Verify that --ignore-vmlinux "hides" vmlinux. 4 | 5 | stap -p2 --ignore-vmlinux -e ' 6 | probe kernel.function("printk") { 7 | printf("%s called\n", probefunc()) 8 | exit() 9 | } 10 | 11 | probe timer.sec(30) { 12 | exit() 13 | } 14 | ' 15 | -------------------------------------------------------------------------------- /testsuite/semko/nodwf02.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Verify that --ignore-dwarf "hides" dwarf info. 4 | 5 | stap -p2 --ignore-dwarf -e ' 6 | probe kernel.function("printk") { 7 | printf("%s called\n", probefunc()) 8 | exit() 9 | } 10 | 11 | probe timer.sec(30) { 12 | exit() 13 | } 14 | ' 15 | -------------------------------------------------------------------------------- /testsuite/semko/nodwf03.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # --kelf doesn't work if vmlinux can't be found. 4 | 5 | stap -p2 --ignore-vmlinux --kelf -e ' 6 | probe kernel.function("printk") { 7 | printf("%s called\n", probefunc()) 8 | exit() 9 | } 10 | 11 | probe timer.sec(30) { 12 | exit() 13 | } 14 | ' 15 | -------------------------------------------------------------------------------- /testsuite/semko/nodwf04.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # The symbol table doesn't give us enough info to probe inline functions. 4 | 5 | stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' 6 | probe kernel.function("list_empty").inline { 7 | printf("%s called\n", probefunc()) 8 | exit() 9 | } 10 | 11 | probe timer.sec(15) { 12 | exit() 13 | } 14 | ' 15 | -------------------------------------------------------------------------------- /testsuite/semko/nodwf05.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # The symbol table doesn't give us enough info to map source files to functions. 4 | 5 | stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' 6 | probe kernel.function("*@kernel/printk.c") { 7 | printf("%s called\n", probefunc()) 8 | exit() 9 | } 10 | 11 | probe timer.sec(15) { 12 | exit() 13 | } 14 | ' 15 | -------------------------------------------------------------------------------- /testsuite/semko/nodwf06.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # The symbol table doesn't give us enough info to probe statements. 4 | 5 | stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' 6 | probe kernel.statement("*@kernel/printk.c:639") { 7 | printf("probe hit: %s\n", pp()) 8 | exit() 9 | } 10 | 11 | probe timer.sec(15) { 12 | exit() 13 | } 14 | ' 15 | -------------------------------------------------------------------------------- /testsuite/semko/nodwf08.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # The regular blacklist should thwart this. 4 | 5 | stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' 6 | probe kernel.function("register_kprobe") { 7 | printf("%s called\n", probefunc()) 8 | exit() 9 | } 10 | 11 | probe timer.sec(30) { 12 | exit() 13 | } 14 | ' 15 | -------------------------------------------------------------------------------- /testsuite/semko/nofunc.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe begin { 4 | foo () # function is MIA 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/semko/one.stp: -------------------------------------------------------------------------------- 1 | #! stap -up2 2 | 3 | function stamp (syscall) 4 | { 5 | # no return expression => unknown function type 6 | } 7 | 8 | probe begin { a = stamp ("read"); } 9 | -------------------------------------------------------------------------------- /testsuite/semko/plt1.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe process("stap").plt { 4 | println($no_such_var) 5 | } 6 | 7 | -------------------------------------------------------------------------------- /testsuite/semko/plt2.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # this is an error without a -c cmd 4 | stap -p2 -e 'probe process.plt { exit() }' 5 | -------------------------------------------------------------------------------- /testsuite/semko/procfs01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs { } 4 | -------------------------------------------------------------------------------- /testsuite/semko/procfs02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs("foo").rread { } 4 | -------------------------------------------------------------------------------- /testsuite/semko/procfs03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe procfs.read.write { } 4 | -------------------------------------------------------------------------------- /testsuite/semko/procfs04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # write to $value in a procfs write probe 4 | probe procfs.write { 5 | $value = "hi" 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/semko/procfs05.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # read from $value in a procfs read probe 4 | probe procfs.read { 5 | x = $value 6 | printf("%s\n", x) 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/procfs06.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # path can't start with '/' 4 | probe procfs("/foo").read { } 5 | 6 | -------------------------------------------------------------------------------- /testsuite/semko/procfs07.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # path can't end with '/' 4 | probe procfs("foo/").read { } 5 | 6 | -------------------------------------------------------------------------------- /testsuite/semko/procfs08.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # path can't be a relative path 4 | probe procfs("foo/../bar").read { } 5 | 6 | -------------------------------------------------------------------------------- /testsuite/semko/procfs09.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # path can't be a relative path 4 | probe procfs("foo/.").read { } 5 | 6 | -------------------------------------------------------------------------------- /testsuite/semko/procfs10.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # path can't contain an empty component 4 | probe procfs("a//c").read { } 5 | 6 | -------------------------------------------------------------------------------- /testsuite/semko/procfs11.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # use $value as a structure pointer in a procfs probe 4 | probe procfs.write { print($value->foo) } 5 | -------------------------------------------------------------------------------- /testsuite/semko/procfs12.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # use $value as an array in a procfs probe 4 | probe procfs.write { print($value[0]) } 5 | -------------------------------------------------------------------------------- /testsuite/semko/procfs13.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # no maxsize value 4 | probe procfs.read.maxsize { $value = "foo" } 5 | -------------------------------------------------------------------------------- /testsuite/semko/procfs14.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # use -1 as a maxsize value 4 | probe procfs.read.maxsize(-1) { $value = "foo" } 5 | -------------------------------------------------------------------------------- /testsuite/semko/procfs15.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # use -1 as a maxsize value 4 | probe procfs("foo").read.maxsize(-1) { $value = "foo" } 5 | -------------------------------------------------------------------------------- /testsuite/semko/return01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe kernel.function("get_page_state").return 4 | { 5 | # this should fail, since get_page_state() is a void function 6 | printf("return is %d\n", $return) 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/return02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe kernel.function("vfs_read") 4 | { 5 | # this should fail - using $return not in a '.return' probe 6 | printf("in sys_read - return = %d\n", $return) 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/seven.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global baz 4 | probe begin { 5 | baz[1] = 4; 6 | baz["1"] = 5; # inconsistent index types 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/seventeen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe module("no_such_module").function("*") { } 4 | -------------------------------------------------------------------------------- /testsuite/semko/six.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global bar 4 | probe begin { 5 | bar[1] = 2; 6 | bar[1, 2] = 3; # inconsistent array dimensions 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/sixteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe kernel.function("no_such_function_anywhere_guaranteed") { } 4 | -------------------------------------------------------------------------------- /testsuite/semko/source_context.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe timer.ms(123) 4 | { 5 | printf("Probe successful\n") 6 | eeexit () 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/target_addr1.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | // can't take the address of bitfields 4 | probe kernel.function("release_task") { 5 | println(& $p->did_exec) // unsigned:1 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/semko/target_addr2.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | // can't take the address of register parameters 4 | probe kernel.function("do_sys_open") { 5 | println(& $dfd) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/semko/target_addr3.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | // can't take the address of register return values 4 | probe kernel.function("do_sys_open").return { 5 | println(& $return) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/semko/ten.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global foo 4 | probe begin { foo = 1 } 5 | probe end { if (4 in foo) { } } 6 | -------------------------------------------------------------------------------- /testsuite/semko/thirteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global foo 4 | 5 | function bar() 6 | { 7 | foo["hello"] = 10 8 | return 10 9 | } 10 | 11 | probe begin 12 | { 13 | foreach (a in foo) 14 | { 15 | bar() 16 | } 17 | log("hello from systemtap") 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /testsuite/semko/thirty.stp: -------------------------------------------------------------------------------- 1 | #! stap -up2 2 | 3 | # need one of these for each prohibited statistic operation 4 | 5 | global x 6 | 7 | probe end 8 | { 9 | x <<< 1 10 | x = 10 11 | } 12 | 13 | -------------------------------------------------------------------------------- /testsuite/semko/thirtyeight.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe kernel.statement(0).absolute {} /* needs guru mode */ 4 | -------------------------------------------------------------------------------- /testsuite/semko/thirtyfive.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe foo.a = kernel.function("no_such_function")? { "alias a" } 4 | probe foo.* { } 5 | -------------------------------------------------------------------------------- /testsuite/semko/thirtyfour.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # can't write to target variables in .return probes 4 | 5 | probe kernel.function("fget_light").return 6 | { 7 | $fd = 0 8 | printf("fd is %d\n", $fd) 9 | } 10 | probe kernel.function("do_sys_open").return { $filename } 11 | -------------------------------------------------------------------------------- /testsuite/semko/thirtynine.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe kernel.function("sys_open").if(1) {} /* if statement doesn't need '.'*/ 4 | -------------------------------------------------------------------------------- /testsuite/semko/thirtyone.stp: -------------------------------------------------------------------------------- 1 | #! stap -up2 2 | 3 | # need one of these for each prohibited statistic operation 4 | 5 | global x 6 | 7 | probe end 8 | { 9 | x[10] <<< 1 10 | x[10] = 10 11 | } 12 | 13 | -------------------------------------------------------------------------------- /testsuite/semko/thirtyseven.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp2 2 | 3 | probe kernel.statement(0).absolute { print ($any_variable) } 4 | -------------------------------------------------------------------------------- /testsuite/semko/thirtysix.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe kernel.function("kmem_cache_alloc") { 4 | print ($cachep->no_such_field) 5 | print ($cachep->array->should_have_indexed_it) 6 | print ($cachep->next) 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/thirtythree.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | // should fail since all these functions are blacklisted 4 | probe kernel.function("do_IRQ") {} 5 | probe kernel.function("*@*/kprobes.c") {} 6 | -------------------------------------------------------------------------------- /testsuite/semko/thirtytwo.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | // should fail since init_setup should be skipped because it is in .init.text 4 | probe kernel.function("init_setup") { } 5 | -------------------------------------------------------------------------------- /testsuite/semko/three.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global b 4 | probe begin { 5 | a <<< 2; 6 | b[a] = 4; # must not index with stats variable 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/twelve.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe end { 4 | for (a=0; "hello";) {println("hello")} 5 | while ("goodbye") {println("world")} 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/semko/twenty.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | function a:string () { } 4 | 5 | probe begin { 6 | print (a() + 1) 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semko/twentyeight.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # need one of these for each prohibited statistic operation 4 | 5 | global x 6 | 7 | probe end 8 | { 9 | x <<< 10 10 | x++ 11 | } 12 | 13 | -------------------------------------------------------------------------------- /testsuite/semko/twentyfive.stp: -------------------------------------------------------------------------------- 1 | #! stap -up2 2 | 3 | # need one of these for each prohibited statistic operation 4 | 5 | global x, y 6 | 7 | 8 | probe end 9 | { 10 | x = y[10] 11 | } 12 | 13 | -------------------------------------------------------------------------------- /testsuite/semko/twentyfour.stp: -------------------------------------------------------------------------------- 1 | #! stap -up2 2 | 3 | # need one of these for each prohibited statistic operation 4 | 5 | global x, y 6 | 7 | 8 | probe end 9 | { 10 | y = x 11 | } 12 | 13 | -------------------------------------------------------------------------------- /testsuite/semko/twentynine.stp: -------------------------------------------------------------------------------- 1 | #! stap -up2 2 | 3 | # need one of these for each prohibited statistic operation 4 | 5 | global x 6 | 7 | probe end 8 | { 9 | x <<< 10 <<< 11 # but see PR 1922 10 | } 11 | 12 | -------------------------------------------------------------------------------- /testsuite/semko/twentyone.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # tests that an inline function is *not* matched using 4 | # the function().call pattern 5 | 6 | probe kernel.function("context_switch").call { 7 | log ("found an inline via function().call") 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semko/twentyseven.stp: -------------------------------------------------------------------------------- 1 | #! stap -up2 2 | 3 | # need one of these for each prohibited statistic operation 4 | 5 | global x 6 | 7 | function foo(bar) 8 | { 9 | bar <<< x 10 | } 11 | 12 | probe end 13 | { 14 | x <<< 10 15 | foo(x) 16 | } 17 | 18 | -------------------------------------------------------------------------------- /testsuite/semko/twentysix.stp: -------------------------------------------------------------------------------- 1 | #! stap -up2 2 | 3 | # need one of these for each prohibited statistic operation 4 | 5 | global x 6 | 7 | 8 | probe end 9 | { 10 | x[10] <<< 1 11 | x[10] = 10 12 | } 13 | 14 | -------------------------------------------------------------------------------- /testsuite/semko/twentythree.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe badalias.* = begin { } 4 | -------------------------------------------------------------------------------- /testsuite/semko/twentytwo.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # tests that a non-inline function is *not* matched using 4 | # the inline() pattern 5 | 6 | probe kernel.function("vfs_read").inline { 7 | log ("found a non-inline via inline()") 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semko/two.stp: -------------------------------------------------------------------------------- 1 | #! stap -up2 2 | 3 | probe begin { 4 | bar = 2 + "string"; # mixing integer+string arithmetic 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/semko/twotwo.stp: -------------------------------------------------------------------------------- 1 | #! stap -up2 2 | 3 | function zoo (p) { p <<< 5; return 0 } # passing stats as function arg 4 | 5 | global car 6 | probe begin { 7 | zoo (car) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semko/typemismatch.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | 4 | global noo 5 | 6 | probe begin { foo = 1 ; foo = "bar" ; noo = 4 } 7 | 8 | probe end { foo = "zoo" ; foo <<< 2 ; noo = "zoo" } -------------------------------------------------------------------------------- /testsuite/semko/utrace.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe process.begin { } 4 | -------------------------------------------------------------------------------- /testsuite/semko/utrace03.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # invalid probe type 4 | probe process("/bin/cat").end.return { } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace04.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # end probes don't support target symbols 4 | probe process("/bin/cat").end { print($syscall) } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace05.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # can't write to $syscall 4 | probe process("/bin/cat").syscall { $syscall = 1 } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace06.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # treat $syscall as a pointer 4 | probe process("/bin/cat").syscall { print($syscall->foo) } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace07.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # treat $syscall as an array 4 | probe process("/bin/cat").syscall { print($syscall[0]) } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace14.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # pid can't be less than 2 4 | probe process(1).begin { } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace15.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # write to $argN 4 | probe process("/bin/cat").syscall { $arg1 = 1 } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace16.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # treat $argN as a pointer 4 | probe process("/bin/cat").syscall { print($arg1->foo) } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace17.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # treat $argN as an array 4 | probe process("/bin/cat").syscall { print($arg1[0]) } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace18.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # write to $return 4 | probe process("/bin/cat").syscall.return { $return = 1 } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace19.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # access to $return from syscall entry 4 | probe process("/bin/cat").syscall { print($return) } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace20.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # treat $return as an array 4 | probe process("/bin/cat").syscall { print($return[0]) } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace21.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # treat $return as a pointer/structure 4 | probe process("/bin/cat").syscall.return { print($return->foo) } 5 | -------------------------------------------------------------------------------- /testsuite/semko/utrace22.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # access to $argN from syscall return 4 | probe process("/bin/cat").syscall.return { print($arg1) } 5 | -------------------------------------------------------------------------------- /testsuite/semko/zero.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe begin { 4 | print (1 = a) 5 | print (a+1 = 4) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/semlib/f1.stp: -------------------------------------------------------------------------------- 1 | function f1 () { return 0 } 2 | -------------------------------------------------------------------------------- /testsuite/semlib/g1.stp: -------------------------------------------------------------------------------- 1 | global g1 2 | function g1set (a) { g1 = a + 0 } 3 | -------------------------------------------------------------------------------- /testsuite/semlib/g2.stp: -------------------------------------------------------------------------------- 1 | global g2 2 | probe begin { g2[0] = f1() } 3 | -------------------------------------------------------------------------------- /testsuite/semok/args.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap -p2 -e 'probe begin { log (@1 . sprint($2)) }' hello 0xdeadbeef 4 | -------------------------------------------------------------------------------- /testsuite/semok/badvar.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap -p2 --skip-badvars -e ' 4 | probe syscall.read { 5 | if ($foo == 0) 6 | printf ("Voila! It works..\n") 7 | exit () 8 | } 9 | ' 10 | -------------------------------------------------------------------------------- /testsuite/semok/badvar_undefined.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # PR11346: We shouldn't even see a warning when a would-be skip-badvars 4 | # replacement is masked by a @defined condition. 5 | 6 | stap -W -p2 --skip-badvars -e 'probe kernel.function("sys_getxattr") 7 | { printf("%s\n", user_string(@defined($pathname) ? $pathname : $path)) }' 8 | -------------------------------------------------------------------------------- /testsuite/semok/beginend.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe begin {} 4 | probe begin(0) {} 5 | probe begin(9223372036854775807) {} 6 | probe begin(-9223372036854775808) {} 7 | 8 | probe end {} 9 | probe end(0) {} 10 | probe end(9223372036854775807) {} 11 | probe end(-9223372036854775808) {} 12 | -------------------------------------------------------------------------------- /testsuite/semok/bz10475.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | // bz10475: pointer-array confused about array element size 3 | 4 | // struct file *filp_open(int dfd, const char *filename, int flags, int mode) 5 | probe kernel.function("filp_open") 6 | { 7 | // check array access on a "complex" pointer type 8 | println($filename[0]) 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/semok/doubleglob.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe *sys**pen {} // [nd_]syscall.[mq_]open 4 | probe t**ile {} // timer.profile 5 | probe t**es(1) {} // timer.jiffies(1) 6 | probe ke**on("vfs_read") {} // kernel.function("vfs_open") 7 | -------------------------------------------------------------------------------- /testsuite/semok/eight.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap -p2 -I${SRCDIR}/testsuite/semlib -e 'probe begin { a = f1 (); }' 4 | -------------------------------------------------------------------------------- /testsuite/semok/eighteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | function f () { } 4 | function g (arg) { } 5 | 6 | probe begin { 7 | f(); g(1) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semok/entry01.stp: -------------------------------------------------------------------------------- 1 | #! stap -Wp2 2 | 3 | global stat 4 | 5 | # dwarf .return probes can use @entry 6 | probe kernel.function("do_filp_open").return?, 7 | kernel.function("filp_open").return?, 8 | process("stap").function("main").return? 9 | { 10 | stat[pp()] <<< get_cycles() - @entry(get_cycles()) 11 | } 12 | -------------------------------------------------------------------------------- /testsuite/semok/entry02.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global stat 4 | 5 | # @entry can be optimized away from bad locations if the result is not used. 6 | probe begin { 7 | stat <<< get_cycles(); 8 | - @entry(get_cycles()) 9 | exit() 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/semok/fifteen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | function trace (n) { return 0 } 4 | 5 | # multiple independent derived probes using the "same" variable 6 | # (this used to crash before we deep-copied the body) 7 | 8 | probe begin, begin, begin 9 | { 10 | base_num = 10 11 | trace(base_num) 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/semok/five.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global array 4 | probe begin 5 | { 6 | array[1] = array[2] = 3; 7 | statvar <<< value <<< 4; 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semok/gurufunc.stp: -------------------------------------------------------------------------------- 1 | #! stap -gup2 2 | 3 | # set_kernel_long should only be allowed with -g 4 | probe begin { set_kernel_long(0, 0) } 5 | -------------------------------------------------------------------------------- /testsuite/semok/map_wrap_good.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global foo%[5] 4 | global bar%[5] 5 | 6 | probe begin { 7 | for(i=0; i<10; i++) 8 | { 9 | foo[i]=i; 10 | bar[i] <<< i; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/semok/netfilter01.stp: -------------------------------------------------------------------------------- 1 | #! stap -gp2 2 | 3 | # guru mode should enable use of weird hook/pf options without complaining 4 | probe netfilter.hook("NF_INET_WARP_10").pf("INTERGALACTIC_IPV3000") { } 5 | -------------------------------------------------------------------------------- /testsuite/semok/nine.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap -p2 -I${SRCDIR}/testsuite/semlib -e 'probe begin { g2[1] = 0 }' 4 | -------------------------------------------------------------------------------- /testsuite/semok/nodwf01.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' 4 | global nret 5 | 6 | probe syscall.*.return { 7 | /* NB: $return does NOT currently work here. */ 8 | printf("%s returns %s\n", name, returnstr(2)); 9 | if (nret++ > 50) 10 | exit() 11 | } 12 | ' 13 | -------------------------------------------------------------------------------- /testsuite/semok/nodwf03.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Test function-name wildcard. 4 | 5 | stap -p2 --ignore-vmlinux --kmap=/proc/kallsyms -e ' 6 | global ncall 7 | 8 | probe kernel.function("sys_*") { 9 | printf("%s called\n", probefunc()) 10 | if (ncall++ > 50) 11 | exit() 12 | } 13 | ' 14 | -------------------------------------------------------------------------------- /testsuite/semok/nodwf04.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Like nodwf01.stp, but extract the symbol table from vmlinux. 4 | 5 | stap -p2 --ignore-dwarf --kelf -e ' 6 | global nret 7 | 8 | probe syscall.*.return { 9 | /* NB: $return does NOT currently work here. */ 10 | printf("%s returns %s\n", name, returnstr(2)); 11 | if (nret++ > 50) 12 | exit() 13 | } 14 | ' 15 | -------------------------------------------------------------------------------- /testsuite/semok/nodwf06.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Test function-name wildcard. 4 | # Like nodwf03.stp, but extract the symbol table from vmlinux. 5 | 6 | stap -p2 --ignore-dwarf --kelf -e ' 7 | global ncall 8 | 9 | probe kernel.function("sys_*") { 10 | printf("%s called\n", probefunc()) 11 | if (ncall++ > 50) 12 | exit() 13 | } 14 | ' 15 | -------------------------------------------------------------------------------- /testsuite/semok/nodwf07.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Test module-name and function-name wildcards. 4 | 5 | stap -p2 --ignore-dwarf --kelf -e ' 6 | global ncall 7 | 8 | probe module("*").function("*_probe") { 9 | printf("%s called\n", probefunc()) 10 | if (ncall++ > 50) 11 | exit() 12 | } 13 | 14 | probe timer.sec(5) { 15 | exit() 16 | } 17 | ' 18 | -------------------------------------------------------------------------------- /testsuite/semok/plt1.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe process("stap").plt { 4 | println($$name) 5 | println(@defined($no_such_var) ? $no_such_var : 0) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/semok/plt2.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # this should read the plt from -c stap 4 | stap -p2 -e 'probe process.plt { exit() }' -c stap 5 | -------------------------------------------------------------------------------- /testsuite/semok/pr11808.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # PR11808 4 | # This stap command may or may not fail, depending on function/var 5 | # availability. It should not abort() though. 6 | stap -e 'probe kernel.function("next_tgid").return { println($return->tgid) }' -p2 7 | [ "$?" -le 1 ] 8 | -------------------------------------------------------------------------------- /testsuite/semok/pr11809.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # PR11809 4 | # This stap command may or may not fail, depending on function/var 5 | # availability. When it does fail, it should not be with "stack underflow". 6 | stap -e 'probe kernel.function("next_tgid") { println($iter->tgid) }' -p2 2>&1 | 7 | grep "stack underflow" 8 | [ "$?" -eq 1 ] 9 | -------------------------------------------------------------------------------- /testsuite/semok/pretty2.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # A less specific test for tracepoints 4 | # 5 | # We have an error where base types wouldn't work, PR11785, but it 6 | # should still work in $$parms$ as just "=?" 7 | %( CONFIG_TRACEPOINTS == "y" %? 8 | probe kernel.trace("*") { log($$parms$$) } 9 | %: 10 | probe never { next } // :( 11 | %) 12 | -------------------------------------------------------------------------------- /testsuite/semok/seventeen.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global foo 4 | probe kernel.function( 5 | %( kernel_v < "2.6.19" %? "pipe_writev" %: "pipe_write" %) ) 6 | { 7 | a = $nr_segs 8 | foo [a] = 1 9 | # $nr_segs is not an lvalue here (foo is), so this should compile 10 | # even in non-guru mode 11 | foo [$nr_segs] ++ 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/semok/six.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global bar, baz 4 | 5 | probe begin 6 | { 7 | tid=0 pid=0 8 | bar[tid] = 4; 9 | baz[pid] = "5"; 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/semok/syscall_return.stp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Per bz6588, this should get through the semantic pass without warnings. 3 | stap -p2 -e 'probe syscall.*.return { printf("%s returns %s\n", name, retstr) }' 2>&1 | grep -q WARNING && exit 1 4 | exit 0 5 | -------------------------------------------------------------------------------- /testsuite/semok/thirty.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe foo.a.one = foo.b, foo.c {} // not recursive 4 | probe foo.a.two = foo.c, foo.b {} // not recursive 5 | probe foo.b = foo.c {} 6 | probe foo.c = begin {} 7 | probe foo.a.one {} 8 | probe foo.a.two {} 9 | 10 | -------------------------------------------------------------------------------- /testsuite/semok/thirtyfour.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | # PR10495 3 | 4 | probe foo = kernel.function("sys_open") { name = "a" } 5 | probe foo = kernel.function("sys_close") { name = "c" } 6 | probe foo.bar = kernel.function("sys_exit") { name = "nothing" } 7 | 8 | probe foo { log(name) } 9 | probe foo.* { log(name) } 10 | -------------------------------------------------------------------------------- /testsuite/semok/thirtynine.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # PR 1155 discusses the trouble with inlines, but ideally this should work. 4 | 5 | probe kernel.function("context_switch") { 6 | printf("switch from=0x%x to=0x%x\n", $prev, $next) 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semok/thirtyone.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # PR5049 4 | 5 | probe kernel.function("*@module.c") {} 6 | -------------------------------------------------------------------------------- /testsuite/semok/thirtyseven.stp: -------------------------------------------------------------------------------- 1 | #! stap -wWp2 2 | 3 | # PR 11075 4 | 5 | global foo # evokes warning 6 | probe begin { exit() } 7 | -------------------------------------------------------------------------------- /testsuite/semok/thirtythree.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | # Per bz3016, this should get through the semantic pass without warnings. 3 | probe kernel.function("do_mpage_readpage") { 4 | printf("\n page->mapping %p",$page->mapping) 5 | %( kernel_v >= "2.6.22" %? 6 | printf("\n page->first_page->mapping %p",$page->first_page->mapping) 7 | %) 8 | 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/semok/thirtytwo.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # PR 6836 4 | 5 | probe kernel.function("do_sys_open").return { log($$return . $$parms) } 6 | -------------------------------------------------------------------------------- /testsuite/semok/three.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global b 4 | probe begin { 5 | a <<< 2; 6 | b[4] <<< 4; 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/semok/twentyeight.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # Make sure wildcards are handled 4 | probe kerne*.funct*("vfs_read").* {} 5 | -------------------------------------------------------------------------------- /testsuite/semok/twentyfive.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -e 4 | stap -p2 -e 'probe begin {foo$1$2$3}' # $-expansion only at token head 5 | stap -p2 -e 'probe $1 $2' 'syscall.open,begin' '{log ("hello\n")}' 6 | stap -p2 -e 'probe begin {@1 @2}' 'syscall.open,begin' '{log ("hello\n")}' 7 | stap -p2 -e 'probe begin {log (@1.@2)}' 'syscall.open,begin' '{log ("hello\n")}' 8 | 9 | -------------------------------------------------------------------------------- /testsuite/semok/twentyfour.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # read access to target variables should work in .return probes 4 | 5 | probe kernel.function("vfs_read").return 6 | { 7 | printf("count is %d\n", $count) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/semok/twentysix.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe begin,begin(10),end,end(10),error,error(10) 4 | { println (pp()) } 5 | -------------------------------------------------------------------------------- /testsuite/semok/twentythree.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global c, a = 1 4 | global b = "hello", d 5 | 6 | probe begin { print (c = a) print (d = b) } 7 | -------------------------------------------------------------------------------- /testsuite/semok/two.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | global bar, baz 4 | 5 | function koo (p) { 6 | baz [p, "p", p] ++; 7 | return p + 2; 8 | } 9 | 10 | probe end { 11 | bar = 2 + koo (4); 12 | foo = bar + koo; 13 | } 14 | -------------------------------------------------------------------------------- /testsuite/semok/utrace01.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | # process path doesn't need to be absolute 4 | probe process("cat").end { } 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/add.exp: -------------------------------------------------------------------------------- 1 | # Simple function to test that systemtap addition works 2 | 3 | set test "add" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/alias-condition.exp: -------------------------------------------------------------------------------- 1 | # Check that conditions are copied correctly across aliases 2 | 3 | set test "alias-condition" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/alias_tapset.stp: -------------------------------------------------------------------------------- 1 | probe tapset_test.foo { } 2 | 3 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/alias_tapset/tapset_test.stp: -------------------------------------------------------------------------------- 1 | global _reads 2 | 3 | probe tapset_test.foo = never { next } 4 | 5 | probe syscall.read { _reads++ } 6 | 7 | probe timer.s(5) { printf("%d\n", _reads) } 8 | 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/array_size.exp: -------------------------------------------------------------------------------- 1 | # Check that specifying an array size gives more room than MAXMAPENTRIES 2 | 3 | set test "array_size" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string -DMAXMAPENTRIES=1 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/backtrace.stp: -------------------------------------------------------------------------------- 1 | probe begin, end, procfs("foo").read, procfs("foo").write { log(pp()) print_backtrace() } 2 | probe timer.ms(100) { log(pp()) print_backtrace() exit() } 3 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/bad-code.stp: -------------------------------------------------------------------------------- 1 | // Testcase for PR14107 missing kernel asm CFI. 2 | probe kernel.function("force_sig_info") { 3 | if (pid() == target()) { 4 | print_ubacktrace() 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/be_order.exp: -------------------------------------------------------------------------------- 1 | # Simple function to test that ordering of begin/end probes works 2 | 3 | set test "be_order" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/bitfield.exp: -------------------------------------------------------------------------------- 1 | # test that bitfield r/w works correctly 2 | set test "bitfield" 3 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string -g 4 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/buildid.c: -------------------------------------------------------------------------------- 1 | #ifndef ONLY_MAIN 2 | foo () 3 | { 4 | int x = 1; 5 | label: 6 | x = 2; 7 | } 8 | #endif 9 | #ifndef NO_MAIN 10 | main () 11 | { 12 | foo(); 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/buildid.hex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jav/systemtap/2da355dd02a18bf4f67e2ceeb504b351b4bd5b83/testsuite/systemtap.base/buildid.hex -------------------------------------------------------------------------------- /testsuite/systemtap.base/buildid.stp: -------------------------------------------------------------------------------- 1 | probe process (@1).function("foo").label("label") 2 | {printf("x=%d\n",$x)} 3 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/bz10078.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | probe process("./bz10078").function("mkpoint*").return { 3 | printf("%s returns\n", probefunc()) 4 | } 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/bz10294.c: -------------------------------------------------------------------------------- 1 | int func_a(int a) 2 | { 3 | a = a + 1; 4 | return a; 5 | } 6 | 7 | 8 | int func_b(int b) 9 | { 10 | b = b + 2; 11 | return b; 12 | } 13 | 14 | int main() 15 | { 16 | int a; 17 | 18 | a = func_a(1); 19 | a = a + func_b(a); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/bz10294.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | probe process("./bz10294").statement("*@bz10294.c:10-10") { 3 | printf("ok") 4 | } 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/bz5274.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | ./bz5274 > ./bz5274.out 3 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/bz5274.stp: -------------------------------------------------------------------------------- 1 | #! /bin/env stap 2 | probe process("./bz5274").function("*").call { 3 | printf("%s Entering %s\n", pp(), thread_indent(1)) 4 | } 5 | probe process("./bz5274").function("*").return { 6 | printf("%s %s returns %s\n", pp(), thread_indent(-1), returnstr(2)) 7 | } 8 | 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/bz6503.stp: -------------------------------------------------------------------------------- 1 | probe module("jffs2").function("*").call ?, 2 | module("ext2").function("*").call ?, 3 | module("fat").function("*").call ?, 4 | module("vfat").function("*").call ?, 5 | never { } 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/bz6850.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | probe process("./bz6850").function("*").call { 3 | printf("%s called\n", probefunc()) 4 | } 5 | probe process("./bz6850").function("*").return { 6 | printf("%s returns\n", probefunc()) 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/bz6905.c: -------------------------------------------------------------------------------- 1 | int main() 2 | { 3 | int a; 4 | 5 | a = a + 1; 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/bz6905.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | probe process("./bz6905").statement("main@bz6905.c:*") { 3 | printf("ok") 4 | } 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/cast-user.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | struct sockaddr sa = { 5 | .sa_family = (sa_family_t) -1, 6 | .sa_data = 42, 7 | }; 8 | bind(-1, &sa, sizeof(sa)); 9 | return 0; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/cast.exp: -------------------------------------------------------------------------------- 1 | set test "cast" 2 | set ::result_string {PID OK 3 | PID2 OK 4 | PID3 OK 5 | execname OK 6 | usage OK} 7 | stap_run2 $srcdir/$subdir/$test.stp 8 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/const_value.stp: -------------------------------------------------------------------------------- 1 | probe process("const_value.exe").mark("constvalues") 2 | { 3 | printf("i: %d\n", $baz->i); 4 | printf("j: %d\n", $baz->j); 5 | printf("a: {%d, %d}\n", $a[0], $a[1]); 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/const_value_func.stp: -------------------------------------------------------------------------------- 1 | probe process("const_value_func.exe").mark("constvalues") 2 | { 3 | printf("f: %s\n", usymname($f)); 4 | } -------------------------------------------------------------------------------- /testsuite/systemtap.base/crash.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | crash --readnow << END 4 | mod -s testlog testlog.ko 5 | extend $1/staplog.so 6 | staplog testlog 7 | exit 8 | END 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/cu-decl-1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct foo; 4 | struct foo* get_foo(void); 5 | 6 | void 7 | print(struct foo* f) 8 | { 9 | printf("%p\n", f); 10 | } 11 | 12 | int 13 | main() 14 | { 15 | print(get_foo()); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/cu-decl-2.c: -------------------------------------------------------------------------------- 1 | struct foo { 2 | int x, y; 3 | }; 4 | 5 | struct foo* 6 | get_foo() 7 | { 8 | static struct foo f = { 6, 7 }; 9 | return &f; 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/deref.exp: -------------------------------------------------------------------------------- 1 | # Check that the deref mechanisms work correctly. 2 | 3 | set test "deref" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string -g 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/deref2.stp: -------------------------------------------------------------------------------- 1 | # PR 3331 2 | 3 | # It's just an ordinary function that returns a 4-byte signed value, 4 | # even on a 64-bit hosts. 5 | probe kernel.function("sock_alloc_fd").return { 6 | println ($return < 0 ? "neg" : "pos") 7 | } 8 | probe timer.s (5) { exit () } 9 | probe begin { println ("start") } 10 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/div0.exp: -------------------------------------------------------------------------------- 1 | # Simple function to test that systemtap divide by 0 doesn't kill the machine 2 | 3 | set test "div0" 4 | 5 | set output_string "(.*)division by 0 near(.*)" 6 | 7 | stap_run $srcdir/$subdir/$test.stp no_load $output_string 8 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/equal.exp: -------------------------------------------------------------------------------- 1 | # Simple function to test that equal operation works 2 | 3 | set test "equal" 4 | 5 | # better have a count other than zero to show that probe fired 6 | set output_string "count = \[1-9\]\[0-9\]*\r\ncount2 = \[1-9\]\[0-9\]*\r\nsystemtap test success\r\n" 7 | 8 | stap_run $srcdir/$subdir/$test.stp no_load $output_string 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/error_fn.exp: -------------------------------------------------------------------------------- 1 | # check that errors in nested functions are not lost on return 2 | # bugzilla 6529 3 | 4 | set test "error_fn" 5 | 6 | stap_run $srcdir/$subdir/$test.stp no_load ".*synthetic error.*" 7 | 8 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/flightrec2.stp: -------------------------------------------------------------------------------- 1 | probe timer.ms(10) 2 | { 3 | for (j = 0; j < 1000; j++) 4 | printf("1234567890\n") 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/flightrec3.stp: -------------------------------------------------------------------------------- 1 | probe kernel.function("update_process_times") 2 | { 3 | for (j = 0; j < 100; j++) 4 | printf("1234567890\n") 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/func_alias.c: -------------------------------------------------------------------------------- 1 | int main() { return 0; } 2 | extern int (*func_alias) __attribute__ ((alias ("main"))); 3 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/global_end2.stp: -------------------------------------------------------------------------------- 1 | probe begin { 2 | qsq_start("test") 3 | qs_wait("test") 4 | qs_run("test") 5 | qs_done("test") 6 | log(sprintf("Avg time = %d", qsq_service_time("test", 1))) 7 | exit() 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/global_init.exp: -------------------------------------------------------------------------------- 1 | # Check that global variables are initialized before all begin probes 2 | 3 | set test "global_init" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/global_var_distance.c: -------------------------------------------------------------------------------- 1 | static int value; 2 | 3 | void setdistance(int v) { value = v; } 4 | int getdistance() { return value; } 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/global_var_kernel.stp: -------------------------------------------------------------------------------- 1 | # Test the correct kernel/time.c CU is selected. 2 | probe syscall.open 3 | { 4 | log("systemtap starting probe"); 5 | log("systemtap ending probe"); 6 | printf("sys_tz = %s\n", @var("sys_tz@kernel/time.c")$$); 7 | exit(); 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/global_var_speed.c: -------------------------------------------------------------------------------- 1 | static int value; 2 | 3 | void setspeed(int v) { value = v; } 4 | int getspeed() { return value; } 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/global_vars.exp: -------------------------------------------------------------------------------- 1 | # Check that global variables terminated with a ; work fine 2 | 3 | set test "global_vars" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/gtod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | stap $1 -c "$2 $3" | sort 4 | 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/gtod.stp: -------------------------------------------------------------------------------- 1 | global count = 0 2 | 3 | probe syscall.setsid { 4 | if (pid() == target()) { 5 | printf("%014d :%02d kern\n", gettimeofday_us(), count); 6 | count ++; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/hash_add_buildid1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | printf("hello world\n"); 6 | return 0; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/hash_add_buildid2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | printf("world hello\n"); 6 | return 0; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/if.exp: -------------------------------------------------------------------------------- 1 | # Simple function to test that systemtap can generate a kernel module that 2 | # instruments a function, install it, and get some output. 3 | 4 | set test "if" 5 | 6 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/inc.exp: -------------------------------------------------------------------------------- 1 | # Simple function to test that systemtap ++ works 2 | 3 | set test "inc" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/inlinedvars.stp: -------------------------------------------------------------------------------- 1 | probe process("inlinedvars.exe").function("m").label("inlined_label") 2 | { 3 | printf("%s (%d,%d)\n", user_string($p_name), $p_i, $p_j); 4 | } 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/ipaddr.txt: -------------------------------------------------------------------------------- 1 | line1 2 | this is line2 3 | this might be line3 4 | line4 reporting! 5 | line5 6 | line6 this must be 7 | line7... 8 | this is the 8th line of text 9 | line9 10 | line10! done! 11 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/jennie.c: -------------------------------------------------------------------------------- 1 | int main (int argc, char *argv[]) 2 | { 3 | if (argc > 1) main (argc - 1, argv); 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/kprobes.exp: -------------------------------------------------------------------------------- 1 | set test "kprobes" 2 | stap_run $srcdir/$subdir/$test.stp no_load "probe point hit" 3 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/kretprobe-vars.exp: -------------------------------------------------------------------------------- 1 | # Check that implicitly-saved $target variables have the same 2 | # value as those manually saved on entry. 3 | set test "kretprobe-vars" 4 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string -c "cat /dev/null" 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/logical_and.exp: -------------------------------------------------------------------------------- 1 | # Simple function to test that systemtap logial and works 2 | 3 | set test "logical_and" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/modargs.stp: -------------------------------------------------------------------------------- 1 | 2 | global initializedname="bar" 3 | global initializednumber=0 4 | global name 5 | global number 6 | 7 | probe begin 8 | { 9 | printf ("initializedname=%s initializednumber=%d name=%s number=%d", initializedname, initializednumber, name, number); 10 | exit(); 11 | } 12 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/not.exp: -------------------------------------------------------------------------------- 1 | # Simple function to test that systemtap binary not works 2 | 3 | set test "not" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/optim.stp: -------------------------------------------------------------------------------- 1 | global array 2 | function func(i) { 3 | array[i++] = 0; 4 | return i; 5 | } 6 | function bart() { # rhbz# 300121 7 | if (1) var=2 else dummy=0 8 | return var 9 | } 10 | probe begin { 11 | printf ("i=%d\n", func(0)) 12 | printf ("j=%d\n", bart()) 13 | exit () 14 | } 15 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/optim_voidstmt.exp: -------------------------------------------------------------------------------- 1 | # Make sure that optimization works with void statements 2 | 3 | set test "optim_voidstmt" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string -w -g 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/optionalprobe.exp: -------------------------------------------------------------------------------- 1 | set test "optionalprobe" 2 | spawn stap -p2 -w $srcdir/$subdir/$test.stp 3 | expect { 4 | -timeout 120 5 | -re "# probes\r\n" { exp_continue } 6 | -re "^begin" { pass $test } 7 | eof { fail $test } 8 | timeout { fail "$test unexpected timeout" } 9 | } 10 | catch {close}; catch {wait} 11 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/overcatcher.exp: -------------------------------------------------------------------------------- 1 | # make sure that we don't overcatch -- return and next should be able to break 2 | # out of a try/catch block. PR11664 3 | 4 | set test "overcatcher" 5 | set ::result_string {return 6 | next 7 | } 8 | 9 | stap_run_exact $test $srcdir/$subdir/$test.stp 10 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/pr13306.stp: -------------------------------------------------------------------------------- 1 | probe begin { error("look out") } 2 | probe timer.profile { error("the sky is falling!") } 3 | probe timer.s(4) { exit() } 4 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/print.exp: -------------------------------------------------------------------------------- 1 | # Test that all the print statements work 2 | 3 | set test "print" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/process_by_cmd.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "sys/sdt.h" 3 | 4 | void third(){} 5 | void second(){third();} 6 | void first(){second();} 7 | 8 | int main() 9 | { 10 | l1: 11 | STAP_PROBE(process_by_cmd, main_start); 12 | first(); 13 | STAP_PROBE(process_by_cmd, main_end); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/prologues.stp: -------------------------------------------------------------------------------- 1 | # These sys_ functions often display prologue sensitivity 2 | probe syscall.read, syscall.write { 3 | printf("%s (%s)\n", name, argstr) 4 | if (num++ > 20) exit() 5 | } 6 | global num 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/ptridx.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static void 4 | foo (int *p) 5 | { 6 | l1: 7 | printf ("%d, %d\n", p[0], p[1]); 8 | } 9 | 10 | int main (void) 11 | { 12 | int a[] = { 17, 23 }; 13 | l1: 14 | foo (a); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/rand.exp: -------------------------------------------------------------------------------- 1 | set test "rand" 2 | set ::result_string {PASS} 3 | stap_run2 $srcdir/$subdir/$test.stp 4 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/remote.stp: -------------------------------------------------------------------------------- 1 | probe begin, end { 2 | println(pp(), remote_id(), ":", remote_uri()) 3 | } 4 | 5 | probe timer.s(30) { 6 | println("timeout!") 7 | exit() 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/rep_ret.c: -------------------------------------------------------------------------------- 1 | // Use -fomit-frame-pointer so this doesn't blow the stack 2 | void rep_ret() { asm("rep; ret"); } // uprobes allowed 3 | void repnz_ret() { asm("repnz; ret"); } // NOT allowed 4 | int main() { rep_ret(); repnz_ret(); return 0; } 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/rlimit.stp: -------------------------------------------------------------------------------- 1 | probe kernel.function("*ar*").call { println($$vars) } 2 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/sdt_misc_.d: -------------------------------------------------------------------------------- 1 | provider sdt_misc { 2 | probe test_probe_0 (); 3 | probe test_probe_1 (int i); 4 | probe test_probe_2 (int i); 5 | probe test_probe_3 (int i, char* x); 6 | probe test_probe_4 (struct astruct arg); 7 | }; 8 | struct astruct {int a; int b;}; 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/set_kernel.exp: -------------------------------------------------------------------------------- 1 | # Check that the set_kernel_* functions work correctly. 2 | 3 | set test "set_kernel" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string -g 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/simple.stp: -------------------------------------------------------------------------------- 1 | /* 2 | * simple.stp 3 | * 4 | * Very simple function to test that systemtap can generate a kernel module, 5 | * install it, and get some output. 6 | */ 7 | 8 | probe begin 9 | { 10 | println("systemtap starting probe") 11 | } 12 | 13 | probe end 14 | { 15 | println("systemtap ending probe") 16 | } 17 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/sysroot_sysenv.stp: -------------------------------------------------------------------------------- 1 | probe process(@1).begin { 2 | println("process begin") 3 | } 4 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/tapset/alias.stp: -------------------------------------------------------------------------------- 1 | probe test_alias = end { 2 | alias_local = 1 3 | } 4 | probe begin { 5 | println("included alias") 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/tapset/function.stp: -------------------------------------------------------------------------------- 1 | function test_function:long() { 2 | return 1 3 | } 4 | probe begin { 5 | println("included function") 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/tapset/global.stp: -------------------------------------------------------------------------------- 1 | global test_global = 1 2 | probe begin { 3 | println("included global") 4 | } 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/tracescripts.exp: -------------------------------------------------------------------------------- 1 | set stap_path $env(SYSTEMTAP_PATH)/stap 2 | 3 | exec echo "#!$stap_path" > tracescripts.sh 4 | 5 | if {[catch {exec stap -L {process("tracescripts.sh").mark("*")}} res]} { 6 | fail "tracescripts $res" 7 | } else { 8 | pass "tracescripts" 9 | } 10 | 11 | catch {exec rm -f tracescripts.sh} 12 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/tri.exp: -------------------------------------------------------------------------------- 1 | # Simple function to test that systemtap ?: operation works 2 | 3 | set test "tri" 4 | 5 | stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/uprobes.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | probe process("./jennie").function("main").call { printf("%s %s\n",pp(),$$parms) } 3 | probe process("./jennie").function("main").return { printf("%s %s\n",pp(),$$return) } 4 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/uprobes_call.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | probe process("./jennie").function("main").call { printf("%s %s\n",pp(),$$parms) } 3 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/uprobes_return.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | probe process("./jennie").function("main").return { printf("%s %s\n",pp(),$$return) } 3 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/vta-test.stp: -------------------------------------------------------------------------------- 1 | probe process(@1).mark("t?") { 2 | printf("a: {%d, %d}\n", $a[0], $a[1]); 3 | printf("i: 0x%x\n", $c->i); 4 | } 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/wakeup.stp: -------------------------------------------------------------------------------- 1 | global count; 2 | probe kernel.function("__wake_up_common") 3 | { 4 | count++ 5 | if (count <= 8) 6 | { system("echo sleeping") } 7 | else if (count <= 16) 8 | { warn("wake_up") } 9 | else if (count <= 24) 10 | { error("wake_down") } 11 | else 12 | { printf("count: %d\n", count); exit() } 13 | } 14 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/warn_overflow.stp: -------------------------------------------------------------------------------- 1 | global i; 2 | probe begin {while (++i < 128) warn("begin..."); log("stap_begin");} 3 | 4 | probe syscall.* {system("echo syscall: " . name); 5 | if (++i == 256) { log("stap_syscall"); exit(); }} 6 | 7 | probe end {while (--i > 0) warn("end..."); log("stap_end");} 8 | -------------------------------------------------------------------------------- /testsuite/systemtap.base/x86_gs.stp: -------------------------------------------------------------------------------- 1 | #! stap 2 | 3 | # test x86 gs register 4 | 5 | probe begin { 6 | if (!_stp_regs_registered) 7 | _stp_register_regs() 8 | printf("%d\n",test_x86_gs() * 100 + _reg_offsets["gs"]) /* 0 or 140 */ 9 | exit() 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/systemtap.clone/Makefile.probe_by_pid: -------------------------------------------------------------------------------- 1 | override CFLAGS += -g -O2 2 | 3 | OBJS := probe_by_pid.o 4 | 5 | TARGETS := probe_by_pid 6 | 7 | all: $(TARGETS) 8 | 9 | $(TARGETS): $(OBJS) 10 | 11 | clean: 12 | rm -f $(OBJS) $(TARGETS) $(BUILT_SOURCES) 13 | -------------------------------------------------------------------------------- /testsuite/systemtap.clone/dtrace_child_probes.d: -------------------------------------------------------------------------------- 1 | provider child { 2 | probe main(pid_t pid); 3 | }; 4 | -------------------------------------------------------------------------------- /testsuite/systemtap.clone/dtrace_clone_probes.d: -------------------------------------------------------------------------------- 1 | provider test { 2 | probe main(pid_t pid); 3 | probe main2(); 4 | probe child1(pid_t pid); 5 | probe child1_pid(pid_t pid); 6 | probe child2(pid_t pid); 7 | probe child2_pid(pid_t pid); 8 | }; 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.clone/dtrace_fork_parent_probes.d: -------------------------------------------------------------------------------- 1 | provider parent { 2 | probe main(pid_t pid); 3 | probe child(pid_t pid); 4 | probe child_pid(pid_t pid); 5 | probe finished(); 6 | }; 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.clone/dtrace_vfork_parent_probes.d: -------------------------------------------------------------------------------- 1 | provider parent { 2 | probe main(pid_t pid); 3 | probe child_pid(pid_t pid); 4 | probe finished(); 5 | }; 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.clone/probe_by_pid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void test_function(void) 5 | { 6 | sleep(1); 7 | (void) getpid(); 8 | } 9 | 10 | int main(void) 11 | { 12 | while (1) { 13 | test_function(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /testsuite/systemtap.context/makefile1: -------------------------------------------------------------------------------- 1 | obj-m := systemtap_test_module1.o 2 | KDIR := /lib/modules/$(shell uname -r)/build 3 | PWD := $(shell pwd) 4 | default: 5 | $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules 6 | clean: 7 | rm -f *.mod.c systemtap_test_module1.ko *.o .*.cmd Modules.symvers 8 | rm -rf .tmp_versions 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.context/makefile2: -------------------------------------------------------------------------------- 1 | obj-m := systemtap_test_module2.o 2 | KDIR := /lib/modules/$(shell uname -r)/build 3 | PWD := $(shell pwd) 4 | default: 5 | $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules 6 | clean: 7 | rm -f *.mod.c systemtap_test_module2.ko *.o .*.cmd Modules.symvers 8 | rm -rf .tmp_versions 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.context/uprobe_stmt_num.stp: -------------------------------------------------------------------------------- 1 | probe process("uprobe_stmt_num").statement("func@uprobe_stmt_num.c:*") 2 | { 3 | printf("0x%x\n", uaddr()); 4 | } 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.examples/general/click.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jav/systemtap/2da355dd02a18bf4f67e2ceeb504b351b4bd5b83/testsuite/systemtap.examples/general/click.wav -------------------------------------------------------------------------------- /testsuite/systemtap.examples/general/helloworld.stp: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env stap 2 | probe begin { println("hello world") exit () } 3 | -------------------------------------------------------------------------------- /testsuite/systemtap.examples/general/return.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jav/systemtap/2da355dd02a18bf4f67e2ceeb504b351b4bd5b83/testsuite/systemtap.examples/general/return.wav -------------------------------------------------------------------------------- /testsuite/systemtap.examples/html/systemtapcorner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jav/systemtap/2da355dd02a18bf4f67e2ceeb504b351b4bd5b83/testsuite/systemtap.examples/html/systemtapcorner.gif -------------------------------------------------------------------------------- /testsuite/systemtap.examples/html/systemtaplogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jav/systemtap/2da355dd02a18bf4f67e2ceeb504b351b4bd5b83/testsuite/systemtap.examples/html/systemtaplogo.png -------------------------------------------------------------------------------- /testsuite/systemtap.examples/io/inodewatch.stp: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env stap 2 | 3 | probe vfs.write, vfs.read 4 | { 5 | # dev and ino are defined by vfs.write and vfs.read 6 | if (dev == MKDEV($1,$2) # major/minor device 7 | && ino == $3) 8 | printf ("%s(%d) %s 0x%x/%u\n", 9 | execname(), pid(), probefunc(), dev, ino) 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/systemtap.examples/io/mbrwatch.stp: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env stap 2 | 3 | probe ioblock.request { 4 | if (bdev==bdev_contains && sector<4) { 5 | printf("device %s sector %d %s, process %s[%d]\n", 6 | devname, sector, (rw==BIO_READ ? "read":"write"), execname(), pid()) 7 | print_backtrace() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/systemtap.examples/memory/hw_watch_addr.stp: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env stap 2 | probe kernel.data($1).rw 3 | { 4 | printf("%p value is accessed\n", $1); 5 | print_backtrace(); 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.examples/memory/hw_watch_sym.stp: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env stap 2 | probe kernel.data(@1).rw 3 | { 4 | printf("%s value is accessed\n", @1); 5 | print_backtrace(); 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.examples/memory/overcommit.stp: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env stap 2 | 3 | probe kernel.function("__vm_enough_memory").return { 4 | if ($return != 0) { 5 | printf("overcommit blocked malloc, process %s (%d), %d pages\n", 6 | execname(), pid(), $pages) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.examples/network/socket-trace.stp: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env stap 2 | 3 | probe kernel.function("*@net/socket.c").call { 4 | printf ("%s -> %s\n", thread_indent(1), probefunc()) 5 | } 6 | probe kernel.function("*@net/socket.c").return { 7 | printf ("%s <- %s\n", thread_indent(-1), probefunc()) 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.exelib/cleanup.tcl: -------------------------------------------------------------------------------- 1 | # Remove exes, libs and (possible) separate .debug files 2 | catch {exec rm -f $testexe ${testexe}.debug} 3 | catch {exec rm -f $testlib ${testlib}.debug} 4 | -------------------------------------------------------------------------------- /testsuite/systemtap.exelib/mark.stp: -------------------------------------------------------------------------------- 1 | // Markers probes in executable and shared library plus argument. 2 | // Arguments: @1 uprobes_exe, @2 libuprobes_lib.so 3 | 4 | probe process(@1).mark("main_count") { 5 | printf("main_count: %d\n", $arg1); 6 | } 7 | 8 | probe process(@2).mark("func_count") { 9 | printf("func_count: %d\n", $arg1); 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/systemtap.maps/hist_in_string.exp: -------------------------------------------------------------------------------- 1 | # test histogram printed to string 2 | 3 | set test "hist_in_string" 4 | set ::result_string {value |-------------------------------------------------- count 5 | 0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 128 6 | } 7 | 8 | stap_run2 $srcdir/$subdir/$test.stp 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.maps/hist_in_string.stp: -------------------------------------------------------------------------------- 1 | global l 2 | 3 | probe begin 4 | { 5 | for (i = 0; i < 128; i++) 6 | l <<< 0 7 | 8 | print(sprint(@hist_linear(l, 0, 0, 1))) 9 | exit() 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/systemtap.maps/ix_clear.stp: -------------------------------------------------------------------------------- 1 | #test of int maps containing stats 2 | 3 | global foo 4 | 5 | probe begin { 6 | foo[1] <<< 1 7 | printf("foo[1] = %d %d\n", @count(foo[1]), @min(foo[1])) 8 | delete foo[1] 9 | } 10 | 11 | probe timer.ms(1000) { exit() } 12 | 13 | probe end { 14 | printf("foo[1] = %d %d\n", @count(foo[1]), @min(foo[1])) 15 | } 16 | -------------------------------------------------------------------------------- /testsuite/systemtap.maps/ix_clear2.stp: -------------------------------------------------------------------------------- 1 | # test clearing pmaps 2 | 3 | global foo 4 | 5 | probe begin { 6 | foo[1] <<< 1 7 | printf("foo[1] = %d %d\n", @count(foo[1]), @min(foo[1])) 8 | delete foo 9 | } 10 | 11 | probe timer.ms(1000) { exit() } 12 | 13 | probe end { 14 | printf("foo[1] = %d %d\n", @count(foo[1]), @min(foo[1])) 15 | } 16 | 17 | -------------------------------------------------------------------------------- /testsuite/systemtap.maps/ix_clear3.stp: -------------------------------------------------------------------------------- 1 | # test uninitialized pmap element 2 | 3 | global foo 4 | 5 | probe begin { 6 | foo[1] <<< 1 7 | printf("foo[2] = %d %d\n", @count(foo[2]), @min(foo[2])) 8 | exit() 9 | } 10 | 11 | -------------------------------------------------------------------------------- /testsuite/systemtap.maps/ix_hist.stp: -------------------------------------------------------------------------------- 1 | # test of int maps containing stats 2 | 3 | global foo 4 | 5 | probe begin { 6 | for (i=0;i<5;i++) 7 | for (j=0;ji; 16 | } 17 | 18 | int main() 19 | { 20 | return func (&S1); 21 | } 22 | -------------------------------------------------------------------------------- /testsuite/systemtap.pass1-4/debugtypes.stp: -------------------------------------------------------------------------------- 1 | #! stap -p2 2 | 3 | probe process("debugtypes.exe").function("func") { 4 | println($p->l) 5 | println(@cast($p, "struct s1")->l) 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.pass1-4/parseok.exp: -------------------------------------------------------------------------------- 1 | set self parseok 2 | foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { 3 | set test $self/[file tail $file] 4 | verbose -log "Running $file" 5 | set rc [stap_run_batch $file] 6 | if {$rc == 0} { pass $test } else { fail $test } 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/systemtap.pass1-4/transok.exp: -------------------------------------------------------------------------------- 1 | set self transok 2 | foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { 3 | set test $self/[file tail $file] 4 | verbose -log "Running $file" 5 | set rc [stap_run_batch $file] 6 | if {$rc == 0} { pass $test } else { fail $test } 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/basic1.exp: -------------------------------------------------------------------------------- 1 | set test "basic1" 2 | set ::result_string {HelloWorld} 3 | stap_run2 $srcdir/$subdir/$test.stp 4 | stap_run2 $srcdir/$subdir/$test.stp -DSTP_LEGACY_PRINT 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/basic1.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | printf("Hello"); 4 | printf("World"); 5 | exit() 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/basic2.exp: -------------------------------------------------------------------------------- 1 | set test "basic2" 2 | set ::result_string {HelloWorld} 3 | stap_run2 $srcdir/$subdir/$test.stp 4 | stap_run2 $srcdir/$subdir/$test.stp -DSTP_LEGACY_PRINT 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/basic2.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | printf("Hello"); 4 | print("World"); 5 | exit() 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/basic3.exp: -------------------------------------------------------------------------------- 1 | set test "basic3" 2 | set ::result_string {Hello 3 | World} 4 | stap_run2 $srcdir/$subdir/$test.stp 5 | stap_run2 $srcdir/$subdir/$test.stp -DSTP_LEGACY_PRINT 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/basic3.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | printf("Hello\n"); 4 | print("World\n"); 5 | exit() 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/basic4.exp: -------------------------------------------------------------------------------- 1 | set test "basic4" 2 | set ::result_string {HelloWorldHelloWorld} 3 | stap_run2 $srcdir/$subdir/$test.stp 4 | stap_run2 $srcdir/$subdir/$test.stp -DSTP_LEGACY_PRINT 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/basic4.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | printf("Hello"); 4 | printf("World"); 5 | exit() 6 | } 7 | probe end 8 | { 9 | printf("Hello"); 10 | printf("World"); 11 | exit() 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/basic5.exp: -------------------------------------------------------------------------------- 1 | set test "basic5" 2 | set ::result_string {HelloWorldHelloWorld} 3 | stap_run2 $srcdir/$subdir/$test.stp 4 | stap_run2 $srcdir/$subdir/$test.stp -DSTP_LEGACY_PRINT 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/basic6.exp: -------------------------------------------------------------------------------- 1 | set test "basic6" 2 | set ::result_string {Hello%World} 3 | stap_run2 $srcdir/$subdir/$test.stp 4 | stap_run2 $srcdir/$subdir/$test.stp -DSTP_LEGACY_PRINT 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/basic6.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | printf("Hello%%World"); 4 | exit() 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/bin1.exp: -------------------------------------------------------------------------------- 1 | set test "bin1" 2 | set ::result_string {42 } 3 | stap_run_binary $srcdir/$subdir/$test.stp 4 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/bin1.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | printf("%1b", 0x42) 4 | exit() 5 | } 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/bin2.exp: -------------------------------------------------------------------------------- 1 | set test "bin2" 2 | set ::result_string {12 34 56 78 12 34 56 78 3 | 61 3d 12 20 62 3d 34 20 4 | 63 3d 56 20 64 3d 78 } 5 | 6 | stap_run_binary $srcdir/$subdir/$test.stp 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/bin2.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | printf("%1b", 0x12) 4 | printf("%1b", 0x34) 5 | printf("%1b%1b", 0x56, 0x78) 6 | a = 0x12 7 | b = 0x34 8 | c = 0x56 9 | d = 0x78 10 | printf("%1b%1b%1b%1b", a, b, c, d) 11 | printf("a=%1b b=%1b c=%1b d=%1b",a,b,c,d) 12 | exit() 13 | } 14 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/bin3.exp: -------------------------------------------------------------------------------- 1 | set ::result_string {00 12 00 34 ab cd 56 78 2 | 56 78 ab cd 88 88 cd ef 3 | 61 3d 56 78 20 62 3d ab 4 | cd 20 63 3d 88 88 20 64 5 | 3d cd ef } 6 | 7 | set test "bin3" 8 | stap_run_binary $srcdir/$subdir/$test.stp 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/bin4.exp: -------------------------------------------------------------------------------- 1 | set ::result_string {00 00 00 12 00 00 00 34 2 | ab cd ef 00 00 00 56 78 3 | 12 34 56 78 11 11 22 22 4 | 88 88 99 99 cd ef 00 00 5 | 61 3d 12 34 56 78 20 62 6 | 3d 11 11 22 22 20 63 3d 7 | 88 88 99 99 20 64 3d cd 8 | ef 00 00 } 9 | 10 | set test "bin4" 11 | stap_run_binary $srcdir/$subdir/$test.stp 12 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/char1.exp: -------------------------------------------------------------------------------- 1 | set test "char1" 2 | set ::result_string {stapok} 3 | stap_run2 $srcdir/$subdir/$test.stp 4 | stap_run2 $srcdir/$subdir/$test.stp -DSTP_LEGACY_PRINT 5 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/char1.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | printf("%c", 115) 4 | printf("%c", 116) 5 | printf("%c%c", 97, 112) 6 | printf("%c%c", stringat("ok", 0), stringat("ok", 1)) 7 | print("\n") 8 | exit() 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/char2.exp: -------------------------------------------------------------------------------- 1 | set test "char2" 2 | set ::result_string {abc-ABC 123! 3 | \a\b\f\n\r\t\v\'\\ 4 | \000\033\177\222\333\377} 5 | 6 | stap_run2 $srcdir/$subdir/$test.stp 7 | stap_run2 $srcdir/$subdir/$test.stp -DSTP_LEGACY_PRINT 8 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/hello.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | printf("Hello"); 4 | printf("World"); 5 | exit() 6 | } 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/hello2.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | print("Print"); 4 | println("Systemtap"); 5 | warn("warning"); 6 | exit() 7 | } 8 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/memory1.exp: -------------------------------------------------------------------------------- 1 | set test "memory1" 2 | set ::result_string {Test passed} 3 | 4 | # make sure we run some dummy workload, so the script doesn't block 5 | # forever waiting for an open syscall 6 | stap_run2 $srcdir/$subdir/$test.stp -w -c "/bin/sh < /dev/null" 7 | stap_run2 $srcdir/$subdir/$test.stp -w -c "/bin/sh < /dev/null" -DSTP_LEGACY_PRINT 8 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/oct.exp: -------------------------------------------------------------------------------- 1 | set test "oct" 2 | set ::result_string {10 01 02 03 04 05 06 07 3 | 08 09 0a 0b 0c 0d 0e 0f 4 | 10 11 12 13 14 15 16 17 5 | 18 19 1a 1b 1c 1d 1e 1f} 6 | stap_run_binary $srcdir/$subdir/$test.stp 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/oct.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | printf("\020\01\02\03\04\05\06\07") 4 | printf("\010\011\012\013\014\015\016\017") 5 | printf("\020\021\022\023\024\025\026\027") 6 | printf("\030\031\032\033\034\035\036\037") 7 | exit() 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/out1.stp: -------------------------------------------------------------------------------- 1 | # output "large_output" pattern using printf. 2 | 3 | # This should detect any problems in the printf code, output 4 | # buffers or transport. 5 | 6 | probe begin 7 | { 8 | for (j = 0; j < 3000; j++) 9 | printf("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\n") 10 | exit() 11 | } 12 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/out2.stp: -------------------------------------------------------------------------------- 1 | # output "large_output" pattern using print. 2 | 3 | # This should detect any problems in the print code, output 4 | # buffers or transport. 5 | 6 | probe begin 7 | { 8 | for (j = 0; j < 3000; j++) 9 | print("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\n") 10 | exit() 11 | } 12 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/pretty-bits.exp: -------------------------------------------------------------------------------- 1 | set test "pretty-bits" 2 | set ::result_string {{.a=0, .b=1, .c=1, .d=2, .e=3, .f=5, .g=8, .h=13}} 3 | 4 | set script $srcdir/$subdir/$test.stp 5 | set header [fullpath $srcdir/$subdir/$test.h] 6 | 7 | stap_run2 $script kernel<$header> -g 8 | stap_run2 $script kernel<$header> -g -DSTP_LEGACY_PRINT 9 | 10 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/pretty-bits.h: -------------------------------------------------------------------------------- 1 | struct pretty_bits { 2 | signed char a:4, b:4; 3 | unsigned char c:4, d:4; 4 | signed int e:4, f:4; 5 | unsigned int g:4, h:4; 6 | }; 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/pretty-char.exp: -------------------------------------------------------------------------------- 1 | set test "pretty-char" 2 | set ::result_string {{.a='A', .b='\000', .c='\b', .d='\354', .e='z'}} 3 | 4 | set script $srcdir/$subdir/$test.stp 5 | set header [fullpath $srcdir/$subdir/$test.h] 6 | 7 | stap_run2 $script kernel<$header> -g 8 | stap_run2 $script kernel<$header> -g -DSTP_LEGACY_PRINT 9 | 10 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/pretty-char.h: -------------------------------------------------------------------------------- 1 | struct pretty_chars { char a, b, c, d, e; }; 2 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/print.exp: -------------------------------------------------------------------------------- 1 | set test "print" 2 | set ::result_string {hello world 3 | 777 4 | hello world 5 | hello world 6 | foo 7 | foobar 8 | foobar 9 | foobar 10 | foo99 11 | 99foo 12 | 777 13 | 888 14 | 123456789 15 | hello999 16 | 999hello} 17 | stap_run2 $srcdir/$subdir/$test.stp 18 | stap_run2 $srcdir/$subdir/$test.stp -DSTP_LEGACY_PRINT 19 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/print_char.exp: -------------------------------------------------------------------------------- 1 | set test "print_char" 2 | set ::result_string {ABC 3 | ABCDEFGHIJKLMNOPQRSTUVWXYZ} 4 | stap_run2 $srcdir/$subdir/$test.stp 5 | stap_run2 $srcdir/$subdir/$test.stp -DSTP_LEGACY_PRINT 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/print_char.stp: -------------------------------------------------------------------------------- 1 | # test the print_char function 2 | 3 | probe begin { 4 | endl = 10 5 | print_char(65) 6 | print_char(66) 7 | print_char(67) 8 | print_char(endl) 9 | 10 | for (i = 65; i < 91; i++) 11 | print_char(i) 12 | print_char(endl) 13 | 14 | 15 | exit() 16 | } 17 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/println.exp: -------------------------------------------------------------------------------- 1 | set test "println" 2 | set ::result_string {hello 3 | 4 | world 5 | 777 6 | hello world 7 | hello world 8 | foo 9 | foobar 10 | foobar 11 | 777 12 | foo99 13 | 99foo 14 | 123456789 15 | hello999 16 | 999hello} 17 | stap_run2 $srcdir/$subdir/$test.stp 18 | stap_run2 $srcdir/$subdir/$test.stp -DSTP_LEGACY_PRINT 19 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/sharedbuf.stp: -------------------------------------------------------------------------------- 1 | probe begin { 2 | printf("Host: begin\n") 3 | } 4 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/string1.exp: -------------------------------------------------------------------------------- 1 | set test "string1" 2 | set ::result_string {The string is 3 | Foobar!XYZZY 4 | XYZZYFoobar!XYZZYFoobar!} 5 | stap_run2 $srcdir/$subdir/$test.stp 6 | stap_run2 $srcdir/$subdir/$test.stp -DSTP_LEGACY_PRINT 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/string1.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | s = "Foobar!" 4 | printf("The string is <%s>\n", s); 5 | t = "XYZZY" 6 | printf("%s%s\n",s,t); 7 | printf("%s%s%s%s\n",t,s,t,s); 8 | exit() 9 | } 10 | -------------------------------------------------------------------------------- /testsuite/systemtap.printf/string2.stp: -------------------------------------------------------------------------------- 1 | probe begin 2 | { 3 | # 50 chars 4 | s = "12345678901234567890123456789012345678901234567890" 5 | # 100 chars 6 | t = s.s 7 | printf("s is <%s>\n", s); 8 | printf("t is <%s>\n", t); 9 | for (i = 0; i < 100; i++) 10 | printf("%2d: %s\n", i, t); 11 | exit() 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/systemtap.server/hello.stp: -------------------------------------------------------------------------------- 1 | #! stap -p5 2 | 3 | probe begin 4 | { 5 | printf("Hello "); 6 | printf("From Server\n"); 7 | exit() 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/systemtap.server/test.stp: -------------------------------------------------------------------------------- 1 | probe begin { exit (); } 2 | -------------------------------------------------------------------------------- /testsuite/systemtap.server/uprobes.stp: -------------------------------------------------------------------------------- 1 | #! stap -p4 2 | probe process.function("main").call { printf("%s %s\n",pp(),$$parms) } 3 | probe process.function("main").return { printf("%s %s\n",pp(),$$return) } 4 | -------------------------------------------------------------------------------- /testsuite/systemtap.string/dot.exp: -------------------------------------------------------------------------------- 1 | set test "sprint" 2 | set ::result_string {hello 3 | helloworld 4 | 12345678 5 | 0 6 | 100 7 | -42 8 | 66} 9 | stap_run2 $srcdir/$subdir/$test.stp 10 | -------------------------------------------------------------------------------- /testsuite/systemtap.string/isinstr.exp: -------------------------------------------------------------------------------- 1 | set test "isinstr" 2 | set ::result_string {"foo" is in "abcfoobad" 3 | "foo" is NOT in "abcdefg" 4 | "" is in ""} 5 | stap_run2 $srcdir/$subdir/$test.stp 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.string/sprint.exp: -------------------------------------------------------------------------------- 1 | set test "dot" 2 | set ::result_string {helloworld 3 | helloworld 4 | EQUAL 5 | EQUAL 6 | hello-world helloworld FOO helloworld} 7 | stap_run2 $srcdir/$subdir/$test.stp 8 | -------------------------------------------------------------------------------- /testsuite/systemtap.string/strlen.exp: -------------------------------------------------------------------------------- 1 | set test "strlen" 2 | set ::result_string {strlen("") = 0 3 | strlen("1") = 1 4 | strlen("0123456789") = 10 5 | strlen("012345678901234567890123456789012345678901234567890123456789012") = 63} 6 | stap_run2 $srcdir/$subdir/$test.stp -DMAXSTRINGLEN=64 7 | -------------------------------------------------------------------------------- /testsuite/systemtap.string/strtol.exp: -------------------------------------------------------------------------------- 1 | set test "strtol" 2 | set ::result_string {1 3 | -1 4 | 123456789 5 | -123456789 6 | 0 7 | 1 8 | 0 9 | 0 10 | 1000 11 | 4096 12 | 512 13 | 8} 14 | stap_run2 $srcdir/$subdir/$test.stp 15 | -------------------------------------------------------------------------------- /testsuite/systemtap.string/substr.exp: -------------------------------------------------------------------------------- 1 | set test "substr" 2 | set ::result_string {Hello World! 3 | 0,0: 4 | -1,10: 5 | 10,0: 6 | 0,1: H 7 | 1,1: e 8 | 2,1: l 9 | 2,5: llo W 10 | 6,1: W 11 | 11,1: ! 12 | 11,100: ! 13 | 12,1: 14 | 0,10: Hello Worl 15 | 0,100: Hello World! 16 | 0,100000: Hello World!} 17 | stap_run2 $srcdir/$subdir/$test.stp 18 | -------------------------------------------------------------------------------- /testsuite/systemtap.syscall/acct.c: -------------------------------------------------------------------------------- 1 | /* COVERAGE: acct */ 2 | #include 3 | 4 | int main() 5 | { 6 | acct("foobar"); 7 | //staptest// acct ("foobar") = -NNNN 8 | 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/systemtap.unprivileged/delayedkill: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Wait for the specified number of seconds, then kill the given pid 4 | sleep $2 5 | kill $1 6 | -------------------------------------------------------------------------------- /testsuite/systemtap.unprivileged/libfoo.c: -------------------------------------------------------------------------------- 1 | #include "sys/sdt.h" 2 | 3 | inline void ilibfoofunc (void) { 4 | STAP_PROBE(_test_, ilibfoofunc_enter); 5 | } 6 | 7 | void libfoofunc (void) { 8 | STAP_PROBE(_test_, libfoofunc_enter); 9 | if (0) goto a; 10 | a: 11 | ilibfoofunc (); 12 | } 13 | -------------------------------------------------------------------------------- /testsuite/systemtap/notest.exp: -------------------------------------------------------------------------------- 1 | # this is just a placeholder for dejagnu 2 | -------------------------------------------------------------------------------- /testsuite/transko/two.stp: -------------------------------------------------------------------------------- 1 | #! stap -p3 2 | 3 | function bar () { 4 | return 0 5 | } 6 | 7 | probe end { 8 | break 9 | for (a=0; a<10; a=a+1) for (b=0; b<10; b=b+1) ; 10 | continue 11 | } 12 | -------------------------------------------------------------------------------- /testsuite/transko/varargs.stp: -------------------------------------------------------------------------------- 1 | #! stap -p3 2 | 3 | probe begin { 4 | // PR10750 enforces at most 32 print args 5 | println(1, 2, 3, 4, 5, 6, 7, 8, 6 | 9, 10, 11, 12, 13, 14, 15, 16, 7 | 17, 18, 19, 20, 21, 22, 23, 24, 8 | 25, 26, 27, 28, 29, 30, 31, 32, 9 | 33) 10 | } 11 | -------------------------------------------------------------------------------- /testsuite/transok/eleven.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap -p3 -d /zoo/poo/in/the/loo --ldd -e 'probe begin {exit()}' >/dev/null 4 | -------------------------------------------------------------------------------- /testsuite/transok/nine.stp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | stap -p3 -g $@ - <<'END' 4 | 5 | %{ 6 | void just_some_declaration () {} 7 | %} 8 | 9 | function bar(foo) %{ just_some_declaration(); STAP_RETVALUE = STAP_ARG_foo + 5; %} 10 | 11 | probe begin 12 | { 13 | bar (5) + 0 14 | } 15 | 16 | END 17 | -------------------------------------------------------------------------------- /testsuite/transok/six.stp: -------------------------------------------------------------------------------- 1 | #! stap -p3 2 | 3 | probe begin 4 | { 5 | print("kernel time\n") 6 | log("hello there") 7 | warn("this is a builtin") 8 | } 9 | -------------------------------------------------------------------------------- /testsuite/transok/ten.stp: -------------------------------------------------------------------------------- 1 | #! stap -p3 2 | 3 | probe kernel.function("dentry_open") 4 | { 5 | $dentry # is a void pointer 6 | } 7 | 8 | 9 | -------------------------------------------------------------------------------- /testsuite/transok/tval-opt.stp: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | set -o pipefail 5 | 6 | script='probe kernel.function("do_filp_open") { if ($dfd==50) $dfd=49 next }' 7 | s1=`stap -p3 -g -e "$script" | sum` 8 | s2=`stap -p3 -g -u -e "$script" | sum` 9 | 10 | test x"$s1" == x"$s2" 11 | -------------------------------------------------------------------------------- /testsuite/transok/two.stp: -------------------------------------------------------------------------------- 1 | #! stap -p3 2 | probe begin, end { 2; } 3 | function poo (zoo) { n = poo2 (8); return "foo" . zoo } 4 | function poo2 (zoo) { return poo3 (2 + 4 * zoo) } 5 | function poo3 (zoo) { return zoo } 6 | -------------------------------------------------------------------------------- /testsuite/transok/varargs.stp: -------------------------------------------------------------------------------- 1 | #! stap -p3 2 | 3 | probe begin { 4 | // PR10750 enforces at most 32 print args 5 | println(1, 2, 3, 4, 5, 6, 7, 8, 6 | 9, 10, 11, 12, 13, 14, 15, 16, 7 | 17, 18, 19, 20, 21, 22, 23, 24, 8 | 25, 26, 27, 28, 29, 30, 31, 32) 9 | } 10 | --------------------------------------------------------------------------------