Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c2ff389bbb33074e7fde7a744f59da199a74af5
Commit:     7c2ff389bbb33074e7fde7a744f59da199a74af5
Parent:     4d5d8e9d3e55100bc12cf17a5ebc8a3c70befd38
Author:     Ingo Molnar <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 25 13:07:10 2007 +0200
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Fri Jul 27 08:08:24 2007 +0200

    blktrace: use cpu_clock() instead of sched_clock()
    
    use cpu_clock() instead of sched_clock(). (the latter is not a proper
    clock-source)
    
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 block/blktrace.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/block/blktrace.c b/block/blktrace.c
index 20c3e22..20fa034 100644
--- a/block/blktrace.c
+++ b/block/blktrace.c
@@ -41,7 +41,7 @@ static void trace_note(struct blk_trace *bt, pid_t pid, int 
action,
                const int cpu = smp_processor_id();
 
                t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION;
-               t->time = sched_clock() - per_cpu(blk_trace_cpu_offset, cpu);
+               t->time = cpu_clock(cpu) - per_cpu(blk_trace_cpu_offset, cpu);
                t->device = bt->dev;
                t->action = action;
                t->pid = pid;
@@ -159,7 +159,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, 
int bytes,
 
                t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION;
                t->sequence = ++(*sequence);
-               t->time = sched_clock() - per_cpu(blk_trace_cpu_offset, cpu);
+               t->time = cpu_clock(cpu) - per_cpu(blk_trace_cpu_offset, cpu);
                t->sector = sector;
                t->bytes = bytes;
                t->action = what;
@@ -488,17 +488,17 @@ void blk_trace_shutdown(struct request_queue *q)
 }
 
 /*
- * Average offset over two calls to sched_clock() with a gettimeofday()
+ * Average offset over two calls to cpu_clock() with a gettimeofday()
  * in the middle
  */
-static void blk_check_time(unsigned long long *t)
+static void blk_check_time(unsigned long long *t, int this_cpu)
 {
        unsigned long long a, b;
        struct timeval tv;
 
-       a = sched_clock();
+       a = cpu_clock(this_cpu);
        do_gettimeofday(&tv);
-       b = sched_clock();
+       b = cpu_clock(this_cpu);
 
        *t = tv.tv_sec * 1000000000 + tv.tv_usec * 1000;
        *t -= (a + b) / 2;
@@ -510,16 +510,16 @@ static void blk_check_time(unsigned long long *t)
 static void blk_trace_check_cpu_time(void *data)
 {
        unsigned long long *t;
-       int cpu = get_cpu();
+       int this_cpu = get_cpu();
 
-       t = &per_cpu(blk_trace_cpu_offset, cpu);
+       t = &per_cpu(blk_trace_cpu_offset, this_cpu);
 
        /*
         * Just call it twice, hopefully the second call will be cache hot
         * and a little more precise
         */
-       blk_check_time(t);
-       blk_check_time(t);
+       blk_check_time(t, this_cpu);
+       blk_check_time(t, this_cpu);
 
        put_cpu();
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to