PIPS
|
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include "genC.h"
#include "misc.h"
Go to the source code of this file.
Data Structures | |
struct | debug_level |
Macros | |
#define | STACK_LENGTH 50 |
#define | MAX_MARGIN (8) |
Functions | |
void | set_debug_level (const int l) |
SET_DEBUG_LEVEL is a function that sets the current debuging level to the value passed as argument. More... | |
int | get_debug_level (void) |
GET_DEBUG_LEVEL returns the current debugging level. More... | |
_int | get_debug_stack_pointer (void) |
The pair get_ and set_debug_stack_pointer() should never be used except to clean up the stack after a long jump. More... | |
void | set_debug_stack_pointer (const int i) |
void | debug_on_function (const char *env, const char *function, const char *file, const int line) |
void | debug_off_function (const char *function, const char *file, const int line) |
void | print_debug_stack (void) |
function used to debug (can be called from dbx) BB 6.12.91 More... | |
void | debug (const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...) |
ARARGS0. More... | |
void | pips_debug_function (const int the_expected_debug_level, const char *a_message_format,...) |
pips_debug is a nice macro that depends on gcc to generate the function name and to handle a variable number of arguments. More... | |
double | get_process_memory_size (void) |
double | get_process_gross_heap_size (void) |
Variables | |
int | the_current_debug_level = 0 |
Debugging functions. More... | |
static debug_level | debug_stack [STACK_LENGTH] |
idls points to the first free bucket in debug_stack More... | |
static _int | idls = 0 |
#define MAX_MARGIN (8) |
void debug | ( | const int | the_expected_debug_level, |
const char * | calling_function_name, | ||
const char * | a_message_format, | ||
... | |||
) |
ARARGS0.
margin_length is the length of the part of the margin that is not used
If the current debug level is not high enough, do nothing:
print name of function printing debug message
print out remainder of message
the_expected_debug_level | he_expected_debug_level |
calling_function_name | alling_function_name |
a_message_format | _message_format |
Definition at line 189 of file debug.c.
References fprintf(), MAX_MARGIN, and the_current_debug_level.
Referenced by abbrev_menu_event_filter_proc(), abbrev_menu_with_text_menu_notify(), add_common_variables_to_hash_table(), add_loop_skip_condition(), adg_build_Psysteme(), adg_compact_quast(), adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), adg_decreasing_stat_order_sort(), adg_dup_disjunctive_nodes(), adg_enrichir(), adg_fill_with_quast(), adg_fprint_pred(), adg_fprint_predicate_list(), adg_get_conjonctions(), adg_get_disjunctions(), adg_get_exec_domain(), adg_get_integer_entity(), adg_get_predicate_of_loops(), adg_get_read_entity_vertices(), adg_get_write_entity_vertices(), adg_list_same_order_in_dg(), adg_list_to_vect(), adg_make_disjunctions(), adg_max_of_leaves(), adg_merge_entities_lists(), adg_number_of_same_loops(), adg_number_to_vertex(), adg_only_call_WR_dependence(), adg_path_max_source(), adg_path_possible_source(), adg_predicate_list_dup(), adg_pure_dfg(), adg_pure_dfg2(), adg_quast_leaf_label_equal_p(), adg_quast_leaf_solution_equal_p(), adg_rename_entities(), adg_reorder_statement_number(), adg_reverse_graph(), adg_same_dfg_vertex_number(), adg_same_order_in_dg(), adg_same_order_in_dvl(), adg_sc_dup(), adg_suppress_2nd_in_1st_ps(), adg_update_dfg(), adg_vertex_to_ordering(), adg_write_reference_list(), affect_comp_regions(), array_bound_check_bottom_up(), array_bound_check_interprocedural(), atomize_one_message(), atomizer_of_block(), atomizer_of_expression(), atomizer_of_loop(), atomizer_of_statement(), atomizer_of_test(), atomizer_of_unstructured(), attach_to_character_region(), attach_to_word_list(), basic_of_constant(), block_to_postcondition(), bound_distribution(), bound_generation(), build_and_test_dependence_context(), build_image_base(), build_sc_machine(), build_sc_with_several_uniform_ref(), build_trail(), c_statement(), call_instruction_to_communications(), check_first_statement(), check_range_wrt_precondition(), choose_one_syntax_in_references_list(), classify_reference(), close_workspace_notify(), comp_regions_of_implied_do(), comp_regions_of_ioelem(), comp_regions_of_iolist(), complex_bound_computation(), complex_bound_generation(), compute_iteration_domain(), conflict_dup(), constraint_distribution(), control_to_label_name(), create_tile_basis(), creer_nom_entite(), creer_nom_var(), current_module(), deal_with_attachment_boundary(), deal_with_attachments_at_this_character(), declaration_with_overlaps(), DeclareVariable(), decorate_trail(), defs_elim_of_assign_call(), defs_elim_of_statement(), defs_elim_of_unstructured(), dependance_vertices_p(), dfg_vertex_label_dup(), dg_arc_label_dup(), dg_vertex_dup(), dg_vertex_label_dup(), directory_gen_pullright(), display_memory_usage(), do_it(), edge_weight(), EffectsInfDifference(), EffectsSupDifference(), egalite_distribution(), end_query_pad_notify(), epips_execute_command(), EvalBinaryOp(), event_procedure(), expression_int_scalar(), fetch_callees_complexities(), find_iteration_domain(), flinter(), formal_and_actual_parameters_association(), formal_array_resizing_bottom_up(), full_unroll_pragma(), generate_one_message(), genref_statement(), get_more_derived_resources(), GetChar(), gpips_main_loop(), hpfc_overlap_kill_unused_scalars_rewrite(), hyperplane(), in_effect_list_p(), init_cost_table(), init_host_and_node_entities(), interactive_hyperplane_direction(), interactive_partitioning_matrix(), io_comp_regions(), IsCapKeyword(), iteration_domain_from_statement(), local_entity_of_module_p(), logical_expression_p(), loop_bounds_to_tile_bounds(), loop_increment_value(), loop_index_domaine_to_contrainte(), loop_iteration_domaine_to_sc(), loop_nest_to_local_variables(), loop_nest_to_wp65_code(), loop_strip_mine(), loop_to_postcondition(), lower_bound_generation(), main(), make(), make_all_movement_blocks(), make_datum_movement(), make_emulated_shared_variable(), make_lin_op_exp(), make_load_blocks(), make_movements_loop_body_wp65(), make_new_local_variables(), make_nlc_entity(), make_nsp_entity(), make_nub_entity(), make_op_exp(), make_scanning_over_one_tile(), make_scanning_over_tiles(), make_store_blocks(), make_tile_constraints(), MakeAtom(), MakeLabel(), MakeNewLabelledStatement(), MakeStatement(), message_manageable_p(), messages_handling(), module_name_to_preconditions(), module_to_wp65_modules(), movement_computation(), my_adg_expressions_to_predicate(), nlc_linear_expression_p(), no_write_comp_regions(), normal_expression_of_statement(), normal_expression_of_unstructured(), old_array_bound_check_instrumentation(), old_reductions(), old_summary_precondition(), Overlap_Analysis(), parametric_statement_feasible_p(), partial_eval_reference(), pip_solve(), pip_solve_min_with_big(), pips_malloc_debug(), prgm_mapping(), PrintData(), proper_comp_regions_of_intrinsic(), query_canvas_event_proc(), read_commands_from_emacs(), read_reference_list(), ReadLine(), reference_conflicting_p(), reference_conflicting_test_and_update(), reference_conversion_expression(), reference_conversion_statement(), region_dynamic_var_elim(), region_exact_projection_along_parameters(), region_exact_projection_along_variables(), region_non_exact_projection_along_parameters(), region_sc_projection_ofl_along_parameter(), RegionsEntitiesInfDifference(), RegionsInfDifference(), RegionsIntersection(), RegionsMayUnion(), RegionsMustUnion(), RegionsSupDifference(), remove_useless_continue_or_empty_code_in_unstructured(), restructure_if_then_else(), ReuseLabelledStatement(), rice_loop(), rice_update_dependence_graph(), sc_faisabilite_optim(), sc_image_computation(), sc_minmax_of_variable_optim(), sc_proj_on_di(), sc_to_tableau(), scalar_assign_call(), scalar_written_in_call(), schoose_abbrev_menu_with_text_text_notify(), set_control_to_label(), set_dimensions_of_local_variable_family(), set_dimensions_of_local_variables(), set_first_format_statement(), sort_unknowns(), st_arguments(), st_declarations(), st_declarations_comment(), st_declarations_init(), st_statement(), statement_does_return(), statement_to_communications(), statement_to_label(), stco_common_loops_of_statements(), strip_mine(), summary_total_postcondition(), test_bound_generation(), test_to_postcondition(), TestDependence(), text_unstructured(), tile_hyperplane_constraints(), tile_membership(), tile_membership_constraints(), transformer_general_consistency_p(), undefined_statement_list_p(), unframe_commands_from_emacs(), uniform_dependence_p(), unstructured_reorder(), unstructured_to_total_precondition(), unstructured_while_p(), update_basis(), update_common_layout(), update_common_sizes(), update_options(), update_summary_precondition(), update_used_labels(), upper_bound_generation(), wp65(), wp65_conform_p(), wp65_debug_print_text(), wpips_main_loop(), and xml_declarations_with_explicit_motif().
void debug_off_function | ( | const char * | function, |
const char * | file, | ||
const int | line | ||
) |
function | unction |
file | ile |
line | ine |
Definition at line 135 of file debug.c.
References current, debug_stack, idls, level, line, pips_assert, pips_internal_error, same_string_p, and set_debug_level().
void debug_on_function | ( | const char * | env, |
const char * | function, | ||
const char * | file, | ||
const int | line | ||
) |
env | nv |
function | unction |
file | ile |
line | ine |
Definition at line 112 of file debug.c.
References debug_stack, env, debug_level::file, debug_level::function, idls, debug_level::level, debug_level::line, line, debug_level::name, pips_assert, set_debug_level(), and STACK_LENGTH.
int get_debug_level | ( | void | ) |
GET_DEBUG_LEVEL returns the current debugging level.
Definition at line 67 of file debug.c.
References the_current_debug_level.
Referenced by adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), adg_fill_with_quast(), adg_get_disjunctions(), adg_get_exec_domain(), adg_get_integer_entity(), adg_get_predicate_of_loops(), adg_rename_entities(), adg_update_dfg(), analyze_quast(), array_dfg(), atomizer(), average_probability_matrix(), better_elim_var_with_eg(), bound_compute(), broadcast_conditions(), build_bdt_null(), build_contraction_matrices(), build_first_comb(), build_list_of_min(), build_new_ref(), build_second_comb(), build_third_comb(), build_third_subcomb(), calculate_delay(), change_base_in_sc(), cmf_layout_align(), compatible_pc_p(), constraint_to_bound(), controls_to_hash_table(), count_dataflows_on_ref(), count_implicit_equation(), craft_layout_align(), create_farkas_poly(), cutting_conditions(), dataflows_on_reference(), edge_weight(), find_implicit_equation(), full_loop_unroll(), get_bounds_expression(), get_number_of_ins(), get_unsatisfied_system(), include_trans_on_LC_in_ref(), init_use_preconditions(), is_not_trivial_p(), lhs_subs_in_ins(), list_of_exp_equals_1n_p(), loop_strip_mine(), loops_mapping_of_statement(), make_bounds(), make_causal_external(), make_causal_internal(), make_layout_statement(), make_primal(), make_reindex(), make_shared_statement(), mapping_on_broadcast(), matrix_to_system(), my_adg_expressions_to_predicate(), my_build_new_ref(), my_substitute_var_with_vec(), new_elim_var_with_eg(), node_successors_to_matrix(), nullify_factors(), old_reductions(), partial_broadcast_coefficients(), partial_eval_statement(), partial_eval_syntax(), partition_unknowns(), pip_solve(), pip_solve_min_with_big(), pips_malloc_debug(), plc_elim_var_with_eg(), plc_make_distance(), plc_make_vvs_with_vector(), predicate_to_expression(), prepare_array_bounds(), prepare_reindexing(), prgm_mapping(), print_array_dfg(), print_bdt(), print_parallelizedCMF_code(), print_parallelizedCRAFT_code(), print_plc(), prototype_dimension(), psystem_to_expression(), re_do_it(), reference_filter(), reindexing(), rm_non_x_var(), sa_do_it(), sc_to_tableau(), scheduling(), search_scc_bdt(), separate_variables(), separate_variables_2(), simplify_bdt(), simplify_dimension(), single_assign(), solve_system_by_succ_elim(), unstructured_to_complexity(), valuer(), and wpips_xview_error().
_int get_debug_stack_pointer | ( | void | ) |
The pair get_ and set_debug_stack_pointer() should never be used except to clean up the stack after a long jump.
Definition at line 92 of file debug.c.
References idls.
Referenced by catch_user_error(), push_pips_context(), safe_do_something(), and tpips_exec().
double get_process_gross_heap_size | ( | void | ) |
mallinfo is not portable
This is used part of the heap, but it may be bigger
struct mallinfo heap_info = mallinfo();
double memory_size = (heap_info.uordbytes)/(double)(1 << 20);
sbrk(0))/(double)(1 << 20)
Definition at line 254 of file debug.c.
Referenced by apply_a_rule(), logs_off(), and logs_on().
double get_process_memory_size | ( | void | ) |
This is about the always increasing swap space
etext is not portable. it is not even documented on SUN:-)
extern etext; double memory_size = (sbrk(0) - etext)/(double)(1 << 20);
void pips_debug_function | ( | const int | the_expected_debug_level, |
const char * | a_message_format, | ||
... | |||
) |
pips_debug is a nice macro that depends on gcc to generate the function name and to handle a variable number of arguments.
if these feature are not available, it will be this function. the function name won't be available. FC May 95.
If the current debug level is not high enough, do nothing:
print out remainder of message
the_expected_debug_level | he_expected_debug_level |
a_message_format | _message_format |
Definition at line 224 of file debug.c.
References fprintf(), and the_current_debug_level.
void print_debug_stack | ( | void | ) |
void set_debug_level | ( | const int | l | ) |
SET_DEBUG_LEVEL is a function that sets the current debuging level to the value passed as argument.
Valid debuging values are from 0 to 9. 0 means no debug, 9 means extensive debug. Other values are illegal.
Definition at line 60 of file debug.c.
References message_assert, and the_current_debug_level.
Referenced by debug_off_function(), debug_on_function(), and set_debug_stack_pointer().
void set_debug_stack_pointer | ( | const int | i | ) |
Definition at line 97 of file debug.c.
References debug_stack, idls, level, pips_internal_error, pips_user_warning, and set_debug_level().
Referenced by catch_user_error(), pop_pips_context(), safe_do_something(), and tpips_exec().
|
static |
idls points to the first free bucket in debug_stack
Definition at line 85 of file debug.c.
Referenced by debug_off_function(), debug_on_function(), print_debug_stack(), and set_debug_stack_pointer().
|
static |
Definition at line 86 of file debug.c.
Referenced by debug_off_function(), debug_on_function(), get_debug_stack_pointer(), print_debug_stack(), and set_debug_stack_pointer().
int the_current_debug_level = 0 |
Debugging functions.
Copyright 2007, 2008 Alain Muller, Frederique Silber-Chaussumier.
cproto-generated files
Modifications:
debug.c
Definition at line 53 of file debug.c.
Referenced by debug(), get_debug_level(), outliner_patch_parameters(), pips_debug_function(), and set_debug_level().