TRACE_paje_start();
/* activate trace */
- TRACE_activate ();
+ xbt_assert (trace_active==0, "Tracing is already active.");
+ trace_active = 1;
+ XBT_DEBUG ("Tracing is on");
/* other trace initialization */
created_categories = xbt_dict_new();
int TRACE_end()
{
- if (!TRACE_is_active())
+ if (!trace_active)
return 1;
/* generate uncategorized graph configuration for triva */
/* close the trace file */
TRACE_paje_end();
- /* activate trace */
- TRACE_desactivate ();
- XBT_DEBUG("Tracing system is shutdown");
- return 0;
-}
-
-void TRACE_activate (void)
-{
- xbt_assert (trace_active==0, "Tracing is already active.");
- trace_active = 1;
- XBT_DEBUG ("Tracing is on");
-}
-
-void TRACE_desactivate (void)
-{
+ /* de-activate trace */
trace_active = 0;
XBT_DEBUG ("Tracing is off");
-}
-
-int TRACE_is_active (void)
-{
- return trace_active;
+ XBT_DEBUG("Tracing system is shutdown");
+ return 0;
}
int TRACE_needs_platform (void)
void TRACE_category_with_color (const char *category, const char *color)
{
- if (!(TRACE_is_active() && category != NULL))
+ if (!(TRACE_categorized() && category != NULL))
return;
xbt_assert (instr_platform_traced(),
XBT_DEBUG("CAT,declare %s, %s", category, final_color);
//define the type of this category on top of hosts and links
- if (TRACE_categorized ()){
- instr_new_variable_type (category, final_color);
- }
+ instr_new_variable_type (category, final_color);
}
void TRACE_declare_mark(const char *mark_type)
{
- if (!TRACE_is_active())
+ if (!TRACE_is_enabled())
return;
if (!mark_type)
return;
void TRACE_mark(const char *mark_type, const char *mark_value)
{
- if (!TRACE_is_active())
+ if (!TRACE_is_enabled())
return;
if (!mark_type || !mark_value)
return;
double value,
InstrUserVariable what)
{
- if (!TRACE_is_active())
+ if (!TRACE_is_enabled())
return;
xbt_assert (instr_platform_traced(),
*/
void TRACE_msg_set_task_category(m_task_t task, const char *category)
{
- if (!TRACE_is_active())
+ if (!TRACE_categorized())
return;
xbt_assert(task->category == NULL, "Task %p(%s) already has a category (%s).",
/* from instr_config.c */
int TRACE_start (void);
int TRACE_end (void);
-void TRACE_activate (void);
-void TRACE_desactivate (void);
-int TRACE_is_active (void);
int TRACE_needs_platform (void);
int TRACE_is_enabled(void);
int TRACE_platform(void);
double value, double now,
double delta)
{
- if (!TRACE_is_active())
- return;
- if (!value)
- return;
//only trace link utilization if link is known by tracing mechanism
if (!knownContainerWithName(resource))
return;
double value, double now,
double delta)
{
- if (!TRACE_is_active())
- return;
//only trace host utilization if host is known by tracing mechanism
if (!knownContainerWithName(resource))
return;
void TRACE_sd_set_task_category(SD_task_t task, const char *category)
{
- if (!TRACE_is_active())
+ if (!TRACE_is_enabled())
return;
task->category = xbt_strdup (category);
}
void TRACE_smx_host_execute(smx_action_t act)
{
- if (!TRACE_is_active()) return;
+ if (!TRACE_is_enabled()) return;
return;
}
void TRACE_smx_action_communicate(smx_action_t act, smx_process_t proc)
{
- if (!TRACE_is_active()) return;
+ if (!TRACE_is_enabled()) return;
return;
}
void TRACE_smx_action_destroy(smx_action_t act)
{
- if (!TRACE_is_active()) return;
+ if (!TRACE_is_enabled()) return;
return;
}
void TRACE_surf_host_set_power(double date, const char *resource, double power)
{
- if (!TRACE_is_active())
+ if (!TRACE_is_enabled())
return;
container_t container = getContainerByName(resource);
void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth)
{
- if (!TRACE_is_active())
+ if (!TRACE_is_enabled())
return;
container_t container = getContainerByName(resource);
//FIXME: this function is not used (latency availability traces support exists in surf network models?)
void TRACE_surf_link_set_latency(double date, const char *resource, double latency)
{
- if (!TRACE_is_active())
+ if (!TRACE_is_enabled())
return;
container_t container = getContainerByName(resource);
void TRACE_surf_action(surf_action_t surf_action, const char *category)
{
- if (!TRACE_is_active())
+ if (!TRACE_is_enabled())
return;
if (!TRACE_categorized ())
return;
/* Try to send it by calling SIMIX network layer */
TRY {
#ifdef HAVE_TRACING
- if (TRACE_is_active()) {
+ if (TRACE_is_enabled()) {
comm = SIMIX_req_comm_isend(mailbox, t_simdata->message_size,
t_simdata->rate, task, sizeof(void *),
NULL, NULL, 0);
xbt_swag_foreach_safe(action, next_action, running_actions) {
#ifdef HAVE_TRACING
- if (TRACE_is_active()) {
+ if (TRACE_is_enabled()) {
cpu_Cas01_t x =
lmm_constraint_id(lmm_get_cnst_from_var
(cpu_maxmin_system, action->variable, 0));
(action).variable) * (now -
cpu->last_update));
#ifdef HAVE_TRACING
- if (TRACE_is_active()) {
+ if (TRACE_is_enabled()) {
TRACE_surf_host_set_utilization(cpu->generic_resource.name,
action->
generic_lmm_action.generic_action.
GENERIC_ACTION(action).finish = surf_get_clock();
/* set the remains to 0 due to precision problems when updating the remaining amount */
#ifdef HAVE_TRACING
- if (TRACE_is_active()) {
+ if (TRACE_is_enabled()) {
cpu_Cas01_im_t cpu = ((cpu_Cas01_im_t)(action->cpu));
TRACE_surf_host_set_utilization(cpu->generic_resource.name,
action->generic_lmm_action.generic_action.data,
cpu_im_update_remains(action->cpu, surf_get_clock());
}
#ifdef HAVE_TRACING
- if (TRACE_is_active()) {
+ if (TRACE_is_enabled()) {
//defining the last timestamp that we can safely dump to trace file
//without losing the event ascending order (considering all CPU's)
void **data;
action->weight);
}
#ifdef HAVE_TRACING
- if (TRACE_is_active()) {
+ if (TRACE_is_enabled()) {
xbt_dynar_t route = global_routing->get_route(action->src_name,
action->dst_name);
link_CM02_t link;
/* LARGE PLATFORMS HACK:
expand also with src->link and dst->link */
#ifdef HAVE_TRACING
- if (TRACE_is_active()) {
+ if (TRACE_is_enabled()) {
action->src_name = xbt_strdup(src_name);
action->dst_name = xbt_strdup(dst_name);
} else {
action->generic_action.remains);
#ifdef HAVE_TRACING
- if (TRACE_is_active()) {
+ if (TRACE_is_enabled()) {
double last_amount_sent = (action->generic_action.cost - action->last_remains);
double amount_sent = (action->generic_action.cost - action->generic_action.remains);
/* LARGE PLATFORMS HACK:
expand also with src->link and dst->link */
#ifdef HAVE_TRACING
- if (TRACE_is_active()) {
+ if (TRACE_is_enabled()) {
action->src_name = xbt_strdup(src_name);
action->dst_name = xbt_strdup(dst_name);
} else {