@@ -145,10 +145,10 @@ cpu_t *cpu_list;
145145cpu_core_t * cpu_core ;
146146cpu_t * cpu_table ;
147147int 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 );
152152int panic_quiesce ;
153153sol_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
541541void
542- xset_idt_entry (int intr, unsigned long func)
542+ set_idt_entry (int intr , unsigned long func )
543543{
544544gate_desc * idt_table = get_proc_addr ("idt_table" );
545545gate_desc s ;
@@ -550,7 +550,7 @@ memory_set_rw(idt_table, 1, TRUE);
550550write_idt_entry (idt_table , intr , & s );
551551return ;
552552}
553- */
553+ # else
554554void
555555set_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 *);
13761377int
13771378mutex_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}
16311633int
@@ -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/**********************************************************************/
0 commit comments