From mboxrd@z Thu Jan 1 00:00:00 1970 From: ehrhardt@linux.vnet.ibm.com Subject: [PATCH 3/9] kvmtrace: rename cycles to timestamp Date: Thu, 10 Jul 2008 12:54:10 +0200 Message-ID: <1215687256-18155-4-git-send-email-ehrhardt@linux.vnet.ibm.com> References: <1215687256-18155-1-git-send-email-ehrhardt@linux.vnet.ibm.com> Cc: hollisb@us.ibm.com, avi@qumranet.com, kvm-ppc@vger.kernel.org, ehrhardt@linux.vnet.ibm.com To: kvm@vger.kernel.org Return-path: Received: from mtagate6.de.ibm.com ([195.212.29.155]:63572 "EHLO mtagate6.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753547AbYGJKzG (ORCPT ); Thu, 10 Jul 2008 06:55:06 -0400 In-Reply-To: <1215687256-18155-1-git-send-email-ehrhardt@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: From: Christian Ehrhardt Due to the fact that the cycle counter is now completely replaced by the more generic time based code (getnstimeofday) this patch renames all occurances of the old cycle code to make it clear that this is now a timestamp. Signed-off-by: Christian Ehrhardt --- [diffstat] include/linux/kvm.h | 6 +++--- virt/kvm/kvm_trace.c | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) [diff] diff --git a/include/linux/kvm.h b/include/linux/kvm.h --- a/include/linux/kvm.h +++ b/include/linux/kvm.h @@ -322,12 +322,12 @@ __u32 vcpu_id; union { struct { - __u64 cycle_u64; + __u64 timestamp_u64; __u32 extra_u32[KVM_TRC_EXTRA_MAX]; - } cycle; + } timestamp; struct { __u32 extra_u32[KVM_TRC_EXTRA_MAX]; - } nocycle; + } notimestamp; } u; } __attribute__((packed)); diff --git a/virt/kvm/kvm_trace.c b/virt/kvm/kvm_trace.c --- a/virt/kvm/kvm_trace.c +++ b/virt/kvm/kvm_trace.c @@ -35,16 +35,16 @@ struct kvm_trace_probe { const char *name; const char *format; - u32 cycle_in; + u32 timestamp_in; marker_probe_func *probe_func; }; -static inline int calc_rec_size(int cycle, int extra) +static inline int calc_rec_size(int timestamp, int extra) { int rec_size = KVM_TRC_HEAD_SIZE; rec_size += extra; - return cycle ? rec_size += KVM_TRC_CYCLE_SIZE : rec_size; + return timestamp ? rec_size += KVM_TRC_CYCLE_SIZE : rec_size; } static void kvm_add_trace(void *probe_private, void *call_data, @@ -70,26 +70,26 @@ WARN_ON(!(extra <= KVM_TRC_EXTRA_MAX)); extra = min_t(u32, extra, KVM_TRC_EXTRA_MAX); - rec.rec_val |= TRACE_REC_TCS(p->cycle_in) + rec.rec_val |= TRACE_REC_TCS(p->timestamp_in) | TRACE_REC_NUM_DATA_ARGS(extra); - if (p->cycle_in) { + if (p->timestamp_in) { getnstimeofday(&tv); /* compress both struct tv values into u64 on 32 bit archs */ if (sizeof(tv) == sizeof(u64)) - rec.u.cycle.cycle_u64 = + rec.u.timestamp.timestamp_u64 = (((u64)tv.tv_sec) << 32) | tv.tv_nsec; else - rec.u.cycle.cycle_u64 = tv.tv_nsec; + rec.u.timestamp.timestamp_u64 = tv.tv_nsec; for (i = 0; i < extra; i++) - rec.u.cycle.extra_u32[i] = va_arg(*args, u32); + rec.u.timestamp.extra_u32[i] = va_arg(*args, u32); } else { for (i = 0; i < extra; i++) - rec.u.nocycle.extra_u32[i] = va_arg(*args, u32); + rec.u.notimestamp.extra_u32[i] = va_arg(*args, u32); } - size = calc_rec_size(p->cycle_in, extra * sizeof(u32)); + size = calc_rec_size(p->timestamp_in, extra * sizeof(u32)); relay_write(kt->rchan, &rec, size); }