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
b47dc228
Commit
b47dc228
authored
Jun 04, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fill histograms only if histogram option enabled
parent
d43cd8ec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
packet-exchange/src/client.c
packet-exchange/src/client.c
+1
-1
packet-exchange/src/recv_packet.c
packet-exchange/src/recv_packet.c
+3
-3
packet-exchange/src/recv_packet.h
packet-exchange/src/recv_packet.h
+1
-1
packet-exchange/src/server.c
packet-exchange/src/server.c
+2
-2
No files found.
packet-exchange/src/client.c
View file @
b47dc228
...
...
@@ -245,7 +245,7 @@ static void do_tsn_task(struct thread_param *param, uint64_t next_txtime) {
clock_gettime
(
CLOCK_MONOTONIC
,
&
t1
);
send_udp_packet
(
0
,
0
,
next_txtime
,
network_config
.
ip_address
,
NULL
);
recv_udp_packet
(
0
,
NULL
);
recv_udp_packet
(
0
,
0
,
NULL
);
clock_gettime
(
CLOCK_MONOTONIC
,
&
t2
);
param
->
stats
.
rtt
=
calcdiff_ns
(
t2
,
t1
);
...
...
packet-exchange/src/recv_packet.c
View file @
b47dc228
...
...
@@ -106,7 +106,7 @@ int init_udp_recv(int use_timestamps, char *network_if) {
/*
* Receives udp packets
*/
packet_timestamps_t
recv_udp_packet
(
int
use_timestamps
,
int64_t
histograms
[
NB_HISTOGRAMS
][
MAX_HIST_VAL
])
{
packet_timestamps_t
recv_udp_packet
(
int
use_timestamps
,
int
use_histograms
,
int
64_t
histograms
[
NB_HISTOGRAMS
][
MAX_HIST_VAL
])
{
struct
cmsghdr
*
cmsg
;
struct
msghdr
msg
;
// Message hardware, sent to the socket
...
...
@@ -154,8 +154,8 @@ packet_timestamps_t recv_udp_packet(int use_timestamps, int64_t histograms[NB_HI
struct
timespec
*
stamp
=
(
struct
timespec
*
)
CMSG_DATA
(
cmsg
);
packet_ts
.
leave_kernel
=
ts_to_uint
(
*
stamp
);
fill_histograms
(
&
packet_ts
,
histograms
);
if
(
use_histograms
)
fill_histograms
(
&
packet_ts
,
histograms
);
}
}
}
...
...
packet-exchange/src/recv_packet.h
View file @
b47dc228
...
...
@@ -4,6 +4,6 @@
#include "utilities.h"
int
init_udp_recv
(
int
use_timestamps
,
char
*
network_if
);
packet_timestamps_t
recv_udp_packet
(
int
use_timestamps
,
int64_t
histograms
[
NB_HISTOGRAMS
][
MAX_HIST_VAL
]);
packet_timestamps_t
recv_udp_packet
(
int
use_timestamps
,
int
use_histograms
,
int
64_t
histograms
[
NB_HISTOGRAMS
][
MAX_HIST_VAL
]);
#endif
packet-exchange/src/server.c
View file @
b47dc228
...
...
@@ -131,12 +131,12 @@ static void *packet_receiving_thread(void *p) {
if
(
tsn_task
==
RTT_TASK
)
{
recv_udp_packet
(
0
,
NULL
);
recv_udp_packet
(
0
,
0
,
NULL
);
send_udp_packet
(
0
,
0
,
0
,
network_config
.
ip_address
,
NULL
);
}
else
if
(
tsn_task
==
RECV_PACKET_TASK
)
{
param
->
stats
.
packet_ts
=
recv_udp_packet
(
enable_timestamps
,
histograms
);
param
->
stats
.
packet_ts
=
recv_udp_packet
(
enable_timestamps
,
enable_histograms
,
histograms
);
clock_gettime
(
CLOCK_MONOTONIC
,
&
current
);
...
...
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