Permalink
Browse files

/home/fox/release/dtrace/dtrace-20110304.tar.bz2

  • Loading branch information...
dtrace4linux committed Mar 4, 2011
1 parent e6146ad commit a67938bb0b800d31e1d1762041a2a66f00ff6d22
Showing with 254 additions and 161 deletions.
  1. +2 −0 .gdbinit
  2. +3 −3 .release
  3. +33 −0 Changes
  4. +4 −1 README
  5. +2 −2 archive.sh
  6. +5 −4 driver/Makefile
  7. +20 −1 driver/ctf_struct.c
  8. +12 −1 driver/dtrace_linux.c
  9. +16 −10 driver/systrace.c
  10. +28 −25 etc/sched.d
  11. +1 −1 {libdtrace → etc}/unistd.d
  12. +92 −18 libdtrace/dt_module.c
  13. +4 −1 libdtrace/dt_open.c
  14. +19 −1 libdtrace/dt_pragma.c
  15. +0 −82 libdtrace/sched.d
  16. +13 −11 makefile
View
@@ -1,3 +1,5 @@
+set confirm no
+set history expansion 1
dir libctf
dir libdtrace
dir libproc
View
@@ -1,3 +1,3 @@
-date=Tue Feb 15 22:50:42 GMT 2011
-release=dtrace-20110215
-build=222
+date=Fri Mar 4 23:46:32 GMT 2011
+release=dtrace-20110304
+build=224
View
33 Changes
@@ -1,3 +1,36 @@
+Fri Mar 4 23:29:07 2011 fox
+
+ 453* driver/dtrace_linux.c, driver/ctf_struct.c: Expose some
+ new structures so that etc/sched.d can work, and we can return
+ the "cpu" we hit a probe on.
+
+Wed Mar 2 18:52:46 2011 fox
+
+ 452* Archive: 1.0116
+
+ 451* makefile: Allow DESTDIR prefix for installing into
+ non-system areas.
+
+ sebastian AT pipping DOT org
+
+Tue Feb 22 23:36:43 2011 fox
+
+ 450* libdtrace/dt_module.c: Ensure the ctf file is loaded with a distinct
+ name from /proc/kallsyms.
+
+Thu Feb 17 23:36:52 2011 fox
+
+ 449* dt_module.c: Allow us to read linux-XXX-generic.ctf from the
+ dtrace build dir when debugging.
+
+ We have a catch-22 during build because when we build the USDT
+ stuff, we invoke dtrace without the linux.ctf file being ready.
+ But etc/sched.d currently needs this for dtrace_cpu_t.
+
+ Will need to change the order of building to resolve this, but
+ am unhappy that we cannot put good conditionals into sched.d
+ (like #if or "#pragma D depends_on type XXX").
+
Tue Feb 15 21:37:43 2011 fox
448* libdtrace/dt_module.c: Fix for HAVE_ELF_C_READ_MMAP
View
5 README
@@ -84,7 +84,7 @@ people to use, debug and enhance it.
GIT Repository
==============
-http://github.com/pmccormick/dtrace-for-linux/tree/master
+ https://github.com/pdmccormick/dtrace-for-linux
Thanks to Peter McCormick for setting this up.
@@ -93,6 +93,9 @@ Thanks to Peter McCormick for setting this up.
the links at the top of this document for the current homepage
data.
+ As of March 2011, I dont believe the git repository is being
+ synced, so do not rely on it, or check the dates.
+
Installation
============
View
@@ -1,6 +1,6 @@
NAME=dtrace
MAJ_VERSION=1
-MIN_VERSION=0115
+MIN_VERSION=0116
EXCLUDE="*.ko *.o .git"
EXCLUDE_DIRS="build-"
-#date Sun Feb 13 15:23:32 GMT 2011
+#date Wed Mar 2 23:23:47 GMT 2011
View
@@ -1,12 +1,13 @@
dtracedrv-objs := \
- ctf_subr.o \
- ctf_types.o \
ctf_hash.o \
- ctf_util.o \
+ ctf_lookup.o \
ctf_mod.o \
ctf_open.o \
- ctf_lookup.o \
+ ctf_struct.o \
+ ctf_subr.o \
+ ctf_types.o \
+ ctf_util.o \
ctl.o \
cpu_x86.o \
cyclic_linux.o \
View
@@ -40,4 +40,23 @@
psinfo_t p;
thread_t t;
-dtrace_cpu_t p1;
+dtrace_cpu_t dtrace_curcpu;
+int cpu_dr7;
+struct task_struct *cur_thread;
+int dtrace_cpu_id;
+
+void
+ctf_setup(void)
+{
+ /***********************************************/
+ /* Set up global/externally visible */
+ /* pointers in ctf_struct.c so that user */
+ /* code can access things like cur_thread. */
+ /***********************************************/
+ cur_thread = get_current();
+
+ dtrace_curcpu.cpu_id = smp_processor_id();
+
+ dtrace_cpu_id = smp_processor_id();
+
+}
View
@@ -221,6 +221,7 @@ static struct notifier_block n_exit = {
/**********************************************************************/
/* Prototypes. */
/**********************************************************************/
+void ctf_setup(void);
int dtrace_double_fault(void);
int dtrace_int1(void);
int dtrace_int3(void);
@@ -1723,6 +1724,16 @@ void *par_setup_thread1(struct task_struct *);
void
par_setup_thread()
{
+ /***********************************************/
+ /* Setup global vars for the probe */
+ /* functions in case user is using one of */
+ /* them. */
+ /***********************************************/
+ ctf_setup();
+
+ /***********************************************/
+ /* May rewrite/drop this later on... */
+ /***********************************************/
par_setup_thread1(get_current());
}
void *
@@ -1997,7 +2008,7 @@ dtrace_int13_handler(int type, struct pt_regs *regs)
/***********************************************/
DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR);
cpu_core[CPU->cpu_id].cpuc_dtrace_illval = read_cr2_register();
-//printk("int13 - gpf - %p\n", read_cr2_register());
+printk("int13 - gpf - %p\n", read_cr2_register());
return NOTIFY_DONE;
}
View
@@ -1,3 +1,12 @@
+/*
+Unless anyone objects, I am going to remove the Sun CDDL on this
+file shortly. There is almost *no* original Sun C code left, and much
+of the horror or complexity in this file is mine and Linus's fault.
+
+Paul Fox
+Feb 2011
+*/
+
/*
* CDDL HEADER START
*
@@ -54,6 +63,7 @@
/**********************************************************************/
# if defined(__amd64)
# define SYSCALL_64_32 1
+# define CAST_TO_INT(ptr) ((int) (long) (ptr))
# endif
#include <linux/mm.h>
@@ -120,11 +130,6 @@ struct sysent {
asmlinkage int64_t (*sy_callc)(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); /* C-style call hander or wrapper */
};
-#define LOADABLE_SYSCALL(s) (s->sy_flags & SE_LOADABLE)
-#define LOADED_SYSCALL(s) (s->sy_flags & SE_LOADED)
-#define SE_LOADABLE 0x08 /* syscall is loadable */
-#define SE_LOADED 0x10 /* syscall is completely loaded */
-
systrace_sysent_t *systrace_sysent;
systrace_sysent_t *systrace_sysent32;
@@ -1478,14 +1483,15 @@ systrace_disable(void *arg, dtrace_id_t id, void *parg)
{
int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg);
void *syscall_func = get_interposer(sysnum, FALSE);
+ int disable;
#if SYSCALL_64_32
- if ((int) parg & STF_32BIT) {
+ if (CAST_TO_INT(parg) & STF_32BIT) {
systrace_disable32(arg, id, parg);
return;
}
#endif
- int disable = (systrace_sysent[sysnum].stsy_entry == DTRACE_IDNONE ||
+ disable = (systrace_sysent[sysnum].stsy_entry == DTRACE_IDNONE ||
systrace_sysent[sysnum].stsy_return == DTRACE_IDNONE);
/***********************************************/
@@ -1573,7 +1579,7 @@ systrace_enable(void *arg, dtrace_id_t id, void *parg)
void *syscall_func = get_interposer(sysnum, TRUE);
#if SYSCALL_64_32
- if ((int) parg & STF_32BIT) {
+ if (CAST_TO_INT(parg) & STF_32BIT) {
systrace_enable32(arg, id, parg);
return 0;
}
@@ -1706,11 +1712,11 @@ int systrace_init(void)
/* time test. */
/***********************************************/
if (SYSTRACE_MASK <= NSYSCALL) {
- printk("systrace: too many syscalls? %d is too large\n", NSYSCALL);
+ printk("systrace: too many syscalls? %d is too large\n", (int) NSYSCALL);
return 0;
}
if (SYSTRACE_MASK <= NSYSCALL32) {
- printk("systrace: too many syscalls(32b)? %d is too large\n", NSYSCALL32);
+ printk("systrace: too many syscalls(32b)? %d is too large\n", (int) NSYSCALL32);
return 0;
}
View
@@ -21,8 +21,11 @@
* @APPLE_LICENSE_HEADER_END@
*/
+/*#pragma D depends_on module linux
+#pragma D depends_on type dtrace_cpu_t
+#pragma D depends_on type dtrace_cpu_t
+*/
/*
-#pragma D depends_on library darwin.d
#pragma D depends_on module mach_kernel
#pragma D depends_on provider sched
*/
@@ -52,30 +55,30 @@ struct cpuinfo {
typedef struct cpuinfo cpuinfo_t;
-translator cpuinfo_t < struct dtrace_cpu_t *C > {
- cpu_id = C->cpu_id;
+translator cpuinfo_t < dtrace_cpu_t *C > {
+ cpu_id = `dtrace_cpu_id; /* C->cpu_id; */
cpu_pset = -1;
- cpu_chip = C->cpu_id; /* XXX */
+ cpu_chip = `dtrace_cpu_id; /* C->cpu_id; */
cpu_lgrp = 0; /* XXX */
- cpu_info = *((_processor_info_t *)`dtrace_zero); /* ` */ /* XXX */
+/* cpu_info = *((_processor_info_t *)`dtrace_zero); /* ` */ /* XXX */
};
-//
-//inline cpuinfo_t *curcpu = xlate <cpuinfo_t *> (curthread->last_processor);
-//#pragma D attributes Stable/Stable/Common curcpu
-//#pragma D binding "1.0" curcpu
-//
-//inline processorid_t cpu = curcpu->cpu_id;
-//#pragma D attributes Stable/Stable/Common cpu
-//#pragma D binding "1.0" cpu
-//
-//inline psetid_t pset = curcpu->cpu_pset;
-//#pragma D attributes Stable/Stable/Common pset
-//#pragma D binding "1.0" pset
-//
-//inline chipid_t chip = curcpu->cpu_chip;
-//#pragma D attributes Stable/Stable/Common chip
-//#pragma D binding "1.0" chip
-//
-//inline lgrp_id_t lgrp = curcpu->cpu_lgrp;
-//#pragma D attributes Stable/Stable/Common lgrp
-//#pragma D binding "1.0" lgrp
+
+inline cpuinfo_t *curcpu = xlate <cpuinfo_t *> (&`dtrace_curcpu);
+#pragma D attributes Stable/Stable/Common curcpu
+#pragma D binding "1.0" curcpu
+
+inline processorid_t cpu = curcpu->cpu_id;
+#pragma D attributes Stable/Stable/Common cpu
+#pragma D binding "1.0" cpu
+
+inline psetid_t pset = curcpu->cpu_pset;
+#pragma D attributes Stable/Stable/Common pset
+#pragma D binding "1.0" pset
+
+inline chipid_t chip = curcpu->cpu_chip;
+#pragma D attributes Stable/Stable/Common chip
+#pragma D binding "1.0" chip
+
+inline lgrp_id_t lgrp = curcpu->cpu_lgrp;
+#pragma D attributes Stable/Stable/Common lgrp
+#pragma D binding "1.0" lgrp
@@ -23,7 +23,7 @@
* Use is subject to license terms.
*/
-#pragma ident "@(#)unistd.d 1.4 07/02/20 SMI"
+#pragma ident "%Z%%M% %I% %E% SMI"
inline int DTRACEFLT_UNKNOWN = 0; /* Unknown fault */
#pragma D binding "1.0" DTRACEFLT_UNKNOWN
Oops, something went wrong.

0 comments on commit a67938b

Please sign in to comment.