Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
buildsupport
Commits
fc436bed
Commit
fc436bed
authored
Jul 29, 2016
by
Maxime Perrotin
Browse files
Add debug mode for checkQ
parent
d2f8e032
Pipeline
#1064
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
c/preprocessing_backend.c
View file @
fc436bed
...
...
@@ -886,10 +886,21 @@ void Add_api(Process *node, FV_list *all_fv)
fv
->
name
,
fv
->
name
);
/* Debug mode - Unix platform, when env variable CHECKQ_DEBUG is set */
fprintf
(
header
,
"#ifdef __unix__
\n
"
"#include <stdbool.h>
\n
"
"#include <stdlib.h>
\n
"
"static bool debugCheckQ = false;
\n
"
"#endif
\n\n
"
);
fprintf
(
header
,
"void %s_startup();
\n\n
"
,
fv
->
name
);
fprintf
(
code
,
"void %s_startup()
\n
"
"{
\n
"
" /* TASTE API start up (nothing to do) */
\n
"
" /* TASTE API start up */
\n
"
" #ifdef __unix__
\n
"
" debugCheckQ = getenv(
\"
CHECKQ_DEBUG
\"
);
\n
"
" #endif
\n
"
"}
\n\n
"
,
fv
->
name
);
FOREACH
(
function
,
FV
,
all_fv
,
{
...
...
@@ -912,9 +923,18 @@ void Add_api(Process *node, FV_list *all_fv)
task_id
=
make_string
(
"%s_vt_%s_%s_k"
,
node
->
name
,
function
->
name
,
pi
->
name
);
port
=
make_string
(
"vt_%s_%s_local_inport_artificial_%s"
,
function
->
name
,
pi
->
name
,
pi
->
name
);
}
fprintf
(
code
,
" if (__po_hi_gqueue_get_count(%s, %s)) *res = 1;
\n
"
,
fprintf
(
code
,
" if (__po_hi_gqueue_get_count(%s, %s)) {"
" *res = 1;
\n
"
" #ifdef __unix__
\n
"
" if (debugCheckQ) {
\n
"
" printf (
\"
[DEBUG] Pending message %s in function %s
\\
n
\"
);
\n
"
" }
\n
"
" #endif
\n
"
" }
\n
"
,
string_to_lower
(
task_id
),
string_to_lower
(
port
));
string_to_lower
(
port
),
pi
->
name
,
function
->
name
);
free
(
task_id
);
free
(
port
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment