Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146125
b: refs/heads/master
c: 15879d0
h: refs/heads/master
i:
  146123: dc4fa8d
v: v3
  • Loading branch information
Markus Metzger authored and Ingo Molnar committed Apr 7, 2009
1 parent 7e5f0d2 commit bb7f2ab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38f801129ad07b9afa7f9bd3779f61b805416d8c
refs/heads/master: 15879d042164650b93d83281ad5f87ad323bfbfe
4 changes: 2 additions & 2 deletions trunk/arch/x86/include/asm/ds.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ struct bts_struct {
} lbr;
/* BTS_TASK_ARRIVES or BTS_TASK_DEPARTS */
struct {
__u64 jiffies;
__u64 clock;
pid_t pid;
} timestamp;
} event;
} variant;
};

Expand Down
17 changes: 9 additions & 8 deletions trunk/arch/x86/kernel/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/trace_clock.h>

#include <asm/ds.h>

Expand Down Expand Up @@ -471,7 +472,7 @@ enum bts_field {
bts_flags,

bts_qual = bts_from,
bts_jiffies = bts_to,
bts_clock = bts_to,
bts_pid = bts_flags,

bts_qual_mask = (bts_qual_max - 1),
Expand Down Expand Up @@ -517,8 +518,8 @@ bts_read(struct bts_tracer *tracer, const void *at, struct bts_struct *out)
memset(out, 0, sizeof(*out));
if ((bts_get(at, bts_qual) & ~bts_qual_mask) == bts_escape) {
out->qualifier = (bts_get(at, bts_qual) & bts_qual_mask);
out->variant.timestamp.jiffies = bts_get(at, bts_jiffies);
out->variant.timestamp.pid = bts_get(at, bts_pid);
out->variant.event.clock = bts_get(at, bts_clock);
out->variant.event.pid = bts_get(at, bts_pid);
} else {
out->qualifier = bts_branch;
out->variant.lbr.from = bts_get(at, bts_from);
Expand Down Expand Up @@ -555,8 +556,8 @@ static int bts_write(struct bts_tracer *tracer, const struct bts_struct *in)
case bts_task_arrives:
case bts_task_departs:
bts_set(raw, bts_qual, (bts_escape | in->qualifier));
bts_set(raw, bts_jiffies, in->variant.timestamp.jiffies);
bts_set(raw, bts_pid, in->variant.timestamp.pid);
bts_set(raw, bts_clock, in->variant.event.clock);
bts_set(raw, bts_pid, in->variant.event.pid);
break;
default:
return -EINVAL;
Expand Down Expand Up @@ -1083,9 +1084,9 @@ static inline void ds_take_timestamp(struct ds_context *context,
return;

memset(&ts, 0, sizeof(ts));
ts.qualifier = qualifier;
ts.variant.timestamp.jiffies = jiffies_64;
ts.variant.timestamp.pid = task->pid;
ts.qualifier = qualifier;
ts.variant.event.clock = trace_clock_global();
ts.variant.event.pid = task->pid;

bts_write(tracer, &ts);
}
Expand Down

0 comments on commit bb7f2ab

Please sign in to comment.