Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Robotlab
firefly
Commits
bb3b35f9
Commit
bb3b35f9
authored
Apr 02, 2014
by
Tommy Olofsson
Browse files
Added more tracing to vx event queue. Some event hangs the event task.
parent
3376fc84
Changes
3
Show whitespace changes
Inline
Side-by-side
src/protocol/firefly_protocol.c
View file @
bb3b35f9
...
...
@@ -443,6 +443,7 @@ void handle_data_sample(firefly_protocol_data_sample *data, void *context)
unsigned
char
*
fers_data
;
int
ret
;
printf
(
"%s"
,
__func__
);
conn
=
context
;
fers
=
FIREFLY_RUNTIME_MALLOC
(
conn
,
sizeof
(
*
fers
));
fers_data
=
FIREFLY_RUNTIME_MALLOC
(
conn
,
data
->
app_enc_data
.
n_0
);
...
...
src/transport/firefly_transport_udp_posix.c
View file @
bb3b35f9
...
...
@@ -394,6 +394,7 @@ static int firefly_transport_udp_posix_read_event(void *event_arg)
struct
transport_llp_udp_posix
*
llp_udp
;
struct
firefly_connection
*
conn
;
printf
(
"exec read ev
\n
"
);
ev_arg
=
event_arg
;
llp_udp
=
ev_arg
->
llp
->
llp_platspec
;
...
...
@@ -476,7 +477,7 @@ void firefly_transport_udp_posix_read(struct firefly_transport_llp *llp)
/* printf("recv %d byte\n", pkg_len); */
res
=
recvfrom
(
llp_udp
->
local_udp_socket
,
(
void
*
)
ev_arg
->
data
,
pkg_len
,
0
,
(
struct
sockaddr
*
)
&
remote_addr
,
(
void
*
)
&
len
);
/*
printf("recv'd %d byte\n", res);
*/
printf
(
"recv'd %d byte
\n
"
,
res
);
if
(
res
==
-
1
)
{
char
err_buf
[
ERROR_STR_MAX_LEN
];
#ifdef LABCOMM_COMPAT
...
...
@@ -496,6 +497,7 @@ void firefly_transport_udp_posix_read(struct firefly_transport_llp *llp)
FIREFLY_PRIORITY_HIGH
,
firefly_transport_udp_posix_read_event
,
ev_arg
,
0
,
NULL
);
printf
(
"put read ev
\n
"
);
}
bool
sockaddr_in_eq
(
struct
sockaddr_in
*
one
,
struct
sockaddr_in
*
other
)
...
...
src/utils/firefly_event_queue_vx.c
View file @
bb3b35f9
...
...
@@ -95,8 +95,12 @@ int64_t firefly_event_queue_vx_add(struct firefly_event_queue *eq,
semTake
(
ctx
->
lock
,
WAIT_FOREVER
);
res
=
firefly_event_add
(
eq
,
prio
,
execute
,
context
,
nbr_deps
,
deps
);
semGive
(
ctx
->
lock
);
if
(
res
>
0
)
if
(
res
>
0
)
{
printf
(
"ADDING ev
\n
"
);
semGive
(
ctx
->
signal
);
printf
(
"ADDED ev
\n
"
);
}
else
printf
(
"FAILED TO ADD EVENT
\n
"
);
return
res
;
}
...
...
@@ -121,33 +125,38 @@ void *firefly_event_vx_thread_main(void *args)
semTake
(
ctx
->
lock
,
WAIT_FOREVER
);
event_left
=
firefly_event_queue_length
(
eq
);
finish
=
ctx
->
event_loop_stop
;
printf
(
"EQ LEN: %d, DONE: %d
\n
"
,
event_left
,
finish
);
while
(
event_left
<=
0
&&
!
finish
)
{
semGive
(
ctx
->
lock
);
printf
(
"WAIT SIG
\n
"
);
semTake
(
ctx
->
signal
,
WAIT_FOREVER
);
printf
(
"GOT SIG
\n
"
);
semTake
(
ctx
->
lock
,
WAIT_FOREVER
);
finish
=
ctx
->
event_loop_stop
;
event_left
=
firefly_event_queue_length
(
eq
);
}
ev
=
firefly_event_pop
(
eq
);
semGive
(
ctx
->
lock
);
printf
(
"
got ev
?
\n
"
);
printf
(
"
GOT EV
?
\n
"
);
if
(
ev
)
{
/* TODO: Retval can indicate badly contructed event, or
* failed execution. Should this be handled?
*/
printf
(
"
executing ev
. %p
\n
"
,
ev
->
execute
);
printf
(
"
EXECUTING EV
. %p
\n
"
,
ev
->
execute
);
firefly_event_execute
(
ev
);
printf
(
"
executing ev done
.
\n
"
);
printf
(
"
EXECUTING EV DONE
.
\n
"
);
semTake
(
ctx
->
lock
,
WAIT_FOREVER
);
firefly_event_return
(
eq
,
&
ev
);
semGive
(
ctx
->
lock
);
printf
(
"event returned
\n
"
);
}
printf
(
"(EVENT RETURNED)
\n
"
);
}
else
printf
(
"NO EVENT
\n
"
);
}
/* semTake(ctx->lock, WAIT_FOREVER); */
semGive
(
ctx
->
dead
);
/* semGive(ctx->lock); */
printf
(
"EVENT THREAD TERMINATING
\n
"
);
return
NULL
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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