Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
651c6bf2
Commit
651c6bf2
authored
Dec 03, 2016
by
Alessandro Rubini
Committed by
Grzegorz Daniluk
Feb 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix dump info for new structures
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
90d75a98
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
27 deletions
+47
-27
dump-info.c
dump-info.c
+19
-19
dump-info.h
include/dump-info.h
+2
-1
wrpc-dump.c
tools/wrpc-dump.c
+26
-7
No files found.
dump-info.c
View file @
651c6bf2
...
...
@@ -46,8 +46,8 @@ struct dump_info dump_info[] = {
DUMP_HEADER
(
"DSCurrent"
),
DUMP_FIELD
(
UInteger16
,
stepsRemoved
),
DUMP_FIELD
(
TimeInternal
,
offsetFromMaster
),
DUMP_FIELD
(
TimeInternal
,
meanPathDelay
),
/* oneWayDelay */
DUMP_FIELD
(
pp_time
,
offsetFromMaster
),
DUMP_FIELD
(
pp_time
,
meanPathDelay
),
/* oneWayDelay */
DUMP_FIELD
(
UInteger16
,
primarySlavePortNumber
),
#undef DUMP_STRUCT
...
...
@@ -88,15 +88,15 @@ struct dump_info dump_info[] = {
DUMP_FIELD
(
Integer32
,
delta_rx_s
),
DUMP_FIELD
(
Integer32
,
fiber_fix_alpha
),
DUMP_FIELD
(
Integer32
,
clock_period_ps
),
DUMP_FIELD
(
TimeInternal
,
t1
),
DUMP_FIELD
(
TimeInternal
,
t2
),
DUMP_FIELD
(
TimeInternal
,
t3
),
DUMP_FIELD
(
TimeInternal
,
t4
),
DUMP_FIELD
(
TimeInternal
,
t5
),
DUMP_FIELD
(
TimeInternal
,
t6
),
DUMP_FIELD
(
pp_time
,
t1
),
DUMP_FIELD
(
pp_time
,
t2
),
DUMP_FIELD
(
pp_time
,
t3
),
DUMP_FIELD
(
pp_time
,
t4
),
DUMP_FIELD
(
pp_time
,
t5
),
DUMP_FIELD
(
pp_time
,
t6
),
DUMP_FIELD
(
Integer64
,
delta_ms_prev
),
DUMP_FIELD
(
int
,
missed_iters
),
DUMP_FIELD
(
TimeInternal
,
mu
),
/* half of the RTT */
DUMP_FIELD
(
pp_time
,
mu
),
/* half of the RTT */
DUMP_FIELD
(
Integer64
,
picos_mu
),
DUMP_FIELD
(
Integer32
,
cur_setpoint
),
DUMP_FIELD
(
Integer64
,
delta_ms
),
...
...
@@ -108,7 +108,7 @@ struct dump_info dump_info[] = {
DUMP_FIELD
(
UInteger32
,
n_err_state
),
DUMP_FIELD
(
UInteger32
,
n_err_offset
),
DUMP_FIELD
(
UInteger32
,
n_err_delta_rtt
),
DUMP_FIELD
(
TimeInternal
,
update_time
),
DUMP_FIELD
(
pp_time
,
update_time
),
#undef DUMP_STRUCT
#define DUMP_STRUCT struct pp_instance
...
...
@@ -155,17 +155,17 @@ struct dump_info dump_info[] = {
DUMP_FIELD_SIZE
(
bina
,
peer
,
6
),
DUMP_FIELD
(
uint16_t
,
peer_vid
),
DUMP_FIELD
(
TimeInternal
,
t1
),
DUMP_FIELD
(
TimeInternal
,
t2
),
DUMP_FIELD
(
TimeInternal
,
t3
),
DUMP_FIELD
(
TimeInternal
,
t4
),
DUMP_FIELD
(
TimeInternal
,
t5
),
DUMP_FIELD
(
TimeInternal
,
t6
),
DUMP_FIELD
(
pp_time
,
t1
),
DUMP_FIELD
(
pp_time
,
t2
),
DUMP_FIELD
(
pp_time
,
t3
),
DUMP_FIELD
(
pp_time
,
t4
),
DUMP_FIELD
(
pp_time
,
t5
),
DUMP_FIELD
(
pp_time
,
t6
),
DUMP_FIELD
(
Integer32
,
t4_cf
),
DUMP_FIELD
(
Integer32
,
t6_cf
),
DUMP_FIELD
(
TimeInternal
,
cField
),
DUMP_FIELD
(
TimeInternal
,
last_rcv_time
),
DUMP_FIELD
(
TimeInternal
,
last_snt_time
),
DUMP_FIELD
(
pp_time
,
cField
),
DUMP_FIELD
(
pp_time
,
last_rcv_time
),
DUMP_FIELD
(
pp_time
,
last_snt_time
),
DUMP_FIELD
(
UInteger16
,
frgn_rec_num
),
DUMP_FIELD
(
Integer16
,
frgn_rec_best
),
//DUMP_FIELD(struct pp_frgn_master frgn_master[PP_NR_FOREIGN_RECORDS]),
...
...
include/dump-info.h
View file @
651c6bf2
...
...
@@ -39,12 +39,13 @@ enum dump_type {
dump_type_PortIdentity
,
dump_type_ClockQuality
,
/* and this is ours */
dump_type_
TimeInternal
,
dump_type_
pp_time
,
dump_type_ip_address
,
};
/* because of the sizeof later on, we need these typedefs */
typedef
void
*
pointer
;
typedef
struct
pp_time
pp_time
;
typedef
unsigned
long
unsigned_long
;
typedef
unsigned
char
unsigned_char
;
typedef
unsigned
short
unsigned_short
;
...
...
tools/wrpc-dump.c
View file @
651c6bf2
...
...
@@ -57,6 +57,19 @@ static int wrpc_get_i32(void *p)
{
return
wrpc_get_l32
(
p
);
}
static
int64_t
wrpc_get_i64
(
void
*
p
)
{
int64_t
*
p64
=
p
,
i64
;
if
(
endian_flag
==
DUMP_ENDIAN_FLAG
)
return
*
p64
;
/* uff... */
i64
=
*
p64
;
i64
=
__bswap_32
(
i64
&
0xffffffff
);
i64
<<=
32
;
i64
|=
__bswap_32
(
i64
>>
32
);
return
i64
;
}
static
int
wrpc_get_16
(
void
*
p
)
{
...
...
@@ -71,7 +84,7 @@ static int wrpc_get_16(void *p)
void
dump_one_field
(
void
*
addr
,
struct
dump_info
*
info
)
{
void
*
p
=
addr
+
wrpc_get_i32
(
&
info
->
offset
);
struct
TimeInternal
*
ti
=
p
;
struct
pp_time
*
t
=
p
;
struct
PortIdentity
*
pi
=
p
;
struct
ClockQuality
*
cq
=
p
;
char
format
[
16
];
...
...
@@ -137,13 +150,19 @@ void dump_one_field(void *addr, struct dump_info *info)
case
dump_type_Integer16
:
printf
(
"%i
\n
"
,
wrpc_get_16
(
p
));
break
;
case
dump_type_TimeInternal
:
printf
(
"correct %i: %10i.%09i:%04i
\n
"
,
wrpc_get_i32
(
&
ti
->
correct
),
wrpc_get_i32
(
&
ti
->
seconds
),
wrpc_get_i32
(
&
ti
->
nanoseconds
),
wrpc_get_i32
(
&
ti
->
phase
));
case
dump_type_pp_time
:
{
struct
pp_time
localt
;
localt
.
secs
=
wrpc_get_i64
(
&
t
->
secs
);
localt
.
scaled_nsecs
=
wrpc_get_i64
(
&
t
->
scaled_nsecs
);
printf
(
"correct %i: %10lli.%09li:0x%04x
\n
"
,
!
is_incorrect
(
&
localt
),
(
long
long
)
localt
.
secs
,
(
long
)(
localt
.
scaled_nsecs
>>
16
),
(
int
)(
localt
.
scaled_nsecs
&
0xffff
));
break
;
}
case
dump_type_ip_address
:
for
(
i
=
0
;
i
<
4
;
i
++
)
...
...
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