summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-27 14:05:02 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-27 14:05:02 -0700
commit365aa51e11cc537ac39a96f765ad8e7511aa93ff (patch)
treef47c7455d06be57bb63835f53bed6c2df1bed0a7 /drivers
parent9908b4f32f91aafa86239dd092e9e5540e8615e0 (diff)
downloadlinux-365aa51e11cc537ac39a96f765ad8e7511aa93ff.tar.gz
linux-365aa51e11cc537ac39a96f765ad8e7511aa93ff.tar.bz2
linux-365aa51e11cc537ac39a96f765ad8e7511aa93ff.zip
staging: ktap: remove code from tree
ktap should be merged through the "proper" place in the kernel tree, in the perf tool, not as a stand-alone kernel module in staging. So remove it from here for now so that it can be merged correctly later. Reported-by: Ingo Molnar <mingo@kernel.org> Cc: Jovi Zhangwei <jovi.zhangwei@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/Kconfig2
-rw-r--r--drivers/staging/Makefile1
-rw-r--r--drivers/staging/ktap/Kconfig21
-rw-r--r--drivers/staging/ktap/Makefile101
-rw-r--r--drivers/staging/ktap/README.md144
-rw-r--r--drivers/staging/ktap/doc/tutorial.md552
-rw-r--r--drivers/staging/ktap/include/ktap.h169
-rw-r--r--drivers/staging/ktap/include/ktap_opcodes.h240
-rw-r--r--drivers/staging/ktap/include/ktap_types.h674
-rw-r--r--drivers/staging/ktap/interpreter/ktap.c235
-rw-r--r--drivers/staging/ktap/interpreter/library/ansilib.c153
-rw-r--r--drivers/staging/ktap/interpreter/library/baselib.c455
-rw-r--r--drivers/staging/ktap/interpreter/library/kdebug.c449
-rw-r--r--drivers/staging/ktap/interpreter/library/timer.c192
-rw-r--r--drivers/staging/ktap/interpreter/loader.c310
-rw-r--r--drivers/staging/ktap/interpreter/object.c483
-rw-r--r--drivers/staging/ktap/interpreter/opcode.c127
-rw-r--r--drivers/staging/ktap/interpreter/strfmt.c196
-rw-r--r--drivers/staging/ktap/interpreter/table.c1292
-rw-r--r--drivers/staging/ktap/interpreter/transport.c636
-rw-r--r--drivers/staging/ktap/interpreter/tstring.c287
-rw-r--r--drivers/staging/ktap/interpreter/vm.c1369
-rw-r--r--drivers/staging/ktap/scripts/basic/backtrace.kp6
-rw-r--r--drivers/staging/ktap/scripts/basic/event_trigger.kp24
-rw-r--r--drivers/staging/ktap/scripts/basic/event_trigger_ftrace.kp28
-rw-r--r--drivers/staging/ktap/scripts/basic/ftrace.kp6
-rw-r--r--drivers/staging/ktap/scripts/basic/function_time.kp57
-rw-r--r--drivers/staging/ktap/scripts/basic/kretprobe.kp6
-rw-r--r--drivers/staging/ktap/scripts/game/tetris.kp328
-rw-r--r--drivers/staging/ktap/scripts/helloworld.kp3
-rw-r--r--drivers/staging/ktap/scripts/interrupt/hardirq_time.kp25
-rw-r--r--drivers/staging/ktap/scripts/interrupt/softirq_time.kp25
-rw-r--r--drivers/staging/ktap/scripts/io/kprobes-do-sys-open.kp20
-rw-r--r--drivers/staging/ktap/scripts/io/traceio.kp56
-rw-r--r--drivers/staging/ktap/scripts/mem/kmalloc-top.kp17
-rw-r--r--drivers/staging/ktap/scripts/mem/kmem.kp30
-rw-r--r--drivers/staging/ktap/scripts/profiling/function_profiler.kp41
-rw-r--r--drivers/staging/ktap/scripts/profiling/stack_profile.kp26
-rw-r--r--drivers/staging/ktap/scripts/schedule/sched_transition.kp5
-rw-r--r--drivers/staging/ktap/scripts/schedule/schedtimes.kp125
-rw-r--r--drivers/staging/ktap/scripts/syscalls/errinfo.kp145
-rw-r--r--drivers/staging/ktap/scripts/syscalls/sctop.kp14
-rw-r--r--drivers/staging/ktap/scripts/syscalls/syscalls.kp6
-rw-r--r--drivers/staging/ktap/scripts/syscalls/syscalls_count.kp56
-rw-r--r--drivers/staging/ktap/scripts/syscalls/syscalls_count_by_proc.kp24
-rw-r--r--drivers/staging/ktap/scripts/tracepoints/eventcount.kp212
-rw-r--r--drivers/staging/ktap/scripts/tracepoints/eventcount_by_proc.kp59
-rw-r--r--drivers/staging/ktap/scripts/tracepoints/tracepoints.kp6
-rw-r--r--drivers/staging/ktap/scripts/userspace/uprobes-malloc.kp9
-rw-r--r--drivers/staging/ktap/test/aggr_table.kp50
-rw-r--r--drivers/staging/ktap/test/ansi.kp20
-rw-r--r--drivers/staging/ktap/test/arg.kp24
-rw-r--r--drivers/staging/ktap/test/arith.kp27
-rw-r--r--drivers/staging/ktap/test/bench/sembench.c556
-rw-r--r--drivers/staging/ktap/test/bench/test.sh25
-rw-r--r--drivers/staging/ktap/test/concat.kp15
-rw-r--r--drivers/staging/ktap/test/count.kp20
-rw-r--r--drivers/staging/ktap/test/fibonacci.kp36
-rw-r--r--drivers/staging/ktap/test/function.kp88
-rw-r--r--drivers/staging/ktap/test/if.kp24
-rw-r--r--drivers/staging/ktap/test/kprobe.kp14
-rw-r--r--drivers/staging/ktap/test/kretprobe.kp14
-rw-r--r--drivers/staging/ktap/test/len.kp25
-rw-r--r--drivers/staging/ktap/test/looping.kp40
-rw-r--r--drivers/staging/ktap/test/pairs.kp45
-rw-r--r--drivers/staging/ktap/test/run_test.sh58
-rw-r--r--drivers/staging/ktap/test/table.kp71
-rw-r--r--drivers/staging/ktap/test/timer.kp28
-rw-r--r--drivers/staging/ktap/test/tracepoint.kp22
-rw-r--r--drivers/staging/ktap/test/zerodivide.kp5
-rw-r--r--drivers/staging/ktap/userspace/code.c968
-rw-r--r--drivers/staging/ktap/userspace/dump.c187
-rw-r--r--drivers/staging/ktap/userspace/eventdef.c588
-rw-r--r--drivers/staging/ktap/userspace/ktapc.h376
-rw-r--r--drivers/staging/ktap/userspace/ktapio.c108
-rw-r--r--drivers/staging/ktap/userspace/lex.c622
-rw-r--r--drivers/staging/ktap/userspace/main.c609
-rw-r--r--drivers/staging/ktap/userspace/parser.c1910
-rw-r--r--drivers/staging/ktap/userspace/util.c346
79 files changed, 0 insertions, 16368 deletions
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 3b1501b7d894..3bfdaa8d80a9 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -150,6 +150,4 @@ source "drivers/staging/dgnc/Kconfig"
source "drivers/staging/dgap/Kconfig"
-source "drivers/staging/ktap/Kconfig"
-
endif # STAGING
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 2270ed077bde..b0d3303b4680 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -67,4 +67,3 @@ obj-$(CONFIG_XILLYBUS) += xillybus/
obj-$(CONFIG_DGNC) += dgnc/
obj-$(CONFIG_DGAP) += dgap/
obj-$(CONFIG_MTD_SPINAND_MT29F) += mt29f_spinand/
-obj-$(CONFIG_KTAP) += ktap/
diff --git a/drivers/staging/ktap/Kconfig b/drivers/staging/ktap/Kconfig
deleted file mode 100644
index 21f8d2ed03b9..000000000000
--- a/drivers/staging/ktap/Kconfig
+++ /dev/null
@@ -1,21 +0,0 @@
-config KTAP
- tristate "a programable dynamic tracing tool for Linux"
- depends on PERF_EVENTS && EVENT_TRACING
- default n
- help
- ktap is a new script-based dynamic tracing tool for Linux,
- it uses a scripting language and lets users trace the
- Linux kernel dynamically. ktap is designed to give
- operational insights with interoperability that allow
- users to tune, troubleshoot and extend kernel and application.
- It's similar with Linux Systemtap and Solaris Dtrace.
-
- ktap have different design principles from Linux mainstream
- dynamic tracing language in that it's based on bytecode,
- so it doesn't depend upon GCC, doesn't require compiling
- kernel module for each script, safe to use in production
- environment, fulfilling the embedded ecosystem's tracing needs.
-
- See ktap tutorial for more information:
- http://www.ktap.org/doc/tutorial.html
-
diff --git a/drivers/staging/ktap/Makefile b/drivers/staging/ktap/Makefile
deleted file mode 100644
index e2e54baf36d9..000000000000
--- a/drivers/staging/ktap/Makefile
+++ /dev/null
@@ -1,101 +0,0 @@
-
-# Do not instrument the tracer itself:
-ifdef CONFIG_FUNCTION_TRACER
-ORIG_CFLAGS := $(KBUILD_CFLAGS)
-KBUILD_CFLAGS = $(subst -pg,,$(ORIG_CFLAGS))
-endif
-
-all: mod ktap
-
-INTP = interpreter
-
-LIBDIR = $(INTP)/library
-
-LIB_OBJS += $(LIBDIR)/baselib.o $(LIBDIR)/kdebug.o $(LIBDIR)/timer.o \
- $(LIBDIR)/ansilib.o
-
-INTP_OBJS += $(INTP)/ktap.o $(INTP)/loader.o $(INTP)/object.o \
- $(INTP)/tstring.o $(INTP)/table.o $(INTP)/vm.o \
- $(INTP)/opcode.o $(INTP)/strfmt.o $(INTP)/transport.o \
- $(LIB_OBJS)
-
-obj-m += ktapvm.o
-ktapvm-y := $(INTP_OBJS)
-
-KVERSION ?= $(shell uname -r)
-KERNEL_SRC ?= /lib/modules/$(KVERSION)/build
-mod:
- $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules
-
-modules_install:
- $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install
-
-KTAPC_CFLAGS = -Wall -O2
-
-UDIR = userspace
-
-$(UDIR)/lex.o: $(UDIR)/lex.c
- $(QUIET_CC)$(CC) $(DEBUGINFO_FLAG) $(KTAPC_CFLAGS) -o $@ -c $<
-$(UDIR)/parser.o: $(UDIR)/parser.c
- $(QUIET_CC)$(CC) $(DEBUGINFO_FLAG) $(KTAPC_CFLAGS) -o $@ -c $<
-$(UDIR)/code.o: $(UDIR)/code.c
- $(QUIET_CC)$(CC) $(DEBUGINFO_FLAG) $(KTAPC_CFLAGS) -o $@ -c $<
-$(UDIR)/dump.o: $(UDIR)/dump.c
- $(QUIET_CC)$(CC) $(DEBUGINFO_FLAG) $(KTAPC_CFLAGS) -o $@ -c $<
-$(UDIR)/main.o: $(UDIR)/main.c
- $(QUIET_CC)$(CC) $(DEBUGINFO_FLAG) $(KTAPC_CFLAGS) -o $@ -c $<
-$(UDIR)/util.o: $(UDIR)/util.c
- $(QUIET_CC)$(CC) $(DEBUGINFO_FLAG) $(KTAPC_CFLAGS) -o $@ -c $<
-$(UDIR)/ktapio.o: $(UDIR)/ktapio.c
- $(QUIET_CC)$(CC) $(DEBUGINFO_FLAG) $(KTAPC_CFLAGS) -o $@ -c $<
-$(UDIR)/eventdef.o: $(UDIR)/eventdef.c
- $(QUIET_CC)$(CC) $(DEBUGINFO_FLAG) $(KTAPC_CFLAGS) -o $@ -c $<
-$(UDIR)/opcode.o: $(INTP)/opcode.c
- $(QUIET_CC)$(CC) $(DEBUGINFO_FLAG) $(KTAPC_CFLAGS) -o $@ -c $<
-$(UDIR)/table.o: $(INTP)/table.c
- $(QUIET_CC)$(CC) $(DEBUGINFO_FLAG) $(KTAPC_CFLAGS) -o $@ -c $<
-$(UDIR)/tstring.o: $(INTP)/tstring.c
- $(QUIET_CC)$(CC) $(DEBUGINFO_FLAG) $(KTAPC_CFLAGS) -o $@ -c $<
-$(UDIR)/object.o: $(INTP)/object.c
- $(QUIET_CC)$(CC) $(DEBUGINFO_FLAG) $(KTAPC_CFLAGS) -o $@ -c $<
-
-KTAPOBJS =
-KTAPOBJS += $(UDIR)/lex.o
-KTAPOBJS += $(UDIR)/parser.o
-KTAPOBJS += $(UDIR)/code.o
-KTAPOBJS += $(UDIR)/dump.o
-KTAPOBJS += $(UDIR)/main.o
-KTAPOBJS += $(UDIR)/util.o
-KTAPOBJS += $(UDIR)/ktapio.o
-KTAPOBJS += $(UDIR)/eventdef.o
-KTAPOBJS += $(UDIR)/opcode.o
-KTAPOBJS += $(UDIR)/table.o
-KTAPOBJS += $(UDIR)/tstring.o
-KTAPOBJS += $(UDIR)/object.o
-
-ktap: $(KTAPOBJS)
- $(QUIET_LINK)$(CC) $(KTAPC_CFLAGS) -o $@ $(KTAPOBJS) -lpthread
-
-KMISC := /lib/modules/$(KVERSION)/ktapvm/
-
-install: mod ktap
- install -d $(KMISC)
- install -m 644 -c *.ko /lib/modules/$(KVERSION)/ktapvm/
- /sbin/depmod -a
-
-load:
- insmod ktapvm.ko
-
-unload:
- rmmod ktapvm
-
-test: FORCE
- cd test; sh ./run_test.sh; cd -
-
-clean:
- $(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean
- $(RM) ktap
-
-PHONY += FORCE
-FORCE:
-
diff --git a/drivers/staging/ktap/README.md b/drivers/staging/ktap/README.md
deleted file mode 100644
index c8ddd5fa66c6..000000000000
--- a/drivers/staging/ktap/README.md
+++ /dev/null
@@ -1,144 +0,0 @@
-# ktap
-
-A New Scripting Dynamic Tracing Tool For Linux
-[www.ktap.org][homepage]
-
-ktap is a new scripting dynamic tracing tool for Linux,
-it uses a scripting language and lets users trace the Linux kernel dynamically.
-ktap is designed to give operational insights with interoperability
-that allows users to tune, troubleshoot and extend kernel and application.
-It's similar with Linux Systemtap and Solaris Dtrace.
-
-ktap have different design principles from Linux mainstream dynamic tracing
-language in that it's based on bytecode, so it doesn't depend upon GCC,
-doesn't require compiling kernel module for each script, safe to use in
-production environment, fulfilling the embedded ecosystem's tracing needs.
-
-More information can be found at [ktap homepage][homepage].
-
-[homepage]: http://www.ktap.org
-
-## Highlights
-
- * simple but powerful scripting language
- * register based interpreter (heavily optimized) in Linux kernel
- * small and lightweight (6KLOC of interpreter)
- * not depend on gcc for each script running
- * easy to use in embedded environment without debugging info
- * support for tracepoint, kprobe, uprobe, function trace, timer, and more
- * supported in x86, arm, ppc, mips
- * safety in sandbox
-
-## Building & Running
-
-1. Clone ktap from github
-
- $ git clone http://github.com/ktap/ktap.git
-
-2. Compiling ktap
-
- $ cd ktap
- $ make #generate ktapvm kernel module and ktap binary
-
-3. Load ktapvm kernel module(make sure debugfs mounted)
-
- $ make load #need to be root or have sudo access
-
-4. Running ktap
-
- $ ./ktap scripts/helloworld.kp
-
-
-## Examples
-
-1. simplest one-liner command to enable all tracepoints
-
- ktap -e "trace *:* { print(argevent) }"
-
-2. syscall tracing on target process
-
- ktap -e "trace syscalls:* { print(argevent) }" -- ls
-
-3. function tracing
-
- ktap -e "trace ftrace:function { print(argevent) }"
-
- ktap -e "trace ftrace:function /ip==mutex*/ { print(argevent) }"
-
-4. simple syscall tracing
-
- trace syscalls:* {
- print(cpu(), pid(), execname(), argevent)
- }
-
-5. syscall tracing in histogram style
-
- s = {}
-
- trace syscalls:sys_enter_* {
- s[argname] += 1
- }
-
- trace_end {
- histogram(s)
- }
-
-6. kprobe tracing
-
- trace probe:do_sys_open dfd=%di fname=%dx flags=%cx mode=+4($stack) {
- print("entry:", execname(), argevent)
- }
-
- trace probe:do_sys_open%return fd=$retval {
- print("exit:", execname(), argevent)
- }
-
-7. uprobe tracing
-
- trace probe:/lib/libc.so.6:0x000773c0 {
- print("entry:", execname(), argevent)
- }
-
- trace probe:/lib/libc.so.6:0x000773c0%return {
- print("exit:", execname(), argevent)
- }
-
-8. timer
-
- tick-1ms {
- printf("time fired on one cpu\n");
- }
-
- profile-2s {
- printf("time fired on every cpu\n");
- }
-
-More sample scripts can be found at scripts/ directory.
-
-## Mailing list
-
-ktap@freelists.org
-You can subscribe to ktap mailing list at link (subscribe before posting):
-http://www.freelists.org/list/ktap
-
-
-## Copyright and License
-
-ktap is licensed under GPL v2
-
-Copyright (C) 2012-2013, Jovi Zhangwei <jovi.zhangwei@gmail.com>.
-All rights reserved.
-
-
-## Contribution
-
-ktap is still under active development, so contributions are welcome.
-You are encouraged to report bugs, provide feedback, send feature request,
-or hack on it.
-
-
-## See More
-
-More info can be found at [documentation][tutorial]
-[tutorial]: http://www.ktap.org/doc/tutorial.html
-
diff --git a/drivers/staging/ktap/doc/tutorial.md b/drivers/staging/ktap/doc/tutorial.md
deleted file mode 100644
index 3c32ce77a731..000000000000
--- a/drivers/staging/ktap/doc/tutorial.md
+++ /dev/null
@@ -1,552 +0,0 @@
-% The ktap Tutorial
-
-# Introduction
-
-ktap is a new scripting dynamic tracing tool for linux
-
-ktap is a new scripting dynamic tracing tool for Linux,
-it uses a scripting language and lets users trace the Linux kernel dynamically.
-ktap is designed to give operational insights with interoperability
-that allows users to tune, troubleshoot and extend kernel and application.
-It's similar with Linux Systemtap and Solaris Dtrace.
-
-ktap have different design principles from Linux mainstream dynamic tracing
-language in that it's based on bytecode, so it doesn't depend upon GCC,
-doesn't require compiling kernel module for each script, safe to use in
-production environment, fulfilling the embedded ecosystem's tracing needs.
-
-Highlights features:
-
-* simple but powerful scripting language
-* register based interpreter (heavily optimized) in Linux kernel
-* small and lightweight (6KLOC of interpreter)
-* not depend on gcc for each script running
-* easy to use in embedded environment without debugging info
-* support for tracepoint, kprobe, uprobe, function trace, timer, and more
-* supported in x86, arm, ppc, mips
-* safety in sandbox
-
-
-# Getting started
-
-Requirements
-
-* Linux 3.1 or later(Need some kernel patches for kernel earlier than 3.1)
-* CONFIG_EVENT_TRACING enabled
-* CONFIG_PERF_EVENTS enabled
-* CONFIG_DEBUG_FS enabled
- (make sure debugfs mounted before insmod ktapvm
- mount debugfs: mount -t debugfs none /sys/kernel/debug/)
-
-Note that those configuration is always enabled in Linux distribution,
-like REHL, Fedora, Ubuntu, etc.
-
-1. Clone ktap from github
-
- $ git clone http://github.com/ktap/ktap.git
-
-2. Compiling ktap
-
- $ cd ktap
- $ make #generate ktapvm kernel module and ktap binary
-
-3. Load ktapvm kernel module(make sure debugfs mounted)
-
- $ make load #need to be root or have sudo access
-
-4. Running ktap
-
- $ ./ktap scripts/helloworld.kp
-
-
-# Language basics
-
-## Syntax basics
-
-ktap's syntax is design on the mind of C language syntax friendly,
-to make it easy scripting by kernel developer.
-
-1. Variable declaration
-The biggest syntax differences with C is that ktap is a dynamic typed
-language, so you won't need add any variable type declaration, just
-use the variable.
-
-2. function
-All functions in ktap should use keyword "function" declaration
-
-3. comments
-The comments of ktap is starting from '#', long comments doesn't support now.
-
-4. others
-Don't need place any ';' at the ending of statement in ktap.
-ktap use free syntax style, so you can choose to use the ';' or not.
-
-ktap use nil as NULL, the result of any number operate on nil is nil.
-
-ktap don't have array structure, also don't have any pointer operation.
-
-## Control structures
-
-ktap if/else is same as C language.
-
-There have two method of for-loop in ktap:
-
- for (i = init, limit, step) { body }
-
-this is same as below in C:
-
- for (i = init; i < limit; i += step) { body }
-
-The next for-loop method is:
-
- for (k, v in pairs(t)) { body } # looping all elements of table
-
-Note that ktap don't have "continue" keyword, but C does.
-
-## Date structures
-
-Associative array is heavily used in ktap, it's also called by table.
-
-table declaration:
-
- t = {}
-
-how to use table:
-
- t[1] = 1
-