Skip to content

Commit 920f76b

Browse files
committed
/home/fox/release/dtrace/2009/dtrace-20090510.tar.bz2
1 parent 075f86c commit 920f76b

11 files changed

Lines changed: 143 additions & 101 deletions

File tree

.release

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
date=Sat May 9 16:19:18 BST 2009
2-
release=dtrace-20090509
3-
build=83
1+
date=Sun May 10 22:31:59 BST 2009
2+
release=dtrace-20090510
3+
build=84

Changes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Sun May 10 21:47:15 2009 fox
2+
3+
263* linux_types.h, driver/*: Use semaphores instead of mutexes
4+
since mutexes arent available in interrupt context.
5+
16
Sat May 9 09:57:35 2009 fox
27

38
262* libdtrace/makefile: Put dt_lex.c in the build dir since it

driver/dtrace.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ static dtrace_dynvar_t dtrace_dynhash_sink; /* end of dynamic hash chains */
248248
* mod_lock is similar with respect to dtrace_provider_lock in that it must be
249249
* acquired _between_ dtrace_provider_lock and dtrace_lock.
250250
*/
251-
DEFINE_MUTEX(dtrace_lock); /* probe state lock */
252-
DEFINE_MUTEX(dtrace_provider_lock); /* provider state lock */
253-
DEFINE_MUTEX(dtrace_meta_lock); /* meta-provider state lock */
251+
MUTEX_DEFINE(dtrace_lock); /* probe state lock */
252+
MUTEX_DEFINE(dtrace_provider_lock); /* provider state lock */
253+
MUTEX_DEFINE(dtrace_meta_lock); /* meta-provider state lock */
254254

255255
/*
256256
* DTrace Provider Variables
@@ -314,7 +314,7 @@ int dtrace_helptrace_enabled = 0;
314314
static dtrace_errhash_t dtrace_errhash[DTRACE_ERRHASHSZ];
315315
static const char *dtrace_errlast;
316316
static kthread_t *dtrace_errthread;
317-
static DEFINE_MUTEX(dtrace_errlock);
317+
static MUTEX_DEFINE(dtrace_errlock);
318318
#endif
319319

320320
/*
@@ -5822,7 +5822,6 @@ dcnt++;
58225822
dtrace_interrupt_enable(cookie);
58235823
return;
58245824
}
5825-
58265825
now = dtrace_gethrtime();
58275826
vtime = dtrace_vtime_references != 0;
58285827

@@ -5844,6 +5843,9 @@ dcnt++;
58445843

58455844
flags = (volatile uint16_t *)&cpu_core[cpuid].cpuc_dtrace_flags;
58465845

5846+
//dtrace_interrupt_enable(cookie);
5847+
//return;
5848+
58475849
for (ecb = probe->dtpr_ecb; ecb != NULL; ecb = ecb->dte_next) {
58485850
dtrace_predicate_t *pred = ecb->dte_predicate;
58495851
dtrace_state_t *state = ecb->dte_state;
@@ -12594,7 +12596,7 @@ dtrace_state_create(struct file *fp, cred_t *cr)
1259412596
# else
1259512597
/*state->dts_aggid_arena = new_unrhdr(1, INT_MAX, &dtrace_unr_mtx);*/
1259612598

12597-
state->dts_dev = (dev_t) (long long) fp;
12599+
state->dts_dev = (dev_t) (uintptr_t *) fp;
1259812600
# endif
1259912601

1260012602
/*

driver/dtrace_isa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extern size_t _allsyscalls_size;
6262
/* We use the kernels stack dumper to avoid issues with cpu */
6363
/* architecture and frame pointer. */
6464
/**********************************************************************/
65-
DEFINE_MUTEX(dtrace_stack_mutex);
65+
MUTEX_DEFINE(dtrace_stack_mutex);
6666
static pc_t *g_pcstack;
6767
static int g_pcstack_limit;
6868
static int g_depth;

driver/dtrace_linux.c

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ cpu_t *cpu_list;
145145
cpu_core_t *cpu_core;
146146
cpu_t *cpu_table;
147147
int nr_cpus = 1;
148-
DEFINE_MUTEX(mod_lock);
148+
MUTEX_DEFINE(mod_lock);
149149

150-
static DEFINE_MUTEX(dtrace_provider_lock); /* provider state lock */
151-
DEFINE_MUTEX(cpu_lock);
150+
static MUTEX_DEFINE(dtrace_provider_lock); /* provider state lock */
151+
MUTEX_DEFINE(cpu_lock);
152152
int panic_quiesce;
153153
sol_proc_t *curthread;
154154

@@ -537,9 +537,9 @@ typedef struct gate32 gate_t;
537537
# error "Dont know how to handle GATEs on this cpu"
538538
# endif
539539

540-
/*
540+
# if 0
541541
void
542-
xset_idt_entry(int intr, unsigned long func)
542+
set_idt_entry(int intr, unsigned long func)
543543
{
544544
gate_desc *idt_table = get_proc_addr("idt_table");
545545
gate_desc s;
@@ -550,7 +550,7 @@ memory_set_rw(idt_table, 1, TRUE);
550550
write_idt_entry(idt_table, intr, &s);
551551
return;
552552
}
553-
*/
553+
# else
554554
void
555555
set_idt_entry(int intr, unsigned long func)
556556
{
@@ -561,7 +561,7 @@ set_idt_entry(int intr, unsigned long func)
561561
int ist = GATE_DEBUG_STACK;
562562
int seg = __KERNEL_CS;
563563

564-
printk("patch idt %p vec %d func %p\n", idt_table, intr, func);
564+
printk("patch idt %p vec %d func %lx\n", idt_table, intr, func);
565565

566566
memset(&s, 0, sizeof s);
567567

@@ -592,6 +592,7 @@ printk("patch idt %p vec %d func %p\n", idt_table, intr, func);
592592
idt_table[intr] = s;
593593

594594
}
595+
#endif
595596

596597
/**********************************************************************/
597598
/* Saved copies of idt_table[n] for when we get unloaded. */
@@ -1376,7 +1377,8 @@ static pte_t *(*lookup_address)(void *, int *);
13761377
int
13771378
mutex_count(mutex_t *mp)
13781379
{
1379-
return atomic_read(&mp->count);
1380+
// return atomic_read(&mp->count);
1381+
return mp->count;
13801382
}
13811383
/**********************************************************************/
13821384
/* Called from fbt_linux.c. Dont let us register a probe point for */
@@ -1625,7 +1627,7 @@ dtrace_double_fault_handler(int type, struct pt_regs *regs)
16251627
struct die_args die;
16261628

16271629
die.regs = regs;
1628-
die.str = "hello";
1630+
die.str = "double-fault";
16291631
return proc_notifier_int3(&n, DIE_DEBUG, &die);
16301632
}
16311633
int
@@ -1634,7 +1636,7 @@ dtrace_int1_handler(int type, struct pt_regs *regs)
16341636
struct die_args die;
16351637

16361638
die.regs = regs;
1637-
die.str = "hello";
1639+
die.str = "single-step";
16381640
return proc_notifier_int3(&n, DIE_DEBUG, &die);
16391641
}
16401642
/**********************************************************************/
@@ -1654,7 +1656,7 @@ dtrace_dump_mem64(regs, 50);
16541656
*/
16551657
//int i; for (i = 0; i < 10000000; i++);
16561658
die.regs = regs;
1657-
die.str = "hello";
1659+
die.str = "bkpt";
16581660
return proc_notifier_int3(&n, DIE_INT3, &die);
16591661
}
16601662
/**********************************************************************/
@@ -1727,7 +1729,7 @@ static int noisy;
17271729
/* we can grep /proc/kallsyms to find what */
17281730
/* we forgot to do. */
17291731
/***********************************************/
1730-
if (cnt_reentrancy && cnt_reentrancy_msgcnt < 5) {
1732+
if (cnt_reentrancy && cnt_reentrancy_msgcnt < 20) {
17311733
cnt_reentrancy_msgcnt++;
17321734
printk("dtrace:cnt_reentrancy=%d PC:%p\n", cnt_reentrancy, (void *) pc_reentrancy);
17331735
}
@@ -1782,12 +1784,19 @@ static int noisy;
17821784

17831785
/***********************************************/
17841786
/* Check with fbt/sdt and anyone else if */
1785-
/* this is one of our INT3 type traps. */
1786-
/***********************************************/
1787+
/* this is one of our INT3 type traps. In */
1788+
/* case we are calling printk() in */
1789+
/* dtrace_probe, we need to flag that we */
1790+
/* dont want any more INT3's until we */
1791+
/* finish, so temporarily enable the */
1792+
/* auto-remove code above. */
1793+
/***********************************************/
1794+
this_cpu->cpuc_stepping++;
17871795
ret = dtrace_invop(regs->r_pc - 1,
17881796
(uintptr_t *) regs,
17891797
regs->r_rax,
17901798
&this_cpu->cpuc_tinfo);
1799+
this_cpu->cpuc_stepping--;
17911800

17921801
if (dtrace_here && ret && noisy < 100) {
17931802
printk("ret=%d %s\n", ret, ret == 0 ? "nothing" :
@@ -2127,9 +2136,9 @@ vmem_alloc(vmem_t *hdr, size_t s, int flags)
21272136
if (TRACE_ALLOC || dtrace_mem_alloc)
21282137
printk("vmem_alloc(size=%d)\n", (int) s);
21292138

2130-
mutex_lock(&seqp->seq_mutex);
2139+
mutex_enter(&seqp->seq_mutex);
21312140
ret = (void *) (long) ++seqp->seq_id;
2132-
mutex_unlock(&seqp->seq_mutex);
2141+
mutex_exit(&seqp->seq_mutex);
21332142
return ret;
21342143
}
21352144

@@ -2281,6 +2290,7 @@ dtracedrv_read(struct file *fp, char __user *buf, size_t len, loff_t *off)
22812290
dtrace_here,
22822291
cpu_get_id(),
22832292
dcnt);
2293+
*off += n;
22842294
return n;
22852295
}
22862296
/**********************************************************************/

driver/dtrace_linux.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
# include <linux/hrtimer.h>
4848
#endif
4949

50-
//# include <linux/uaccess.h>
51-
5250
# define MUTEX_HELD mutex_is_locked
5351

5452
#define PRIV_EFFECTIVE (1 << 0)
@@ -65,9 +63,6 @@
6563
#define uprintf printk
6664
#define vuprintf vprintk
6765

68-
#define mutex_enter(x) mutex_lock(x)
69-
#define mutex_exit(x) mutex_unlock(x)
70-
7166
# define PRINT_CASE(x) do { if (dtrace_here) printk("%s(%d):%s: %s\n", __FILE__, __LINE__, __func__, #x); } while (0)
7267

7368
# define crhold(x)

driver/fasttrap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static void swap_func(void *p1, void *p2, int size)
8787
}
8888
# define qsort(base, num, size, cmp) sort(base, num, size, cmp, swap_func)
8989

90-
DEFINE_MUTEX(pidlock);
90+
MUTEX_DEFINE(pidlock);
9191

9292
timeout_id_t
9393
timeout(void (*func)(void *), void *arg, unsigned long ticks)
@@ -235,7 +235,7 @@ static dev_info_t *fasttrap_devi;
235235
static dtrace_meta_provider_id_t fasttrap_meta_id;
236236

237237
static timeout_id_t fasttrap_timeout;
238-
static DEFINE_MUTEX(fasttrap_cleanup_mtx);
238+
static MUTEX_DEFINE(fasttrap_cleanup_mtx);
239239
static uint_t fasttrap_cleanup_work;
240240

241241
/*
@@ -271,7 +271,7 @@ static fasttrap_hash_t fasttrap_provs;
271271
static fasttrap_hash_t fasttrap_procs;
272272

273273
static uint64_t fasttrap_pid_count; /* pid ref count */
274-
static DEFINE_MUTEX(fasttrap_count_mtx); /* lock on ref count */
274+
static MUTEX_DEFINE(fasttrap_count_mtx); /* lock on ref count */
275275

276276
#define FASTTRAP_ENABLE_FAIL 1
277277
#define FASTTRAP_ENABLE_PARTIAL 2

driver/systrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ dtrace_systrace_syscall2(int syscall, systrace_sysent_t *sy,
115115

116116
# define linux_get_syscall() get_current()->thread.trap_no
117117

118-
DEFINE_MUTEX(slock);
118+
MUTEX_DEFINE(slock);
119119
static int do_slock;
120120

121121
/**********************************************************************/

0 commit comments

Comments
 (0)