aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2009-04-03 10:43:38 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-07 07:36:17 -0400
commit15879d042164650b93d83281ad5f87ad323bfbfe (patch)
tree13a756b1084df356982be428f79f7a9aadfcd3d9 /arch
parent38f801129ad07b9afa7f9bd3779f61b805416d8c (diff)
x86, bts: use trace_clock_global() for timestamps
Rename the bts_struct timestamp field to event. Use trace_clock_global() for time measurement. Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Markus Metzger <markus.t.metzger@intel.com> Cc: roland@redhat.com Cc: eranian@googlemail.com Cc: oleg@redhat.com Cc: juan.villacis@intel.com Cc: ak@linux.jf.intel.com LKML-Reference: <20090403144553.773216000@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/ds.h4
-rw-r--r--arch/x86/kernel/ds.c17
2 files changed, 11 insertions, 10 deletions
diff --git a/arch/x86/include/asm/ds.h b/arch/x86/include/asm/ds.h
index a8f672ba100c..772f141afb9a 100644
--- a/arch/x86/include/asm/ds.h
+++ b/arch/x86/include/asm/ds.h
@@ -170,9 +170,9 @@ struct bts_struct {
170 } lbr; 170 } lbr;
171 /* BTS_TASK_ARRIVES or BTS_TASK_DEPARTS */ 171 /* BTS_TASK_ARRIVES or BTS_TASK_DEPARTS */
172 struct { 172 struct {
173 __u64 jiffies; 173 __u64 clock;
174 pid_t pid; 174 pid_t pid;
175 } timestamp; 175 } event;
176 } variant; 176 } variant;
177}; 177};
178 178
diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c
index f03f117eff8c..2071b992c35c 100644
--- a/arch/x86/kernel/ds.c
+++ b/arch/x86/kernel/ds.c
@@ -25,6 +25,7 @@
25#include <linux/sched.h> 25#include <linux/sched.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/mm.h> 27#include <linux/mm.h>
28#include <linux/trace_clock.h>
28 29
29#include <asm/ds.h> 30#include <asm/ds.h>
30 31
@@ -471,7 +472,7 @@ enum bts_field {
471 bts_flags, 472 bts_flags,
472 473
473 bts_qual = bts_from, 474 bts_qual = bts_from,
474 bts_jiffies = bts_to, 475 bts_clock = bts_to,
475 bts_pid = bts_flags, 476 bts_pid = bts_flags,
476 477
477 bts_qual_mask = (bts_qual_max - 1), 478 bts_qual_mask = (bts_qual_max - 1),
@@ -517,8 +518,8 @@ bts_read(struct bts_tracer *tracer, const void *at, struct bts_struct *out)
517 memset(out, 0, sizeof(*out)); 518 memset(out, 0, sizeof(*out));
518 if ((bts_get(at, bts_qual) & ~bts_qual_mask) == bts_escape) { 519 if ((bts_get(at, bts_qual) & ~bts_qual_mask) == bts_escape) {
519 out->qualifier = (bts_get(at, bts_qual) & bts_qual_mask); 520 out->qualifier = (bts_get(at, bts_qual) & bts_qual_mask);
520 out->variant.timestamp.jiffies = bts_get(at, bts_jiffies); 521 out->variant.event.clock = bts_get(at, bts_clock);
521 out->variant.timestamp.pid = bts_get(at, bts_pid); 522 out->variant.event.pid = bts_get(at, bts_pid);
522 } else { 523 } else {
523 out->qualifier = bts_branch; 524 out->qualifier = bts_branch;
524 out->variant.lbr.from = bts_get(at, bts_from); 525 out->variant.lbr.from = bts_get(at, bts_from);
@@ -555,8 +556,8 @@ static int bts_write(struct bts_tracer *tracer, const struct bts_struct *in)
555 case bts_task_arrives: 556 case bts_task_arrives:
556 case bts_task_departs: 557 case bts_task_departs:
557 bts_set(raw, bts_qual, (bts_escape | in->qualifier)); 558 bts_set(raw, bts_qual, (bts_escape | in->qualifier));
558 bts_set(raw, bts_jiffies, in->variant.timestamp.jiffies); 559 bts_set(raw, bts_clock, in->variant.event.clock);
559 bts_set(raw, bts_pid, in->variant.timestamp.pid); 560 bts_set(raw, bts_pid, in->variant.event.pid);
560 break; 561 break;
561 default: 562 default:
562 return -EINVAL; 563 return -EINVAL;
@@ -1083,9 +1084,9 @@ static inline void ds_take_timestamp(struct ds_context *context,
1083 return; 1084 return;
1084 1085
1085 memset(&ts, 0, sizeof(ts)); 1086 memset(&ts, 0, sizeof(ts));
1086 ts.qualifier = qualifier; 1087 ts.qualifier = qualifier;
1087 ts.variant.timestamp.jiffies = jiffies_64; 1088 ts.variant.event.clock = trace_clock_global();
1088 ts.variant.timestamp.pid = task->pid; 1089 ts.variant.event.pid = task->pid;
1089 1090
1090 bts_write(tracer, &ts); 1091 bts_write(tracer, &ts);
1091} 1092}