Skip navigation

Profiling a huge beast such as OpenOffice.org is clearly a stress for any tool – in this case, it blew the callgrind backend for the valgrind analysis framework. Valgrind seems to reserve a fixed amount of virtual mem for the actual program – if that gets exceeded, strange things will happen, in my case, debug symbols for my libs weren’t loaded (and, guess what, a profile with only hex function labels is kind of unhelpful).

What I finally made to work was the following setup:
callgrind-0.10.0 on top of valgrind-3.0.1, with the following two patches:

--- configure~	2005-08-30 03:15:16.000000000 +0200
+++ configure	2005-11-24 14:27:36.000000000 +0100
@@ -3991,7 +3991,7 @@
 	echo "$as_me:$LINENO: result: ok (${host_cpu})" >&5
 echo "${ECHO_T}ok (${host_cpu})" >&6
         VG_ARCH="x86"
-        KICKSTART_BASE="0xb0000000"
+        KICKSTART_BASE="0xa0000000"
         ARCH_CORE_AM_CFLAGS="@FLAG_M32@ @PREFERRED_STACK_BOUNDARY@"
         ARCH_TOOL_AM_CFLAGS="@FLAG_M32@ @PREFERRED_STACK_BOUNDARY@"
         ARCH_CORE_AM_CCASFLAGS="@FLAG_M32@"

(this one adds 256MB additional space for the program to be analyzed – thanks to Yuri’s mail)

and

--- main.c~	2005-10-04 01:28:01.000000000 +0200
+++ main.c	2005-11-24 13:46:13.000000000 +0100
@@ -274,7 +274,7 @@
    if (bb_seen_before) {
        CLG_ASSERT(ii->instr_offset == instr_offset);
        CLG_ASSERT(ii->instr_size == instrLen);
-       CLG_ASSERT(ii->data_size == dataSize);
+       //CLG_ASSERT(ii->data_size == dataSize);
        CLG_ASSERT(ii->cost_offset == *cost_offset);
        CLG_ASSERT(ii->eventset == es);
    }

(which silences an assertion – the error itself apparently did no harm, things went smoothly after that).

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: