1 /* Copyright (c) 2007-2015. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef SIMGRID_MC_PRIVATE_H
8 #define SIMGRID_MC_PRIVATE_H
10 #include "simgrid_config.h"
12 #include <sys/types.h>
19 #include <elfutils/libdw.h>
21 #include <simgrid/msg.h>
23 #include <xbt/config.h>
27 #include "mc/datatypes.h"
28 #include "src/mc/mc_base.h"
30 #include "src/simix/smx_private.h"
31 #include "src/xbt/mmalloc/mmprivate.h"
34 #include "src/mc/mc_forward.hpp"
35 #include "src/xbt/memory_map.hpp"
38 #include "src/mc/mc_protocol.h"
42 /********************************* MC Global **********************************/
44 XBT_PRIVATE void MC_init_dot_output();
46 XBT_PRIVATE extern FILE *dot_output;
48 XBT_PRIVATE extern int user_max_depth_reached;
50 XBT_PRIVATE void MC_replay(xbt_fifo_t stack);
51 XBT_PRIVATE void MC_show_deadlock(smx_simcall_t req);
52 XBT_PRIVATE void MC_show_stack_safety(xbt_fifo_t stack);
53 XBT_PRIVATE void MC_dump_stack_safety(xbt_fifo_t stack);
54 XBT_PRIVATE void MC_show_non_termination(void);
56 /** Stack (of `mc_state_t`) representing the current position of the
57 * the MC in the exploration graph
59 * It is managed by its head (`xbt_fifo_shift` and `xbt_fifo_unshift`).
61 XBT_PRIVATE extern xbt_fifo_t mc_stack;
63 /****************************** Statistics ************************************/
65 typedef struct mc_stats {
66 unsigned long state_size;
67 unsigned long visited_states;
68 unsigned long visited_pairs;
69 unsigned long expanded_states;
70 unsigned long expanded_pairs;
71 unsigned long executed_transitions;
72 } s_mc_stats_t, *mc_stats_t;
74 XBT_PRIVATE extern mc_stats_t mc_stats;
76 XBT_PRIVATE void MC_print_statistics(mc_stats_t stats);
78 /********************************** Snapshot comparison **********************************/
83 /********************************** Miscellaneous **********************************/
85 XBT_PRIVATE void MC_report_assertion_error(void);
86 XBT_PRIVATE void MC_report_crash(int status);
95 XBT_PRIVATE void find_object_address(
96 std::vector<simgrid::xbt::VmMap> const& maps, simgrid::mc::ObjectInformation* result);
99 int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc::Snapshot* s2);