[lib] Optimise thread_call by caching pointer to thread history in the thread

2006-07-25 Paul Jakma <paul.jakma@sun.com>

	* thread.h: (struct thread) Add a cache pointer to the struct
	  cpu_thread_history, if it is known - saving hash lookup on
	  each thread_call.
	* thread.c: (thread_call) Cache the pointer to the
          cpu_thread_history, so that future thread_calls of same
          thread can avoid the hash_lookup.
diff --git a/lib/thread.h b/lib/thread.h
index f693ff5..0670a89 100644
--- a/lib/thread.h
+++ b/lib/thread.h
@@ -80,6 +80,7 @@
     struct timeval sands;	/* rest of time sands value. */
   } u;
   RUSAGE_T ru;			/* Indepth usage info.  */
+  struct cpu_thread_history *hist; /* cache pointer to cpu_history */
   char* funcname;
 };