Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
fd20bd9e
Commit
fd20bd9e
authored
Jun 11, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make print go to beginning of line instead of printing multiple lines
parent
96d6ef68
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
packet-exchange/src/client.c
packet-exchange/src/client.c
+5
-5
packet-exchange/src/server.c
packet-exchange/src/server.c
+15
-8
No files found.
packet-exchange/src/client.c
View file @
fd20bd9e
...
@@ -211,16 +211,16 @@ int main(int argc, char *argv[]) {
...
@@ -211,16 +211,16 @@ int main(int argc, char *argv[]) {
if
(
main_param
.
verbose
)
{
if
(
main_param
.
verbose
)
{
if
(
tsn_task
==
RTT_TASK
)
{
if
(
tsn_task
==
RTT_TASK
)
{
printf
(
"
RTT: %*"
PRIu64
" (%*d)
\n
"
,
10
,
stats
->
rtt
,
10
,
stats
->
nb_cycles
);
printf
(
"
%*d: RTT: %*"
PRIu64
"
\n
"
,
10
,
stats
->
nb_cycles
,
10
,
stats
->
rtt
);
printf
(
"
\033
[%dA"
,
1
);
}
else
if
(
enable_timestamps
)
{
}
else
if
(
enable_timestamps
)
{
int64_t
user_space_time
=
stats
->
packet_info
.
userspace_exit_ts
-
stats
->
packet_info
.
userspace_enter_ts
;
int64_t
user_space_time
=
stats
->
packet_info
.
userspace_exit_ts
-
stats
->
packet_info
.
userspace_enter_ts
;
int64_t
kernel_space_time
=
stats
->
packet_info
.
kernelspace_ts
-
stats
->
packet_info
.
userspace_exit_ts
;
int64_t
kernel_space_time
=
stats
->
packet_info
.
kernelspace_ts
-
stats
->
packet_info
.
userspace_exit_ts
;
printf
(
"
(%*d) User and kernel space time: %*"
PRIi64
", %
"
PRIi64
"
\n
"
,
printf
(
"
%*d: U: %*"
PRIi64
", K: %*
"
PRIi64
"
\n
"
,
10
,
stats
->
nb_cycles
,
10
,
user_space_time
,
kernel_space_time
);
10
,
stats
->
nb_cycles
,
10
,
user_space_time
,
10
,
kernel_space_time
);
printf
(
"
\033
[%dA"
,
1
);
}
}
}
}
...
...
packet-exchange/src/server.c
View file @
fd20bd9e
...
@@ -178,7 +178,6 @@ static void *packet_receiving_thread(void *p) {
...
@@ -178,7 +178,6 @@ static void *packet_receiving_thread(void *p) {
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
pthread_t
thread
;
pthread_t
thread
;
thread_stat_t
*
stats
;
thread_stat_t
*
stats
;
int64_t
diff
;
param
=
malloc
(
sizeof
(
thread_param_t
));
param
=
malloc
(
sizeof
(
thread_param_t
));
stats
=
&
param
->
stats
;
stats
=
&
param
->
stats
;
...
@@ -226,21 +225,29 @@ int main(int argc, char *argv[]) {
...
@@ -226,21 +225,29 @@ int main(int argc, char *argv[]) {
if
(
main_param
.
verbose
)
{
if
(
main_param
.
verbose
)
{
if
(
tsn_task
==
RECV_PACKET_TASK
)
{
if
(
tsn_task
==
RECV_PACKET_TASK
)
{
diff
=
((
int64_t
)
stats
->
max_interval
)
-
stats
->
min_interval
;
printf
(
"(%*d) Jitter : %*"
PRIi64
" [Packet data: %*s] [Lost packets: %*d]
\n
"
,
int64_t
jitter
=
((
int64_t
)
stats
->
max_interval
)
-
stats
->
min_interval
;
printf
(
"%*d: J: %*"
PRIi64
,
10
,
stats
->
packets_received
,
10
,
stats
->
packets_received
,
10
,
diff
,
10
,
jitter
);
10
,
stats
->
packet_info
.
data
,
10
,
stats
->
lost_packets
);
if
(
enable_timestamps
)
{
if
(
enable_timestamps
)
{
int64_t
user_space_time
=
stats
->
packet_info
.
userspace_exit_ts
-
stats
->
packet_info
.
userspace_enter_ts
;
int64_t
user_space_time
=
stats
->
packet_info
.
userspace_exit_ts
-
stats
->
packet_info
.
userspace_enter_ts
;
int64_t
kernel_space_time
=
stats
->
packet_info
.
kernelspace_ts
-
stats
->
packet_info
.
userspace_exit_ts
;
int64_t
kernel_space_time
=
stats
->
packet_info
.
kernelspace_ts
-
stats
->
packet_info
.
userspace_exit_ts
;
printf
(
"(%*d) User and kernel space time: %*"
PRIi64
", %"
PRIi64
"
\n
"
,
printf
(
", U: %*"
PRIi64
", K: %*"
PRIi64
", D: %*s, L: %*d
\n
"
,
10
,
stats
->
packets_received
,
10
,
user_space_time
,
kernel_space_time
);
10
,
user_space_time
,
10
,
kernel_space_time
,
4
,
stats
->
packet_info
.
data
,
4
,
stats
->
lost_packets
);
}
}
else
{
printf
(
"
\n
"
);
}
printf
(
"
\033
[%dA"
,
1
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
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