|
From: <sv...@va...> - 2005-06-19 18:38:27
|
Author: njn
Date: 2005-06-19 19:38:24 +0100 (Sun, 19 Jun 2005)
New Revision: 3954
Log:
Move VG_(bbs_done) out of main and make it local in scheduler.c. This
removes the dependence of m_translate.c and m_libcassert.c on m_main.c.
Modified:
trunk/coregrind/m_errormgr.c
trunk/coregrind/m_libcassert.c
trunk/coregrind/m_main.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_translate.c
trunk/coregrind/m_transtab.c
trunk/coregrind/pub_core_main.h
trunk/coregrind/pub_core_translate.h
Modified: trunk/coregrind/m_errormgr.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/coregrind/m_errormgr.c 2005-06-19 17:52:41 UTC (rev 3953)
+++ trunk/coregrind/m_errormgr.c 2005-06-19 18:38:24 UTC (rev 3954)
@@ -750,7 +750,8 @@
if ((i+1 =3D=3D VG_(clo_dump_error))) {
StackTrace ips =3D VG_(extract_StackTrace)(p_min->where);
VG_(translate) ( 0 /* dummy ThreadId; irrelevant due to debuggi=
ng*/,
- ips[0], /*debugging*/True, 0xFE/*verbosity*/);
+ ips[0], /*debugging*/True, 0xFE/*verbosity*/,
+ /*bbs_done*/0);
}
=20
p_min->count =3D 1 << 30;
Modified: trunk/coregrind/m_libcassert.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/coregrind/m_libcassert.c 2005-06-19 17:52:41 UTC (rev 3953)
+++ trunk/coregrind/m_libcassert.c 2005-06-19 18:38:24 UTC (rev 3954)
@@ -34,8 +34,7 @@
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
-#include "pub_core_main.h" // for VG_(bbs_done) -- stupid!
-#include "pub_core_options.h" // for VG_(bbs_done) -- stupid!
+#include "pub_core_options.h"
#include "pub_core_stacktrace.h"
#include "pub_core_syscall.h"
#include "pub_core_tooliface.h"
@@ -110,7 +109,9 @@
VG_(get_StackTrace2)(ips, BACKTRACE_DEPTH, ip, sp, fp, sp, stacktop);
VG_(pp_StackTrace) (ips, BACKTRACE_DEPTH);
=20
- VG_(printf)("\nBasic block ctr is approximately %llu\n", VG_(bbs_done=
) );
+ // Don't print this, as it's not terribly interesting and avoids a
+ // dependence on m_scheduler/, which would be crazy.
+ //VG_(printf)("\nBasic block ctr is approximately %llu\n", VG_(bbs_do=
ne) );
=20
pp_sched_status();
VG_(printf)("\n");
Modified: trunk/coregrind/m_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/coregrind/m_main.c 2005-06-19 17:52:41 UTC (rev 3953)
+++ trunk/coregrind/m_main.c 2005-06-19 18:38:24 UTC (rev 3954)
@@ -125,14 +125,6 @@
static Char **vg_argv;
=20
=20
-/* ---------------------------------------------------------------------
- Running stuff =20
- ------------------------------------------------------------------ */
-
-/* 64-bit counter for the number of basic blocks done. */
-ULong VG_(bbs_done) =3D 0;
-
-
/*=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=3D*/
/*=3D=3D=3D Counters, for profiling purposes only =
=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=3D=3D=3D=3D*/
@@ -145,8 +137,6 @@
{
// Translation stats
VG_(print_tt_tc_stats)();
- VG_(message)(Vg_DebugMsg,
- " dispatch: %llu jumps (bb entries).", VG_(bbs_done) );
=20
// Scheduler stats
VG_(print_scheduler_stats)();
Modified: trunk/coregrind/m_scheduler/scheduler.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/coregrind/m_scheduler/scheduler.c 2005-06-19 17:52:41 UTC (rev =
3953)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-19 18:38:24 UTC (rev =
3954)
@@ -104,6 +104,9 @@
/* Counts downwards in VG_(run_innerloop). */
UInt VG_(dispatch_ctr);
=20
+/* 64-bit counter for the number of basic blocks done. */
+static ULong bbs_done =3D 0;
+
/* Forwards */
static void do_client_request ( ThreadId tid );
static void scheduler_sanity ( ThreadId tid );
@@ -117,7 +120,9 @@
void VG_(print_scheduler_stats)(void)
{
VG_(message)(Vg_DebugMsg,
- " %d/%d major/minor sched events.",=20
+ "scheduler: %llu jumps (bb entries).", bbs_done );
+ VG_(message)(Vg_DebugMsg,
+ "scheduler: %d/%d major/minor sched events.",=20
n_scheduling_events_MAJOR, n_scheduling_events_MINOR);
}
=20
@@ -419,7 +424,7 @@
done_this_time =3D (Int)dispatch_ctr_SAVED - (Int)VG_(dispatch_ctr) -=
0;
=20
vg_assert(done_this_time >=3D 0);
- VG_(bbs_done) +=3D (ULong)done_this_time;
+ bbs_done +=3D (ULong)done_this_time;
=20
VGP_POPCC(VgpRun);
return trc;
@@ -561,7 +566,7 @@
found =3D VG_(search_transtab)( NULL, ip, True/*upd_fast_cache*/ );
if (!found) {
/* Not found; we need to request a translation. */
- if (VG_(translate)( tid, ip, /*debug*/False, 0/*not verbose*/ )) {
+ if (VG_(translate)( tid, ip, /*debug*/False, 0/*not verbose*/, bbs=
_done )) {
found =3D VG_(search_transtab)( NULL, ip, True );=20
vg_assert2(found, "VG_TRC_INNER_FASTMISS: missing tt_fast entry=
");
=20
Modified: trunk/coregrind/m_translate.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/coregrind/m_translate.c 2005-06-19 17:52:41 UTC (rev 3953)
+++ trunk/coregrind/m_translate.c 2005-06-19 18:38:24 UTC (rev 3954)
@@ -36,7 +36,6 @@
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
-#include "pub_core_main.h" // for VG_(bbs_done)
#include "pub_core_options.h"
#include "pub_core_profile.h"
#include "pub_core_redir.h"
@@ -417,7 +416,8 @@
Bool VG_(translate) ( ThreadId tid,=20
Addr64 orig_addr,
Bool debugging_translation,
- Int debugging_verbosity )
+ Int debugging_verbosity,
+ ULong bbs_done )
{
Addr64 redir, orig_addr0 =3D orig_addr;
Int tmpbuf_used, verbosity;
@@ -501,9 +501,9 @@
Char fnname[64] =3D "";
VG_(get_fnname_w_offset)(orig_addr, fnname, 64);
VG_(printf)(
- "=3D=3D=3D=3D BB %d %s(0x%llx) approx BBs exec'd %lld =3D=3D=
=3D=3D\n",
+ "=3D=3D=3D=3D BB %d %s(0x%llx) BBs exec'd %lld =3D=3D=3D=3D=
\n",
VG_(get_bbs_translated)(), fnname, orig_addr,=20
- VG_(bbs_done));
+ bbs_done);
}
=20
if (seg =3D=3D NULL ||
Modified: trunk/coregrind/m_transtab.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/coregrind/m_transtab.c 2005-06-19 17:52:41 UTC (rev 3953)
+++ trunk/coregrind/m_transtab.c 2005-06-19 18:38:24 UTC (rev 3954)
@@ -798,7 +798,7 @@
score_cumul, buf_cumul,
score_here, buf_here, tops[r]->entry, name );
VG_(printf)("\n");
- VG_(translate)(0, tops[r]->entry, True, VG_(clo_profile_flags));
+ VG_(translate)(0, tops[r]->entry, True, VG_(clo_profile_flags), 0)=
;
VG_(printf)("=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
end BB rank %d "
"=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
\n\n", r);
}
Modified: trunk/coregrind/pub_core_main.h
=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/coregrind/pub_core_main.h 2005-06-19 17:52:41 UTC (rev 3953)
+++ trunk/coregrind/pub_core_main.h 2005-06-19 18:38:24 UTC (rev 3954)
@@ -51,9 +51,6 @@
/* Something of a function looking for a home ... start up debugger. */
extern void VG_(start_debugger) ( ThreadId tid );
=20
-/* 64-bit counter for the number of basic blocks done. */
-extern ULong VG_(bbs_done);
-
// Set up the libc freeres wrapper=20
extern void VG_(set_libc_freeres_wrapper_addr)(Addr);
=20
Modified: trunk/coregrind/pub_core_translate.h
=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/coregrind/pub_core_translate.h 2005-06-19 17:52:41 UTC (rev 395=
3)
+++ trunk/coregrind/pub_core_translate.h 2005-06-19 18:38:24 UTC (rev 395=
4)
@@ -40,7 +40,8 @@
Bool VG_(translate) ( ThreadId tid,=20
Addr64 orig_addr,
Bool debugging_translation,
- Int debugging_verbosity );
+ Int debugging_verbosity,
+ ULong bbs_done );
=20
#endif // __PUB_CORE_TRANSLATE_H
=20
|