Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherlabmaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICS Control System Infrastructure
etherlabmaster
Commits
7d8a15ad
Commit
7d8a15ad
authored
15 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
64 bit frame statistics.
parent
184f068a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
master/device.c
+5
-5
5 additions, 5 deletions
master/device.c
master/device.h
+7
-9
7 additions, 9 deletions
master/device.h
master/ioctl.h
+4
-4
4 additions, 4 deletions
master/ioctl.h
with
16 additions
and
18 deletions
master/device.c
+
5
−
5
View file @
7d8a15ad
...
@@ -310,12 +310,12 @@ void ec_device_send(
...
@@ -310,12 +310,12 @@ void ec_device_send(
// frame statistics
// frame statistics
if
(
unlikely
(
jiffies
-
device
->
stats_jiffies
>=
HZ
))
{
if
(
unlikely
(
jiffies
-
device
->
stats_jiffies
>=
HZ
))
{
unsigned
int
i
;
unsigned
int
i
;
u
nsigned
int
tx_frame_rate
=
u
32
tx_frame_rate
=
(
device
->
tx_count
-
device
->
last_tx_count
)
*
1000
;
(
u32
)
(
device
->
tx_count
-
device
->
last_tx_count
)
*
1000
;
u
nsigned
int
tx_byte_rate
=
u
32
tx_byte_rate
=
(
device
->
tx_bytes
-
device
->
last_tx_bytes
)
*
1000
;
(
device
->
tx_bytes
-
device
->
last_tx_bytes
)
*
1000
;
int
loss
=
device
->
tx_count
-
device
->
rx_count
;
u64
loss
=
device
->
tx_count
-
device
->
rx_count
;
int
loss_rate
=
(
loss
-
device
->
last_loss
)
*
1000
;
s32
loss_rate
=
(
s32
)
(
loss
-
device
->
last_loss
)
*
1000
;
for
(
i
=
0
;
i
<
EC_RATE_COUNT
;
i
++
)
{
for
(
i
=
0
;
i
<
EC_RATE_COUNT
;
i
++
)
{
unsigned
int
n
=
rate_intervals
[
i
];
unsigned
int
n
=
rate_intervals
[
i
];
device
->
tx_frame_rates
[
i
]
=
device
->
tx_frame_rates
[
i
]
=
...
...
This diff is collapsed.
Click to expand it.
master/device.h
+
7
−
9
View file @
7d8a15ad
...
@@ -98,21 +98,19 @@ struct ec_device
...
@@ -98,21 +98,19 @@ struct ec_device
unsigned
long
jiffies_poll
;
/**< jiffies of last poll */
unsigned
long
jiffies_poll
;
/**< jiffies of last poll */
// Frame statistics
// Frame statistics
unsigned
int
tx_count
;
/**< Number of frames sent. */
u64
tx_count
;
/**< Number of frames sent. */
unsigned
int
rx_count
;
/**< Number of frames received. */
u64
last_tx_count
;
/**< Number of frames sent of last statistics cycle. */
unsigned
int
tx_bytes
;
/**< Number of frames sent. */
u64
rx_count
;
/**< Number of frames received. */
unsigned
int
tx_errors
;
/**< Number of transmit errors. */
u64
tx_bytes
;
/**< Number of frames sent. */
u64
last_tx_bytes
;
/**< Number of bytes sent of last statistics cycle. */
u64
tx_errors
;
/**< Number of transmit errors. */
u64
last_loss
;
/**< Tx/Rx difference of last statistics cycle. */
unsigned
int
tx_frame_rates
[
EC_RATE_COUNT
];
/**< Transmit rates in
unsigned
int
tx_frame_rates
[
EC_RATE_COUNT
];
/**< Transmit rates in
frames/s for different
frames/s for different
statistics cycle periods. */
statistics cycle periods. */
unsigned
int
tx_byte_rates
[
EC_RATE_COUNT
];
/**< Transmit rates in byte/s
unsigned
int
tx_byte_rates
[
EC_RATE_COUNT
];
/**< Transmit rates in byte/s
for different statistics
for different statistics
cycle periods. */
cycle periods. */
unsigned
int
last_tx_count
;
/**< Number of frames sent of last statistics
cycle. */
unsigned
int
last_tx_bytes
;
/**< Number of bytes sent of last statistics
cycle. */
int
last_loss
;
/**< Tx/Rx difference of last statistics cycle. */
int
loss_rates
[
EC_RATE_COUNT
];
/**< Frame loss rates for different
int
loss_rates
[
EC_RATE_COUNT
];
/**< Frame loss rates for different
statistics cycle periods. */
statistics cycle periods. */
unsigned
long
stats_jiffies
;
/**< Jiffies of last statistic cycle. */
unsigned
long
stats_jiffies
;
/**< Jiffies of last statistic cycle. */
...
...
This diff is collapsed.
Click to expand it.
master/ioctl.h
+
4
−
4
View file @
7d8a15ad
...
@@ -162,10 +162,10 @@ typedef struct {
...
@@ -162,10 +162,10 @@ typedef struct {
uint8_t
address
[
6
];
uint8_t
address
[
6
];
uint8_t
attached
;
uint8_t
attached
;
uint8_t
link_state
;
uint8_t
link_state
;
uint
32
_t
tx_count
;
uint
64
_t
tx_count
;
uint
32
_t
rx_count
;
uint
64
_t
rx_count
;
uint
32
_t
tx_bytes
;
uint
64
_t
tx_bytes
;
uint
32
_t
tx_errors
;
uint
64
_t
tx_errors
;
uint32_t
tx_frame_rates
[
EC_RATE_COUNT
];
uint32_t
tx_frame_rates
[
EC_RATE_COUNT
];
uint32_t
tx_byte_rates
[
EC_RATE_COUNT
];
uint32_t
tx_byte_rates
[
EC_RATE_COUNT
];
int32_t
loss_rates
[
EC_RATE_COUNT
];
int32_t
loss_rates
[
EC_RATE_COUNT
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment