|
From: <sv...@va...> - 2006-12-23 23:11:25
|
Author: weidendo
Date: 2006-12-23 23:11:20 +0000 (Sat, 23 Dec 2006)
New Revision: 6414
Log:
Callgrind: Throttle calls CLG_(run_thread) after r6413
After the change in r6413, CLG_(run_thread) is called a
lot more often, increasing the polling overhead to check
for a callgrind command file (created by callgrind_control
for controlling a callgrind run in an interactive way).
This reduces the calls to only be done every 5000 BBs,
which gives a similar polling frequency as before.
=20
Modified:
trunk/callgrind/main.c
Modified: trunk/callgrind/main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/callgrind/main.c 2006-12-23 01:21:12 UTC (rev 6413)
+++ trunk/callgrind/main.c 2006-12-23 23:11:20 UTC (rev 6414)
@@ -1026,13 +1026,19 @@
Bool is_running,=20
ULong blocks_done )
{
+ static ULong last_blocks_done =3D 0;
+
if (0)
VG_(printf)("%d %c %llu\n",=20
(Int)tid, is_running ? 'R' : 's', blocks_done);
- /* Simply call onwards to CLG_(run_thread). Maybe this can be
- simplified later? */
- if (is_running)
- CLG_(run_thread)( tid );
+
+ if (!is_running) return;
+
+ /* throttle calls to CLG_(run_thread) by number of BBs executed */
+ if (blocks_done - last_blocks_done < 5000) return;
+ last_blocks_done =3D blocks_done;
+
+ CLG_(run_thread)( tid );
}
=20
static
|