From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Gross Subject: Re: Re: [Xen-changelog] [xen-unstable] Spinlock profiling (enable in buildwith lock_profile=y) Date: Thu, 15 Oct 2009 07:03:38 +0200 Message-ID: <4AD6AD2A.2070602@ts.fujitsu.com> References: <200910140815.n9E8FKMD001374@xenbits.xensource.com> <3CA4D28AE2337kanno.masaki@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090008080708030108090407" Return-path: In-Reply-To: <3CA4D28AE2337kanno.masaki@jp.fujitsu.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Masaki Kanno Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------090008080708030108090407 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Masaki Kanno wrote: > Hi, > > I got the following error. > > gcc -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -m32 -march > =i686 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno- > unused-value -Wdeclaration-after-statement -D__XEN_TOOLS__ -MMD -MF . > xenlockprof.o.d -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 - > D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -mno-tls-direct-seg-refs - > Werror -I ../../tools/python/xen/lowlevel/xc -I ../../tools/libxc -I ../.. > /tools/include -c -o xenlockprof.o xenlockprof.c > cc1: warnings being treated as errors > xenlockprof.c: In function ‘main’: > xenlockprof.c:128: warning: format ‘%12ld’ expects type ‘long int’, > but argument 3 has type ‘uint64_t’ > xenlockprof.c:128: warning: format ‘%12ld’ expects type ‘long int’, > but argument 5 has type ‘uint64_t’ > make[4]: *** [xenlockprof.o] Error 1 > make[4]: Leaving directory `/xen/xen-unstable.hg/tools/misc' > make[3]: *** [subdir-install-misc] Error 2 > make[3]: Leaving directory `/xen/xen-unstable.hg/tools' > make[2]: *** [subdirs-install] Error 2 > make[2]: Leaving directory `/xen/xen-unstable.hg/tools' > make[1]: *** [install-tools] Error 2 > make[1]: Leaving directory `/xen/xen-unstable.hg' > make: *** [world] Error 2 Sorry, I've got no 32 bit machine to test. Attached patch should correct this. Juergen -- Juergen Gross Principal Developer Operating Systems TSP ES&S SWE OS6 Telephone: +49 (0) 89 636 47950 Fujitsu Technolgy Solutions e-mail: juergen.gross@ts.fujitsu.com Otto-Hahn-Ring 6 Internet: ts.fujitsu.com D-81739 Muenchen Company details: ts.fujitsu.com/imprint.html --------------090008080708030108090407 Content-Type: text/x-patch; name="xenlockprof.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xenlockprof.patch" Signed-off-by: juergen.gross@ts.fujitsu.com diff -r 18758847bf31 tools/misc/xenlockprof.c --- a/tools/misc/xenlockprof.c Wed Oct 14 09:09:23 2009 +0100 +++ b/tools/misc/xenlockprof.c Thu Oct 15 06:53:27 2009 +0200 @@ -39,6 +39,7 @@ uint32_t i, j, n; uint64_t time; double l, b, sl, sb; + long long int lc, bc; char name[60]; xc_lockprof_data_t *data; @@ -124,8 +125,10 @@ b = (double)(data[j].block_time) / 1E+09; sl += l; sb += b; - printf("%-50s: lock:%12ld(%20.9fs), block:%12ld(%20.9fs)\n", - name, data[j].lock_cnt, l, data[j].block_cnt, b); + lc = data[j].lock_cnt; + bc = data[j].block_cnt; + printf("%-50s: lock:%12lld(%20.9fs), block:%12lld(%20.9fs)\n", + name, lc, l, bc, b); } l = (double)time / 1E+09; printf("total profiling time: %20.9fs\n", l); diff -r 18758847bf31 xen/common/spinlock.c --- a/xen/common/spinlock.c Wed Oct 14 09:09:23 2009 +0100 +++ b/xen/common/spinlock.c Thu Oct 15 07:02:46 2009 +0200 @@ -354,13 +354,17 @@ static void spinlock_profile_print_elem(struct lock_profile *data, int32_t type, int32_t idx, void *par) { + long long int lc, bc; + if (type == LOCKPROF_TYPE_GLOBAL) printk("%s %s:\n", lock_profile_ancs[idx].name, data->name); else printk("%s %d %s:\n", lock_profile_ancs[idx].name, idx, data->name); - printk(" lock:%12ld(%08X:%08X), block:%12ld(%08X:%08X)\n", - data->lock_cnt, (u32)(data->time_hold >> 32), (u32)data->time_hold, - data->block_cnt, (u32)(data->time_block >> 32), (u32)data->time_block); + lc = data->lock_cnt; + bc = data->block_cnt; + printk(" lock:%12lld(%08X:%08X), block:%12lld(%08X:%08X)\n", + lc, (u32)(data->time_hold >> 32), (u32)data->time_hold, + bc, (u32)(data->time_block >> 32), (u32)data->time_block); return; } --------------090008080708030108090407 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------090008080708030108090407--