From patchwork Thu Jun 18 14:47:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 31165 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5IEnt1X022726 for ; Thu, 18 Jun 2009 14:49:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757483AbZFROtu (ORCPT ); Thu, 18 Jun 2009 10:49:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755521AbZFROtu (ORCPT ); Thu, 18 Jun 2009 10:49:50 -0400 Received: from mx2.redhat.com ([66.187.237.31]:38359 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753936AbZFROts (ORCPT ); Thu, 18 Jun 2009 10:49:48 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5IEnpOD031444 for ; Thu, 18 Jun 2009 10:49:51 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5IEnoIN001992; Thu, 18 Jun 2009 10:49:50 -0400 Received: from amt.cnet (vpn-51-44.sfbay.redhat.com [10.14.51.44]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5IEnmi1012843; Thu, 18 Jun 2009 10:49:49 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id A76B268014C; Thu, 18 Jun 2009 11:49:34 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id n5IEnXGx005365; Thu, 18 Jun 2009 11:49:33 -0300 Message-Id: <20090618144819.646605314@localhost.localdomain> References: <20090618144726.270388200@localhost.localdomain> User-Agent: quilt/0.46-1 Date: Thu, 18 Jun 2009 11:47:29 -0300 From: Marcelo Tosatti To: avi@redhat.com Cc: kvm@vger.kernel.org, Marcelo Tosatti Subject: [patch 3/3] kvm-kmod: dummy event trace hooks Content-Disposition: inline; filename=compat-trace-event X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org And don't stop if kvm_trace.c is gone. Signed-off-by: Marcelo Tosatti Index: kvm-kmod/external-module-compat-comm.h =================================================================== --- kvm-kmod.orig/external-module-compat-comm.h +++ kvm-kmod/external-module-compat-comm.h @@ -762,6 +762,18 @@ static inline bool zalloc_cpumask_var(cp #endif +/* event traces added in 2.6.31 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) + +#define TP_PROTO(args...) args + +#define TRACE_EVENT(name, proto, args, entry, fa, printk) \ + static inline void trace_##name(proto) { } + +static inline void tracepoint_synchronize_unregister(void) { } + +#endif + /* Macro introduced only on newer kernels: */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) Index: kvm-kmod/sync =================================================================== --- kvm-kmod.orig/sync +++ kvm-kmod/sync @@ -171,6 +171,10 @@ def header_sync(arch): % { 'T': T, 'name': os.path.basename(file) }) cp(file, out) unifdef(out) + for file in glob('%(linux)s/include/trace/events/kvm.h' % { 'linux': linux }): + out = ('%(T)s/include/trace/events/%(name)s' + % { 'T': T, 'name': os.path.basename(file) }) + cp(file, out) arch_headers = ( [x for dir in ['%(linux)s/arch/%(arch)s/include/asm/./kvm*.h', @@ -207,7 +211,13 @@ def source_sync(arch): unifdef(i) for i in hack_files[arch]: - hack(T, arch, i) + try: + os.stat(T + "/" + i ) + except OSError: + if i != "kvm_trace.c": + raise + else: + hack(T, arch, i) copy_if_changed(T, arch) rmtree(T) Index: kvm-kmod/include-compat/trace/define_trace.h =================================================================== --- /dev/null +++ kvm-kmod/include-compat/trace/define_trace.h @@ -0,0 +1 @@ +/* Dummy file */