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
c1fa2847
Commit
c1fa2847
authored
Jun 11, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make polling blocking and print timestamps differently
parent
ca9800c4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
20 deletions
+16
-20
packet-exchange/src/client.c
packet-exchange/src/client.c
+7
-9
packet-exchange/src/recv_packet.c
packet-exchange/src/recv_packet.c
+0
-1
packet-exchange/src/send_packet.c
packet-exchange/src/send_packet.c
+1
-1
packet-exchange/src/server.c
packet-exchange/src/server.c
+8
-9
No files found.
packet-exchange/src/client.c
View file @
c1fa2847
...
@@ -215,15 +215,13 @@ int main(int argc, char *argv[]) {
...
@@ -215,15 +215,13 @@ int main(int argc, char *argv[]) {
}
else
if
(
enable_timestamps
)
{
}
else
if
(
enable_timestamps
)
{
printf
(
"(%d) Enter send_udp_packet timestamp: %"
PRIu64
"
\n
"
,
int64_t
user_space_time
=
stats
->
packet_info
.
userspace_exit_ts
-
stats
->
packet_info
.
userspace_enter_ts
;
stats
->
nb_cycles
,
int64_t
kernel_space_time
=
stats
->
packet_info
.
kernelspace_ts
-
stats
->
packet_info
.
userspace_exit_ts
;
stats
->
packet_info
.
userspace_enter_ts
);
printf
(
"(%d) Call sendmsg timestamp : %"
PRIu64
"
\n
"
,
printf
(
"(%d) User space time: %"
PRIi64
"
\n
"
,
stats
->
nb_cycles
,
stats
->
nb_cycles
,
user_space_time
);
stats
->
packet_info
.
userspace_exit_ts
);
printf
(
"(%d) Kernel space time: %"
PRIi64
"
\n
"
,
printf
(
"(%d) Leave kernel timestamp : %"
PRIu64
"
\n
"
,
stats
->
nb_cycles
,
kernel_space_time
);
stats
->
nb_cycles
,
stats
->
packet_info
.
kernelspace_ts
);
}
}
}
}
...
...
packet-exchange/src/recv_packet.c
View file @
c1fa2847
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
#include <net/if.h>
#include <net/if.h>
#include <netdb.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/in.h>
#include <poll.h>
#include <pthread.h>
#include <pthread.h>
#include <sched.h>
#include <sched.h>
#include <signal.h>
#include <signal.h>
...
...
packet-exchange/src/send_packet.c
View file @
c1fa2847
...
@@ -190,7 +190,7 @@ packet_info_t send_udp_packet(int use_etf, int use_timestamps,
...
@@ -190,7 +190,7 @@ packet_info_t send_udp_packet(int use_etf, int use_timestamps,
error
(
EXIT_FAILURE
,
errno
,
"sendmsg failed, ret value: %d
\n
"
,
sendmsgerr
);
error
(
EXIT_FAILURE
,
errno
,
"sendmsg failed, ret value: %d
\n
"
,
sendmsgerr
);
if
(
use_timestamps
)
{
if
(
use_timestamps
)
{
pollerr
=
poll
(
&
poll_fd
,
1
,
0
);
pollerr
=
poll
(
&
poll_fd
,
1
,
1
);
if
(
pollerr
>
0
)
if
(
pollerr
>
0
)
process_timestamps
(
&
packet_info
,
histograms
);
process_timestamps
(
&
packet_info
,
histograms
);
else
else
...
...
packet-exchange/src/server.c
View file @
c1fa2847
...
@@ -234,15 +234,14 @@ int main(int argc, char *argv[]) {
...
@@ -234,15 +234,14 @@ int main(int argc, char *argv[]) {
stats
->
lost_packets
);
stats
->
lost_packets
);
if
(
enable_timestamps
)
{
if
(
enable_timestamps
)
{
printf
(
"(%d) Enter send_udp_packet timestamp: %"
PRIu64
"
\n
"
,
stats
->
packets_received
,
int64_t
user_space_time
=
stats
->
packet_info
.
userspace_exit_ts
-
stats
->
packet_info
.
userspace_enter_ts
;
stats
->
packet_info
.
userspace_enter_ts
);
int64_t
kernel_space_time
=
stats
->
packet_info
.
kernelspace_ts
-
stats
->
packet_info
.
userspace_exit_ts
;
printf
(
"(%d) Call sendmsg timestamp : %"
PRIu64
"
\n
"
,
stats
->
packets_received
,
printf
(
"(%d) User space time: %"
PRIi64
"
\n
"
,
stats
->
packet_info
.
userspace_exit_ts
);
stats
->
nb_cycles
,
user_space_time
);
printf
(
"(%d) Leave kernel timestamp : %"
PRIu64
"
\n
"
,
printf
(
"(%d) Kernel space time: %"
PRIi64
"
\n
"
,
stats
->
packets_received
,
stats
->
nb_cycles
,
kernel_space_time
);
stats
->
packet_info
.
kernelspace_ts
);
}
}
}
}
}
}
...
...
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