File itrace.itrace_only.patch of Package itrace

---
 src/driver/Makefile   |    2 +-
 src/driver/pi_hooks.c |    3 +++
 src/driver/pi_init.c  |    3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)

--- a/src/driver/Makefile
+++ b/src/driver/Makefile
@@ -1,5 +1,5 @@
 src := $(ITRACE_DIR)/obj/ppc64
-EXTRA_CFLAGS += -D_LINUX
+EXTRA_CFLAGS += -D_LINUX -D_ST_ITRACE_ONLY
 EXTRA_CFLAGS += -I$(src)/../../include
 
 obj-m := pitrace.o
--- a/src/driver/pi_hooks.c
+++ b/src/driver/pi_hooks.c
@@ -91,6 +91,8 @@ struct task_struct * get_parent_tp(struc
 extern void          write_segment_hooks(struct task_struct * tp);
 
 
+#ifndef _ST_ITRACE_ONLY
+
 // Work queue for sampler thread wakeup
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
@@ -104,6 +106,7 @@ extern void          pi_sampler_wakeup_h
 DECLARE_WORK(pi_sampler_wakeup, pi_sampler_wakeup_handler);
 
 #endif
+#endif  // _ST_ITRACE_ONLY
 
 
 // work queue for unregistering system hooks
--- a/src/driver/pi_init.c
+++ b/src/driver/pi_init.c
@@ -488,12 +488,13 @@ void pi_cleanup_module(void)
 #ifndef _ST_ITRACE_ONLY
 	DisarmTprofInterrupt();
 	RemoveTprofInterruptHandlers();
-#endif
 
 	// Turn off sampling notification mode
 	PDEBUG("Forcing sampling notification mode off ...\n");
 	PerfDisableSamplingNotifyMode();   
 	RemoveAllSamplingNotifyListEntries();
+#endif
+
 	
 #if !defined(HAVE_COMPAT_IOCTL) && defined(CONFIG_64BIT)
 	unregister_32_bit_ioctls();