Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103731
b: refs/heads/master
c: 9ef621d
h: refs/heads/master
i:
  103729: e1d57e5
  103727: 5647cad
v: v3
  • Loading branch information
Tan, Li authored and Avi Kivity committed Jul 20, 2008
1 parent 12c9fe2 commit 2f027c7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 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: 25be46080f1a446cb2bda3daadbd22a5682b955e
refs/heads/master: 9ef621d3be56e1188300476a8102ff54f7b6793f
4 changes: 2 additions & 2 deletions trunk/include/linux/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,14 @@ struct kvm_trace_rec {
__u32 vcpu_id;
union {
struct {
__u32 cycle_lo, cycle_hi;
__u64 cycle_u64;
__u32 extra_u32[KVM_TRC_EXTRA_MAX];
} cycle;
struct {
__u32 extra_u32[KVM_TRC_EXTRA_MAX];
} nocycle;
} u;
};
} __attribute__((packed));

#define KVMIO 0xAE

Expand Down
18 changes: 12 additions & 6 deletions trunk/virt/kvm/kvm_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ static void kvm_add_trace(void *probe_private, void *call_data,
rec.cycle_in = p->cycle_in;

if (rec.cycle_in) {
u64 cycle = 0;

cycle = get_cycles();
rec.u.cycle.cycle_lo = (u32)cycle;
rec.u.cycle.cycle_hi = (u32)(cycle >> 32);
rec.u.cycle.cycle_u64 = get_cycles();

for (i = 0; i < rec.extra_u32; i++)
rec.u.cycle.extra_u32[i] = va_arg(*args, u32);
Expand Down Expand Up @@ -114,8 +110,18 @@ static int kvm_subbuf_start_callback(struct rchan_buf *buf, void *subbuf,
{
struct kvm_trace *kt;

if (!relay_buf_full(buf))
if (!relay_buf_full(buf)) {
if (!prev_subbuf) {
/*
* executed only once when the channel is opened
* save metadata as first record
*/
subbuf_start_reserve(buf, sizeof(u32));
*(u32 *)subbuf = 0x12345678;
}

return 1;
}

kt = buf->chan->private_data;
atomic_inc(&kt->lost_records);
Expand Down

0 comments on commit 2f027c7

Please sign in to comment.