Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit a67938bb0b800d31e1d1762041a2a66f00ff6d22 1 parent e6146ad
@dtrace4linux authored
View
2  .gdbinit
@@ -1,3 +1,5 @@
+set confirm no
+set history expansion 1
dir libctf
dir libdtrace
dir libproc
View
6 .release
@@ -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
4 archive.sh
@@ -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
9 driver/Makefile
@@ -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
21 driver/ctf_struct.c
@@ -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
13 driver/dtrace_linux.c
@@ -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
26 driver/systrace.c
@@ -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
53 etc/sched.d
@@ -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
View
2  libdtrace/unistd.d → etc/unistd.d
@@ -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
View
110 libdtrace/dt_module.c
@@ -799,9 +799,9 @@ sort_32(Elf32_Sym **p1, Elf32_Sym **p2)
/**********************************************************************/
/* For Linux: add in entries from /proc/kallsyms. */
/**********************************************************************/
-static int
-dt_module_add_kernel(dtrace_hdl_t *dtp)
-{
+static dt_module_t *
+dt_module_add_kernel(dtrace_hdl_t *dtp, dt_module_t *dmp)
+{ int created = dmp == NULL;
unsigned long long text_start = 0;
unsigned long long text_end;
unsigned long long addr;
@@ -809,13 +809,13 @@ dt_module_add_kernel(dtrace_hdl_t *dtp)
char name[256];
char buf[BUFSIZ];
FILE *fp;
- dt_module_t *dmp;
int bits = 0;
int i;
struct utsname u;
- if ((dmp = dt_module_create(dtp, "kernel")) == NULL) {
- return;
+ if (dmp == NULL &&
+ (dmp = dt_module_create(dtp, "kernel")) == NULL) {
+ return NULL;
}
/***********************************************/
@@ -849,10 +849,11 @@ dt_module_add_kernel(dtrace_hdl_t *dtp)
//int err;
//ctf_file_t *ctfp = ctf_create(&err);
while (fgets(buf, sizeof buf, fp)) {
+ int stype = STT_FUNC;
if (sscanf(buf, "%llx %s %s", &addr, type, name) != 3)
continue;
-// if (*type != 'T' && *type != 't')
-// continue;
+ if (*type != 'T' && *type != 't')
+ stype = STT_OBJECT;
if (text_start == 0 && (*type == 'T' || *type == 't'))
text_start = addr;
if (addr && addr < text_start)
@@ -882,7 +883,7 @@ ctf_add_integer(ctfp, CTF_ADD_ROOT, name, &enc);
sp64->st_name = str_index;
sp64->st_value = addr;
sp64->st_size = 1024; // hack
- sp64->st_info = STT_FUNC;
+ sp64->st_info = stype;
} else {
if (dmp->dm_aslen >= asmap_size) {
asmap_size += 8192;
@@ -894,7 +895,7 @@ ctf_add_integer(ctfp, CTF_ADD_ROOT, name, &enc);
sp->st_name = str_index;
sp->st_value = addr;
sp->st_size = 1024; // hack
- sp->st_info = STT_FUNC;
+ sp->st_info = stype;
}
strcpy(strtab + str_index, name);
str_index += strlen(name) + 1;
@@ -943,7 +944,8 @@ ctf_add_integer(ctfp, CTF_ADD_ROOT, name, &enc);
if (dmp->dm_symbuckets == NULL || dmp->dm_symchains == NULL) {
dt_module_unload(dtp, dmp);
- return (dt_set_errno(dtp, EDT_NOMEM));
+ dt_set_errno(dtp, EDT_NOMEM);
+ return NULL;
}
bzero(dmp->dm_symbuckets, sizeof (uint_t) * dmp->dm_nsymbuckets);
@@ -967,6 +969,10 @@ ctf_add_integer(ctfp, CTF_ADD_ROOT, name, &enc);
Elf64_Sym **asmap = dmp->dm_asmap;
for (i = 0; i < dmp->dm_aslen-1; i++) {
asmap[i]->st_size = asmap[i+1]->st_value - asmap[i]->st_value;
+/*if (strcmp("cur_thread", dmp->dm_strtab.cts_data + asmap[i]->st_name) == 0)
+printf("%s val=%p size=%d\n", dmp->dm_strtab.cts_data + asmap[i]->st_name,
+asmap[i]->st_value,
+asmap[i]->st_size);*/
}
} else {
Elf32_Sym **asmap = dmp->dm_asmap;
@@ -976,13 +982,18 @@ ctf_add_integer(ctfp, CTF_ADD_ROOT, name, &enc);
}
/***********************************************/
/* HACK: might want to refresh from */
- /* /proc/kallsyms as modules get loaded. */
+ /* /proc/kallsyms as modules get loaded. */
+ /* No, probes are statically computed at */
+ /* compile/load time, so we cannot see a */
+ /* new probe suddenly appear (I believe). */
/***********************************************/
- dmp->dm_flags |= DT_DM_KERNEL | DT_DM_LOADED;
+ if (created) {
+ dmp->dm_flags |= DT_DM_KERNEL | DT_DM_LOADED;
+ }
dt_dprintf("opened %d-bit /proc/kallsyms (syms=%d)\n",
bits, dmp->dm_aslen, dmp->dm_modid);
- return 0;
+ return dmp;
}
/*
* Update our module cache by adding an entry for the specified module 'name'.
@@ -1041,14 +1052,43 @@ dt_module_update(dtrace_hdl_t *dtp, const char *name)
if (name == NULL) {
# if linux
+ struct stat sbuf;
+
+ /***********************************************/
+ /* We need symtab of key data structures */
+ /* from the kernel. We do this by compiling */
+ /* and installing linux-`uname -r`.ctf */
+ /* file. But when running from the install */
+ /* tree, we have it in the build/ tree, not */
+ /* the /usr/lib/dtrace/etc tree. */
+ /***********************************************/
struct utsname u;
uname(&u);
- dt_module_add_kernel(dtp);
- (void) snprintf(fname, sizeof (fname), "%s/linux-%s.ctf", dt_get_libdir(), u.release);
+// dmp = dt_module_add_kernel(dtp, NULL);
+ (void) snprintf(fname, sizeof fname, "%s/linux-%s.ctf", dt_get_libdir(), u.release);
+ if (stat(fname, &sbuf) < 0) {
+ char buf[MAXPATHLEN];
+ char *cp;
+ int ret = readlink("/proc/self/exe", buf, sizeof buf);
+ if (ret > 0) {
+ buf[ret] = '\0';
+ cp = strrchr(buf, '/');
+ if (cp)
+ *cp = '\0';
+ (void) snprintf(fname, sizeof fname, "%s/linux-%s.ctf", buf, u.release);
+ }
+ }
dt_dprintf("reading kernel .ctf: %s\n", fname);
- name = fname;
-name = "xkernel"; // xxx
+ //name = fname;
+ /***********************************************/
+ /* Allow etc/* to use pragma "depends_on */
+ /* module linux". Hm. We load the "kernel" */
+ /* (/proc/kallsyms) above, but we also need */
+ /* the CTF symbols. We'll need a unique */
+ /* name for this. */
+ /***********************************************/
+ name = "linux";
goto load_obj;
# else
return;
@@ -1067,6 +1107,14 @@ name = "xkernel"; // xxx
return;
}
+#if linux
+ /***********************************************/
+ /* When DTRACE_DEBUG is enabled, show which */
+ /* .ctf file we loaded. */
+ /***********************************************/
+ (void) strlcpy(dmp->dm_file, fname, sizeof (dmp->dm_file));
+#endif
+
/*
* Since the module can unload out from under us (and /system/object
* will return ENOENT), tell libelf to cook the entire file now and
@@ -1122,6 +1170,7 @@ name = "xkernel"; // xxx
return;
}
+ dt_module_add_kernel(dtp, NULL); //dmp);
/*
* Iterate over the section headers locating various sections of
* interest and use their attributes to flesh out the dt_module_t.
@@ -1514,11 +1563,36 @@ dtrace_symbol_type(dtrace_hdl_t *dtp, const GElf_Sym *symp,
tip->dtt_type = idp->di_type;
} else if (GELF_ST_TYPE(symp->st_info) != STT_FUNC) {
+#if linux
+ /***********************************************/
+ /* Funky code ahead. We have two modules */
+ /* under Linux for the kernel: "kernel" */
+ /* contains the /proc/kallsyms symbols, so */
+ /* we have values, but "linux" is the ctf */
+ /* file which contains the predeclared */
+ /* typedefs (see driver/ctf_struct.c). When */
+ /* a user refers to a symbol in the kernel */
+ /* module, we want to "jump" to the "linux" */
+ /* module to get the CTF data, so the */
+ /* following does this "sideways" jump. */
+ /***********************************************/
+ uint_t id = sip->dts_id;
+ if (strcmp(dmp->dm_name, "kernel") == 0 &&
+ dt_module_getctf(dtp, dmp) == NULL) {
+ GElf_Sym gsym;
+ dmp = dt_module_lookup_by_name(dtp, "linux");
+ dt_module_symname64(dmp, sip->dts_name, &gsym, &id);
+ }
+#endif
if (dt_module_getctf(dtp, dmp) == NULL)
return (-1); /* errno is set for us */
tip->dtt_ctfp = dmp->dm_ctfp;
+#if linux
+ tip->dtt_type = ctf_lookup_by_symbol(dmp->dm_ctfp, id);
+#else
tip->dtt_type = ctf_lookup_by_symbol(dmp->dm_ctfp, sip->dts_id);
+#endif
if (tip->dtt_type == CTF_ERR) {
dtp->dt_ctferr = ctf_errno(tip->dtt_ctfp);
View
5 libdtrace/dt_open.c
@@ -1443,11 +1443,14 @@ dt_get_libdir()
static char *alt_libdir;
char buf[PATH_MAX + 1];
char *cmd = buf;
+ int ret;
if (alt_libdir)
return alt_libdir;
- readlink("/proc/self/exe", buf, sizeof buf);
+ ret = readlink("/proc/self/exe", buf, sizeof buf);
+ if (ret > 0)
+ buf[ret] = '\0';
if (cmd && strncmp(cmd, "/usr/", 5) == 0) {
alt_libdir = _dtrace_libdir;
return alt_libdir;
View
20 libdtrace/dt_pragma.c
@@ -208,7 +208,7 @@ dt_pragma_depends(const char *prname, dt_node_t *cnp)
{
dtrace_hdl_t *dtp = yypcb->pcb_hdl;
dt_node_t *nnp = cnp ? cnp->dn_list : NULL;
- int found;
+ int found = 0;
dt_lib_depend_t *dld;
if (cnp == NULL || nnp == NULL ||
@@ -228,6 +228,7 @@ dt_pragma_depends(const char *prname, dt_node_t *cnp)
* We have the file we are working on in dtp->dt_filetag
* so find that node and add the dependency in.
*/
+printf("kkk ok\n");
if (yypcb->pcb_cflags & DTRACE_C_CTL) {
char lib[MAXPATHLEN];
@@ -237,6 +238,7 @@ dt_pragma_depends(const char *prname, dt_node_t *cnp)
(void) snprintf(lib, MAXPATHLEN, "%s%s",
dld->dtld_libpath, nnp->dn_string);
+printf("jjjj %s\n", lib);
if ((dt_lib_depend_add(dtp, &dld->dtld_dependencies,
lib)) != 0) {
xyerror(D_PRAGMA_DEPEND,
@@ -246,6 +248,22 @@ dt_pragma_depends(const char *prname, dt_node_t *cnp)
}
}
found = 1;
+#if linux
+ } else if (strcmp(cnp->dn_string, "type") == 0) {
+ /***********************************************/
+ /* Allow us to avoid loading, e.g. sched.d, */
+ /* if the type we want isnt available. */
+ /* Needed during bootstrap before the */
+ /* linux.ctf file is available. */
+ /***********************************************/
+
+ /***********************************************/
+ /* We need to rewrite the lexer, so we can */
+ /* gain access to the token. Dont do */
+ /* anything for now. */
+ /***********************************************/
+ found = 0;
+#endif
} else {
xyerror(D_PRAGMA_INVAL, "invalid class %s "
"specified by #pragma %s\n", cnp->dn_string, prname);
View
82 libdtrace/sched.d
@@ -1,82 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "@(#)sched.d 1.4 06/04/21 SMI"
-
-#pragma D depends_on module unix
-#pragma D depends_on provider sched
-
-struct cpuinfo {
- processorid_t cpu_id; /* CPU identifier */
- psetid_t cpu_pset; /* processor set identifier */
- chipid_t cpu_chip; /* chip identifier */
- lgrp_id_t cpu_lgrp; /* locality group identifer */
- processor_info_t cpu_info; /* CPU information */
-};
-
-typedef struct cpuinfo cpuinfo_t;
-
-translator cpuinfo_t < cpu_t *C > {
- cpu_id = C->cpu_id;
- cpu_pset = C->cpu_part->cp_id;
- cpu_chip = C->cpu_physid->cpu_chipid;
- cpu_lgrp = C->cpu_lpl->lpl_lgrpid;
- cpu_info = (processor_info_t)C->cpu_type_info;
-};
-
-translator cpuinfo_t < disp_t *D > {
- cpu_id = D->disp_cpu == NULL ? -1 :
- xlate <cpuinfo_t> (D->disp_cpu).cpu_id;
- cpu_pset = D->disp_cpu == NULL ? -1 :
- xlate <cpuinfo_t> (D->disp_cpu).cpu_pset;
- cpu_chip = D->disp_cpu == NULL ? -1 :
- xlate <cpuinfo_t> (D->disp_cpu).cpu_chip;
- cpu_lgrp = D->disp_cpu == NULL ? -1 :
- xlate <cpuinfo_t> (D->disp_cpu).cpu_lgrp;
- cpu_info = D->disp_cpu == NULL ?
- *((processor_info_t *)dtrace`dtrace_zero) :
- (processor_info_t)xlate <cpuinfo_t> (D->disp_cpu).cpu_info;
-};
-
-inline cpuinfo_t *curcpu = xlate <cpuinfo_t *> (curthread->t_cpu);
-#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
-
View
24 makefile
@@ -89,18 +89,20 @@ clean:
install: build/dtrace build/config.sh
. build/config.sh ; \
- mkdir -p /usr/lib/dtrace/$$CPU_BITS ; \
- rm -f /usr/lib/dtrace/types.d ; \
- install -m 4755 -o root build/dtrace /usr/sbin/dtrace ; \
- install -m 644 -o root build/drti.o /usr/lib/dtrace/$$CPU_BITS/drti.o
- if [ ! -f /etc/dtrace.conf ] ; then \
- install -m 644 -o root etc/dtrace.conf /etc/dtrace.conf ; \
+ mkdir -p "$(DESTDIR)"/usr/lib/dtrace/$$CPU_BITS ; \
+ rm -f "$(DESTDIR)"/usr/lib/dtrace/types.d ; \
+ mkdir -p "$(DESTDIR)"/usr/sbin/ ; \
+ install -m 4755 -o root build/dtrace "$(DESTDIR)"/usr/sbin/dtrace ; \
+ install -m 644 -o root build/drti.o "$(DESTDIR)"/usr/lib/dtrace/$$CPU_BITS/drti.o
+ mkdir -p "$(DESTDIR)"/etc/ ; \
+ if [ ! -f "$(DESTDIR)"/etc/dtrace.conf ] ; then \
+ install -m 644 -o root etc/dtrace.conf "$(DESTDIR)"/etc/dtrace.conf ; \
fi
- install -m 644 -o root libdtrace/unistd.d /usr/lib/dtrace
- install -m 644 -o root etc/io.d /usr/lib/dtrace
- install -m 644 -o root build/linux*.ctf /usr/lib/dtrace
- install -m 644 -o root etc/sched.d /usr/lib/dtrace
- scripts/mkinstall.pl
+ install -m 644 -o root libdtrace/unistd.d "$(DESTDIR)"/usr/lib/dtrace
+ install -m 644 -o root etc/io.d "$(DESTDIR)"/usr/lib/dtrace
+ install -m 644 -o root build/linux*.ctf "$(DESTDIR)"/usr/lib/dtrace
+ install -m 644 -o root etc/sched.d "$(DESTDIR)"/usr/lib/dtrace
+ scripts/mkinstall.pl -o="$(DESTDIR)"/usr/lib/dtrace
newf:
tar cvf /tmp/new.tar `find . -newer TIMESTAMP -type f | \
Please sign in to comment.
Something went wrong with that request. Please try again.