summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorhunt <hunt>2005-05-19 04:33:21 +0000
committerhunt <hunt>2005-05-19 04:33:21 +0000
commita7261d998f500237e14f8b808a3d171d8f728fc9 (patch)
tree384ba837572e15b20de13f24cc3cdbbf36772572 /runtime
parent782f702b6403e3326e5c60d7b9fe16ffa79fcf51 (diff)
downloadsystemtap-steved-a7261d998f500237e14f8b808a3d171d8f728fc9.tar.gz
systemtap-steved-a7261d998f500237e14f8b808a3d171d8f728fc9.tar.xz
systemtap-steved-a7261d998f500237e14f8b808a3d171d8f728fc9.zip
Renamed to shellsnoop.c. Minor fixes.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/probes/shellsnoop/Makefile2
-rw-r--r--runtime/probes/shellsnoop/shellsnoop.c (renamed from runtime/probes/shellsnoop/shellprobe.c)9
-rwxr-xr-xruntime/probes/shellsnoop/stp2
3 files changed, 7 insertions, 6 deletions
diff --git a/runtime/probes/shellsnoop/Makefile b/runtime/probes/shellsnoop/Makefile
index f34e0c85..a9db209d 100644
--- a/runtime/probes/shellsnoop/Makefile
+++ b/runtime/probes/shellsnoop/Makefile
@@ -11,7 +11,7 @@ KTA := $(firstword $(shell grep "__kernel_text_address" /boot/System.map-$(KVERS
CFLAGS += -I $(STP_RUNTIME) -I $(STP_RUNTIME)/relayfs -D KALLSYMS_LOOKUP_NAME=$(KALLSYMS_LOOKUP_NAME) \
-D KALLSYMS_LOOKUP=$(KALLSYMS_LOOKUP)
-obj-m := shellprobe.o
+obj-m := shellsnoop.o
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules \
diff --git a/runtime/probes/shellsnoop/shellprobe.c b/runtime/probes/shellsnoop/shellsnoop.c
index c257de5d..081ac700 100644
--- a/runtime/probes/shellsnoop/shellprobe.c
+++ b/runtime/probes/shellsnoop/shellsnoop.c
@@ -40,7 +40,8 @@ int inst_do_execve (char * filename, char __user *__user *argv, char __user *__u
foreach (arglist, ptr)
_stp_printf ("%s ", _stp_get_str(ptr));
-
+ _stp_print("\n");
+
_stp_print_flush();
}
jprobe_return();
@@ -51,7 +52,7 @@ struct file * inst_filp_open (const char * filename, int flags, int mode)
{
_stp_map_key_int64 (pids, current->pid);
if (_stp_map_get_int64 (pids))
- _stp_printf ("%d\t%d\t%s\tO %s", current->pid, current->parent->pid, current->comm, filename);
+ _stp_printf ("%d\t%d\t%s\tO %s\n", current->pid, current->parent->pid, current->comm, filename);
_stp_print_flush();
jprobe_return();
@@ -62,7 +63,7 @@ asmlinkage ssize_t inst_sys_read (unsigned int fd, char __user * buf, size_t cou
{
_stp_map_key_int64 (pids, current->pid);
if (_stp_map_get_int64 (pids))
- _stp_printf ("%d\t%d\t%s\tR %d", current->pid, current->parent->pid, current->comm, fd);
+ _stp_printf ("%d\t%d\t%s\tR %d\n", current->pid, current->parent->pid, current->comm, fd);
_stp_print_flush();
jprobe_return();
@@ -106,7 +107,6 @@ static struct jprobe stp_probes[] = {
#define MAX_STP_ROUTINE (sizeof(stp_probes)/sizeof(struct jprobe))
-
static int pid;
module_param(pid, int, 0);
MODULE_PARM_DESC(pid, "daemon pid");
@@ -140,6 +140,7 @@ static void probe_exit (void)
{
_stp_unregister_jprobes (stp_probes, MAX_STP_ROUTINE);
_stp_map_del (pids);
+ _stp_printf("dropped %d packets\n", atomic_read(&_stp_transport_failures));
_stp_print_flush();
}
diff --git a/runtime/probes/shellsnoop/stp b/runtime/probes/shellsnoop/stp
index 4a278ac2..ac5472f8 100755
--- a/runtime/probes/shellsnoop/stp
+++ b/runtime/probes/shellsnoop/stp
@@ -39,7 +39,7 @@ fi
../../stpd/stpd -b 8192 -n 4 $modulename
# log to files (relayfs), 4 8K buffers
-#../../stpd/stpd -r -b 8192 -n 4 $modulename
+#../../stpd/stpd -r -b 65536 -n 4 $modulename
# print to screen and log to files, 4 8K buffers
#../../stpd/stpd -b 8192 -n 4