From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: [PATCH 6 of 8] xenalyze: Eliminate unnecessary cycles_to_time calculation Date: Thu, 26 Jan 2012 17:21:03 +0000 Message-ID: <108d0235440318d51a33.1327598463@elijah> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: george.dunlap@eu.citrix.com List-Id: xen-devel@lists.xenproject.org The time elements are only really accessed in dump mode, but they cost a significant amount to calculate per record. Only calculate them if we're in dump mode. Signed-off-by: George Dunlap diff -r 4b3639bd3255 -r 108d02354403 xenalyze.c --- a/xenalyze.c Thu Jan 26 17:17:19 2012 +0000 +++ b/xenalyze.c Thu Jan 26 17:17:53 2012 +0000 @@ -8601,9 +8601,6 @@ void process_record_tsc(tsc_t order_tsc, P.now = tsc; } - - /* Convert to s/ns once for convenience */ - abs_cycles_to_time(ri->tsc, &ri->t); } /* Standardized part of dump output */ @@ -8615,6 +8612,8 @@ void create_dump_header(struct record_in len = DUMP_HEADER_MAX; c = ri->dump_header; + abs_cycles_to_time(ri->tsc, &ri->t); + if ( ri->t.time ) { r=snprintf(c, len, "%3u.%09u", ri->t.s, ri->t.ns);