Changed the way user/kernel time is tracked for threads. Now, thread_at_kernel_entry()

and thread_at_kernel_exit() are always called for userland threads at the appropriate
situation (note, I've renamed those from *_atkernel_*).
The timing should be more accurate this way, and the thread::last_time_type field
is no longer needed: all interrupts are now added to the kernel time (where the
time is actually spent).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11331 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-02-11 03:10:21 +00:00
parent 4265bb4b19
commit 90bce836e0
6 changed files with 69 additions and 86 deletions
+2 -7
View File
@@ -31,9 +31,9 @@ struct thread *thread_dequeue_id(struct thread_queue *q, thread_id thr_id);
void scheduler_enqueue_in_run_queue(struct thread *thread);
void scheduler_remove_from_run_queue(struct thread *thread);
void thread_atkernel_entry(void);
void thread_at_kernel_entry(void);
// called when the thread enters the kernel on behalf of the thread
void thread_atkernel_exit(void);
void thread_at_kernel_exit(void);
status_t thread_init(struct kernel_args *args);
status_t thread_per_cpu_init(int32 cpu_num);
@@ -80,11 +80,6 @@ struct rlimit;
int _user_getrlimit(int resource, struct rlimit * rlp);
int _user_setrlimit(int resource, const struct rlimit * rlp);
#if 1
// XXX remove later
int thread_test(void);
#endif
#ifdef __cplusplus
}
#endif
+1 -7
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004, Haiku Inc.
* Copyright 2004-2005, Haiku Inc.
* Distributed under the terms of the MIT License.
*
* Thread definition and structures
@@ -44,11 +44,6 @@ enum team_state {
TEAM_STATE_DEATH // being killed
};
enum {
KERNEL_TIME,
USER_TIME
};
#define THREAD_RETURN_EXIT 0x1
#define THREAD_RETURN_INTERRUPTED 0x2
@@ -187,7 +182,6 @@ struct thread {
bigtime_t user_time;
bigtime_t kernel_time;
bigtime_t last_time;
int32 last_time_type; // KERNEL_TIME or USER_TIME
// architecture dependant section
struct arch_thread arch_info;