Skip to content

Commit b195d03

Browse files
committed
/home/fox/release/dtrace/dtrace-20111222.tar.bz2
1 parent 35d07fd commit b195d03

21 files changed

Lines changed: 304 additions & 63 deletions

File tree

.release

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
date=Sun Dec 18 09:44:10 GMT 2011
2-
release=dtrace-20111218
3-
build=349
1+
date=Thu Dec 22 22:37:27 GMT 2011
2+
release=dtrace-20111222
3+
build=354

Changes

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
Thu Dec 22 14:43:40 2011 fox
2+
3+
638* driver/intr_x86-32.S/intr_x86-64.S: We werent allowing
4+
user breakpoint traps to be detected by USDT. This works
5+
again.
6+
7+
637* Archive: 1.0133
8+
9+
636* cmd/dtrace/dtrace.c: Add support for -arch [i386|x86_64], similar
10+
to Apple's dtrace.
11+
12+
635* usdt/c/makefile: Fix so that build/simple-c can run from anywhere.
13+
14+
634* libdtrace/dt_link.c: process_obj: For ELF32, write the SHT_REL entry
15+
back to the appropriate section, not the SHT_RELA section. Seems
16+
like a Solaris symmetry bug.
17+
18+
We now get USDT probes, but nobody is garbage collection them. Strange....
19+
20+
Wed Dec 21 09:19:53 2011 fox
21+
22+
633* dtrace.c: Temp remove the module-loaded chain because of fault
23+
on a reload.
24+
25+
632* dtrace_linux.c: prfind(): Map pid to pid structure, and then
26+
lookup.
27+
28+
631* ctl.c, driver_linux.c: Ensure fn_pid_task is setup, so prfind
29+
doesnt die on USDT probe.
30+
31+
630* sys/dtrace.h: Fix for 32b build.
32+
33+
629* cmd/instr.c: Fix size_t issue.
34+
35+
Mon Dec 19 21:48:57 2011 fox
36+
37+
628* ctf_struct.c: Avoid referring to user32 struct so we can
38+
compile on RH4 kernel.
39+
40+
627* dtrace_asm.c: Avoid compiler issue for old gcc/linux kernels
41+
for VMREAD instruction.
42+
143
Sun Dec 18 00:17:43 2011 fox
244

345
626* fbt_linux.c: Fix the arg0, .., arg4 args. We were relying

archive.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
NAME=dtrace
22
MAJ_VERSION=1
3-
MIN_VERSION=0132
3+
MIN_VERSION=0133
44
EXCLUDE="*.ko *.o .git"
55
EXCLUDE_DIRS="build-"
6-
#date Sat Dec 17 13:53:44 GMT 2011
6+
#date Thu Dec 22 20:19:16 GMT 2011

cmd/ctfconvert/dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ print_usage(FILE *fp, int verbose)
10351035
(void) fprintf(fp, "Usage: %s [-dfhlrsSt] [-u file] file\n", progname);
10361036
#endif /* __APPLE__ */
10371037

1038-
if (verbose) {
1038+
if (1 || verbose) {
10391039
(void) fprintf(fp,
10401040
"\t-d dump data object section\n"
10411041
"\t-f dump function section\n"

cmd/dtrace/dtrace.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ typedef struct dtrace_cmd {
6868
int dtrace_here = 1;
6969

7070
static const char DTRACE_OPTSTR[] =
71-
"3:6:aAb:Bc:CD:ef:FGhHi:I:lL:m:n:o:p:P:qs:SU:vVwx:X:Z";
71+
"3:6:a:Ab:Bc:CD:ef:FGhHi:I:lL:m:n:o:p:P:qs:SU:vVwx:X:Z";
7272

7373
static char **g_argv;
7474
static int g_argc;
@@ -138,6 +138,8 @@ usage(FILE *fp)
138138
"\t-32 generate 32-bit D programs and ELF files\n"
139139
"\t-64 generate 64-bit D programs and ELF files\n\n"
140140
"\t-a claim anonymous tracing state\n"
141+
"\t-arch [i386|x86_64] Generate output files for ELF type.\n"
142+
"\t\tSame as -32 or -64\n"
141143
"\t-A generate driver.conf(4) directives for anonymous tracing\n"
142144
"\t-b set trace buffer size\n"
143145
"\t-c run specified command and exit upon its completion\n"
@@ -1254,6 +1256,28 @@ main(int argc, char *argv[])
12541256
break;
12551257
case 'a':
12561258
#if !defined(__APPLE__)
1259+
if (strcmp(optarg, "rch") == 0) {
1260+
if (optind >= argc || argv[optind][0] == '-') {
1261+
fprintf(stderr, "%s: -arch requires an argument value, e.g. i386 or x86_64\n",
1262+
argv[0]);
1263+
exit(1);
1264+
}
1265+
if (strcmp(argv[optind], "i386") == 0) {
1266+
g_oflags |= DTRACE_O_ILP32;
1267+
g_oflags &= ~DTRACE_O_LP64;
1268+
break;
1269+
}
1270+
if (strcmp(argv[optind], "x86_64") == 0) {
1271+
g_oflags &= ~DTRACE_O_ILP32;
1272+
g_oflags |= DTRACE_O_LP64;
1273+
break;
1274+
}
1275+
fprintf(stderr, "%s: expected 'i386' or 'x86_64' after -arch switch\n",
1276+
argv[0]);
1277+
exit(1);
1278+
1279+
}
1280+
12571281
g_grabanon++; /* also checked in pass 2 below */
12581282
break;
12591283
#else

cmd/instr/instr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ gcc -DUSERMODE -Dprintk=printf -DDIS_TEXT -I. -o /tmp/instr ../tests/instr.c ins
55
#include <string.h>
66

77
#define uint_t unsigned int
8-
typedef unsigned long size_t;
8+
//typedef unsigned long size_t;
99
typedef unsigned char uchar_t;
1010
typedef unsigned long long uint64_t;
1111

driver/ctf_struct.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <linux/user.h>
3636
#include <linux/stat.h>
3737
#include <linux/mount.h>
38+
#include <linux/interrupt.h>
3839

3940
#include <linux/in.h>
4041
#include <linux/icmp.h>
@@ -83,13 +84,14 @@ int dtrace_cpu_id;
8384
struct tcp_sock tcp_sock;
8485
struct udp_sock udp_sock;
8586
struct user user;
86-
struct user32 user32;
87+
//struct user32 user32; not there in RH4
8788
struct thread_info thread_info;
8889
struct icmphdr icmphdr;
8990
struct icmp_filter icmp_filter;
9091
struct socket socket;
9192
struct proto_ops proto_ops;
9293
struct vfsmount vfsmount;
94+
struct irqaction irqaction;
9395

9496
void
9597
ctf_setup(void)

driver/ctl.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ present.
8181
#define PCSZONE 30L /* set zoneid from zoneid_t argument */
8282
#define PCSCREDX 31L /* as PCSCRED but with supplemental groups */
8383

84-
void *(*fn_pid_task)(void *, int);
8584
void *(*fn_get_pid_task)(void *, int);
8685

8786
/**********************************************************************/
@@ -189,7 +188,6 @@ return;
189188

190189
proc_pident_lookup = get_proc_addr("proc_pident_lookup");
191190
proc_pident_readdir = get_proc_addr("proc_pident_readdir");
192-
fn_pid_task = get_proc_addr("pid_task");
193191
fn_get_pid_task = get_proc_addr("get_pid_task");
194192
if ((ptr_proc_info_file_operations = get_proc_addr("proc_info_file_operations")) == NULL) {
195193
printk("ctl.c: Cannot locate proc_info_file_operations\n");

driver/dtrace.c

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14882,6 +14882,7 @@ dtrace_helper_provider_validate(dof_hdr_t *dof, dof_sec_t *sec)
1488214882
dof_stridx_t typeidx;
1488314883
size_t typesz;
1488414884
uint_t nprobes, j, k;
14885+
static char buf[64];
1488514886

1488614887
ASSERT(sec->dofs_type == DOF_SECT_PROVIDER);
1488714888

@@ -14930,7 +14931,9 @@ dtrace_helper_provider_validate(dof_hdr_t *dof, dof_sec_t *sec)
1493014931

1493114932
if (prb_sec->dofs_entsize == 0 ||
1493214933
prb_sec->dofs_entsize > prb_sec->dofs_size) {
14933-
dtrace_dof_error(dof, "invalid entry size");
14934+
snprintf(buf, sizeof buf, "invalid entry size: prbsec: %d vs %d\n",
14935+
(int) prb_sec->dofs_entsize, (int) prb_sec->dofs_size);
14936+
dtrace_dof_error(dof, buf);
1493414937
return (-1);
1493514938
}
1493614939

@@ -14940,7 +14943,9 @@ dtrace_helper_provider_validate(dof_hdr_t *dof, dof_sec_t *sec)
1494014943
}
1494114944

1494214945
if (off_sec->dofs_entsize != sizeof (uint32_t)) {
14943-
dtrace_dof_error(dof, "invalid entry size");
14946+
snprintf(buf, sizeof buf, "invalid entry size: offsec: %d vs %d\n",
14947+
(int) off_sec->dofs_entsize, (int) sizeof(uint32_t));
14948+
dtrace_dof_error(dof, buf);
1494414949
return (-1);
1494514950
}
1494614951

@@ -14950,7 +14955,9 @@ dtrace_helper_provider_validate(dof_hdr_t *dof, dof_sec_t *sec)
1495014955
}
1495114956

1495214957
if (arg_sec->dofs_entsize != sizeof (uint8_t)) {
14953-
dtrace_dof_error(dof, "invalid entry size");
14958+
snprintf(buf, sizeof buf, "invalid entry size: argsec: %d vs 1\n",
14959+
(int) arg_sec->dofs_entsize);
14960+
dtrace_dof_error(dof, buf);
1495414961
return (-1);
1495514962
}
1495614963

@@ -15735,14 +15742,21 @@ dtrace_attach(dev_info_t *devi, ddi_attach_cmd_t cmd)
1573515742
dtrace_devi = devi;
1573615743
# endif
1573715744

15745+
#if linux
15746+
/***********************************************/
15747+
/* We are paniccing on a double reload - I */
15748+
/* dont think kernel is removing us from */
15749+
/* the notifier chain. */
15750+
/***********************************************/
15751+
printk("TODO: Fix register_module_notifier(n_module_load)\n");
15752+
if (0)
15753+
register_module_notifier(&n_module_load);
15754+
#else
1573815755
/***********************************************/
1573915756
/* These wont be called for Linux but */
1574015757
/* compile them in as we may enable at a */
1574115758
/* future date. */
1574215759
/***********************************************/
15743-
#if linux
15744-
register_module_notifier(&n_module_load);
15745-
#else
1574615760
dtrace_modload = dtrace_module_loaded;
1574715761
dtrace_modunload = dtrace_module_unloaded;
1574815762
dtrace_cpu_init = dtrace_cpu_setup_initial;
@@ -16992,7 +17006,9 @@ printk("dtrace_unregister is causing us to fail\n");
1699217006
dtrace_modload = NULL;
1699317007
dtrace_modunload = NULL;
1699417008
#if linux
16995-
unregister_module_notifier(&n_module_load);
17009+
printk("TODO: Fix unregister_module_notifier(n_module_load)\n");
17010+
if (0)
17011+
unregister_module_notifier(&n_module_load);
1699617012
#endif
1699717013

1699817014
mutex_exit(&cpu_lock);

driver/dtrace_asm.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@ dtrace_getvmreg(uint32_t reg, volatile uint16_t *flags)
2525

2626
__asm(
2727
"movq %%rdi, %%rdx\n"
28+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
29+
/***********************************************/
30+
/* This is real gas/gcc dependent, not */
31+
/* kernel dependent, but we'll take the */
32+
/* tactic that old kernels are likely not */
33+
/* that interesting. */
34+
/***********************************************/
35+
".byte 0x0f, 0x78, 0xd0\n"
36+
#else
2837
"vmread %%rdx, %%rax\n"
38+
#endif
2939
: "=a" (ret)
3040
);
3141
return ret;

0 commit comments

Comments
 (0)