[m-rev.] for review: deep profiling, non grades and lcc
Zoltan Somogyi
zs at cs.mu.OZ.AU
Wed Jun 6 17:46:30 AEST 2001
This contains a cleaner solution than Pete's, but I also left in Pete's change
for now.
Zoltan.
Make grade none.gc.profdeep work, and fix problems in the interaction
of deep profiling and lcc.
library/array.m:
library/builtin.m:
library/std_util.m:
Add declarations for the labels defined in deep profiling grades,
since "none" grades need them.
runtime/mercury_deep_profiling.h:
Put the parts of this file that are needed only in deep profiling
grades (i.e. most of it) inside #ifdef MR_DEEP_PROFILING. This fixes
the empty structure problem, and may make C compilation faster.
runtime/mercury_deep_profiling_hand.h:
Put the parts of this file that are needed only in deep profiling
grades (i.e. all of it) inside #ifdef MR_DEEP_PROFILING.
runtime/mercury_debug.[ch]:
Define and declare the function that prints deep profiling data
structures only if deep profiling is enabled.
cvs diff: Diffing .
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing library
Index: library/array.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/array.m,v
retrieving revision 1.93
diff -u -b -r1.93 array.m
--- library/array.m 2001/06/04 13:39:13 1.93
+++ library/array.m 2001/06/06 04:40:15
@@ -474,6 +474,19 @@
MR_declare_entry(mercury__array__array_equal_2_0);
MR_declare_entry(mercury__array__array_compare_3_0);
+#ifdef MR_DEEP_PROFILING
+MR_declare_label(mercury____Unify___array__array_1_0_i1);
+MR_declare_label(mercury____Unify___array__array_1_0_i2);
+MR_declare_label(mercury____Unify___array__array_1_0_i3);
+MR_declare_label(mercury____Unify___array__array_1_0_i4);
+MR_declare_label(mercury____Unify___array__array_1_0_i5);
+MR_declare_label(mercury____Unify___array__array_1_0_i6);
+MR_declare_label(mercury____Compare___array__array_1_0_i1);
+MR_declare_label(mercury____Compare___array__array_1_0_i2);
+MR_declare_label(mercury____Compare___array__array_1_0_i3);
+MR_declare_label(mercury____Compare___array__array_1_0_i4);
+#endif
+
MR_BEGIN_MODULE(array_module_builtins)
MR_init_entry(mercury____Unify___array__array_1_0);
MR_init_entry(mercury____Compare___array__array_1_0);
Index: library/builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.56
diff -u -b -r1.56 builtin.m
--- library/builtin.m 2001/06/04 13:39:14 1.56
+++ library/builtin.m 2001/06/06 05:19:46
@@ -1000,6 +1000,13 @@
MR_define_extern_entry(mercury__copy_2_0);
MR_define_extern_entry(mercury__copy_2_1);
+#ifdef MR_DEEP_PROFILING
+MR_declare_label(mercury__copy_2_0_i1);
+MR_declare_label(mercury__copy_2_0_i2);
+MR_declare_label(mercury__copy_2_1_i1);
+MR_declare_label(mercury__copy_2_1_i2);
+#endif
+
MR_BEGIN_MODULE(copy_module)
MR_init_entry(mercury__copy_2_0);
MR_init_entry(mercury__copy_2_1);
@@ -1158,6 +1165,15 @@
MR_declare_entry(mercury____Unify___builtin__c_pointer_0_0);
MR_declare_entry(mercury____Index___builtin__c_pointer_0_0);
MR_declare_entry(mercury____Compare___builtin__c_pointer_0_0);
+
+#ifdef MR_DEEP_PROFILING
+MR_declare_label(mercury____Unify___builtin__c_pointer_0_0_i1);
+MR_declare_label(mercury____Unify___builtin__c_pointer_0_0_i2);
+MR_declare_label(mercury____Unify___builtin__c_pointer_0_0_i3);
+MR_declare_label(mercury____Unify___builtin__c_pointer_0_0_i4);
+MR_declare_label(mercury____Compare___builtin__c_pointer_0_0_i1);
+MR_declare_label(mercury____Compare___builtin__c_pointer_0_0_i2);
+#endif
MR_BEGIN_MODULE(c_pointer_module)
MR_init_entry(mercury____Unify___builtin__c_pointer_0_0);
Index: library/std_util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
retrieving revision 1.232
diff -u -b -r1.232 std_util.m
--- library/std_util.m 2001/06/04 13:39:15 1.232
+++ library/std_util.m 2001/06/06 05:06:45
@@ -1267,6 +1267,15 @@
MR_define_extern_entry(mercury____Unify___std_util__type_desc_0_0);
MR_define_extern_entry(mercury____Compare___std_util__type_desc_0_0);
+#ifdef MR_DEEP_PROFILING
+MR_declare_label(mercury____Unify___std_util__type_desc_0_0_i1);
+MR_declare_label(mercury____Unify___std_util__type_desc_0_0_i2);
+MR_declare_label(mercury____Unify___std_util__type_desc_0_0_i3);
+MR_declare_label(mercury____Unify___std_util__type_desc_0_0_i4);
+MR_declare_label(mercury____Compare___std_util__type_desc_0_0_i1);
+MR_declare_label(mercury____Compare___std_util__type_desc_0_0_i2);
+#endif
+
MR_BEGIN_MODULE(type_desc_module)
MR_init_entry(mercury____Unify___std_util__type_desc_0_0);
MR_init_entry(mercury____Compare___std_util__type_desc_0_0);
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/mercury_debug.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_debug.c,v
retrieving revision 1.5
diff -u -b -r1.5 mercury_debug.c
--- runtime/mercury_debug.c 2001/05/31 06:00:11 1.5
+++ runtime/mercury_debug.c 2001/06/05 07:06:32
@@ -445,10 +445,11 @@
fprintf(fp, "\n");
}
+#ifdef MR_DEEP_PROFILING
+
void
MR_print_deep_prof_var(FILE *fp, const char *name, MR_CallSiteDynamic *csd)
{
-#ifdef MR_DEEP_PROFILING
fprintf(fp, "%s: %p", name, csd);
if (csd == NULL) {
@@ -506,5 +507,5 @@
ps->MR_ps_num_call_sites);
}
}
-#endif
}
+#endif
Index: runtime/mercury_debug.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_debug.h,v
retrieving revision 1.12
diff -u -b -r1.12 mercury_debug.h
--- runtime/mercury_debug.h 2001/05/31 06:00:11 1.12
+++ runtime/mercury_debug.h 2001/06/05 07:06:10
@@ -187,8 +187,11 @@
extern void MR_print_heapptr(FILE *fp, const MR_Word *s);
extern void MR_print_label(FILE *fp, /* const */ MR_Code *w);
extern void MR_printlabel(FILE *fp, /* const */ MR_Code *w);
+
+#ifdef MR_DEEP_PROFILING
extern void MR_print_deep_prof_var(FILE *fp, const char *name,
MR_CallSiteDynamic *csd);
+#endif
/*---------------------------------------------------------------------------*/
Index: runtime/mercury_deep_profiling.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_deep_profiling.h,v
retrieving revision 1.4
diff -u -b -r1.4 mercury_deep_profiling.h
--- runtime/mercury_deep_profiling.h 2001/06/05 12:36:59 1.4
+++ runtime/mercury_deep_profiling.h 2001/06/06 04:41:06
@@ -15,6 +15,30 @@
#include "mercury_ho_call.h"
#include <stdio.h>
+/*
+** These are needed by deep_profiler/read_profile.m even if it is compiled
+** in a grade in which deep profiling is not enabled.
+*/
+
+typedef enum {
+ MR_deep_token_end = 0,
+ MR_deep_token_root,
+ MR_deep_token_call_site_static,
+ MR_deep_token_call_site_dynamic,
+ MR_deep_token_proc_static,
+ MR_deep_token_proc_dynamic,
+ MR_deep_token_normal_call,
+ MR_deep_token_special_call,
+ MR_deep_token_higher_order_call,
+ MR_deep_token_method_call,
+ MR_deep_token_callback,
+ MR_deep_token_isa_predicate,
+ MR_deep_token_isa_function,
+ MR_deep_token_isa_compiler_generated
+} MR_Profile_Encoding_Token;
+
+#ifdef MR_DEEP_PROFILING
+
typedef enum {
MR_normal_call,
MR_special_call,
@@ -117,23 +141,6 @@
MR_CallSiteDynList *MR_csdlist_next;
};
-typedef enum {
- MR_deep_token_end = 0,
- MR_deep_token_root,
- MR_deep_token_call_site_static,
- MR_deep_token_call_site_dynamic,
- MR_deep_token_proc_static,
- MR_deep_token_proc_dynamic,
- MR_deep_token_normal_call,
- MR_deep_token_special_call,
- MR_deep_token_higher_order_call,
- MR_deep_token_method_call,
- MR_deep_token_callback,
- MR_deep_token_isa_predicate,
- MR_deep_token_isa_function,
- MR_deep_token_isa_compiler_generated
-} MR_Profile_Encoding_Token;
-
#define MR_enter_instrumentation() \
do { MR_inside_deep_profiling_code = TRUE; } while (0)
#define MR_leave_instrumentation() \
@@ -365,5 +372,7 @@
#define MR_PROFILING_MALLOC(type) MR_NEW(type)
#define MR_PROFILING_MALLOC_ARRAY(type, nelems) MR_NEW_ARRAY(type, nelems)
+
+#endif /* MR_DEEP_PROFILING */
#endif /* not MERCURY_DEEP_PROFILING_H */
Index: runtime/mercury_deep_profiling_hand.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_deep_profiling_hand.h,v
retrieving revision 1.3
diff -u -b -r1.3 mercury_deep_profiling_hand.h
--- runtime/mercury_deep_profiling_hand.h 2001/06/05 04:57:09 1.3
+++ runtime/mercury_deep_profiling_hand.h 2001/06/06 04:30:48
@@ -12,6 +12,8 @@
#ifndef MERCURY_DEEP_PROFILING_HAND_H
#define MERCURY_DEEP_PROFILING_HAND_H
+#ifdef MR_DEEP_PROFILING
+
#include "mercury_std.h"
#include "mercury_deep_profiling.h"
@@ -437,5 +439,7 @@
label, MR_ENTRY(proclabel)); \
MR_define_label(label); \
MR_update_prof_current_proc(MR_LABEL(proclabel))
+
+#endif /* MR_DEEP_PROFILING */
#endif /* MERCURY_DEEP_PROFILING_HAND_H */
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list