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
5aaedcc5
Commit
5aaedcc5
authored
Nov 23, 2015
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: add 'ppg' and 'all' to wrpc-dump, and minor fixes
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
4e548d23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
12 deletions
+65
-12
wrpc-dump.c
tools/wrpc-dump.c
+65
-12
No files found.
tools/wrpc-dump.c
View file @
5aaedcc5
...
...
@@ -209,10 +209,10 @@ void dump_one_field(void *addr, struct dump_info *info)
case
dump_type_ClockQuality
:
printf
(
"class %i, accuracy %02x (%i), logvariance %i
\n
"
,
cq
->
clockClass
,
cq
->
clockAccuracy
,
cq
->
clockAccuracy
,
cq
->
offsetScaledLogVariance
);
wrpc_get_16
(
&
cq
->
offsetScaledLogVariance
)
);
break
;
case
dump_type_sensor_temp
:
printf
(
"%f
\n
"
,
((
float
)(
*
(
int
*
)
p
>>
4
))
/
16
.
0
);
printf
(
"%f
\n
"
,
((
float
)(
wrpc_get_i32
(
p
)
>>
4
))
/
16
.
0
);
break
;
}
}
...
...
@@ -245,7 +245,7 @@ void dump_many_fields(void *addr, struct dump_info *info, int ninfo)
/* map for fields of ppsi structures */
#undef DUMP_STRUCT
#define DUMP_STRUCT struct pp_globals
struct
dump_info
ppg_info
[]
=
{
st
atic
st
ruct
dump_info
ppg_info
[]
=
{
DUMP_FIELD
(
pointer
,
pp_instances
),
/* FIXME: follow this */
DUMP_FIELD
(
pointer
,
servo
),
/* FIXME: follow this */
DUMP_FIELD
(
pointer
,
rt_opts
),
...
...
@@ -266,7 +266,7 @@ struct dump_info ppg_info [] = {
#undef DUMP_STRUCT
#define DUMP_STRUCT DSDefault
/* Horrible typedef */
struct
dump_info
dsd_info
[]
=
{
st
atic
st
ruct
dump_info
dsd_info
[]
=
{
DUMP_FIELD
(
Boolean
,
twoStepFlag
),
DUMP_FIELD
(
ClockIdentity
,
clockIdentity
),
DUMP_FIELD
(
UInteger16
,
numberPorts
),
...
...
@@ -279,7 +279,7 @@ struct dump_info dsd_info [] = {
#undef DUMP_STRUCT
#define DUMP_STRUCT DSCurrent
/* Horrible typedef */
struct
dump_info
dsc_info
[]
=
{
st
atic
st
ruct
dump_info
dsc_info
[]
=
{
DUMP_FIELD
(
UInteger16
,
stepsRemoved
),
DUMP_FIELD
(
TimeInternal
,
offsetFromMaster
),
DUMP_FIELD
(
TimeInternal
,
meanPathDelay
),
/* oneWayDelay */
...
...
@@ -288,7 +288,7 @@ struct dump_info dsc_info [] = {
#undef DUMP_STRUCT
#define DUMP_STRUCT DSParent
/* Horrible typedef */
struct
dump_info
dsp_info
[]
=
{
st
atic
st
ruct
dump_info
dsp_info
[]
=
{
DUMP_FIELD
(
PortIdentity
,
parentPortIdentity
),
DUMP_FIELD
(
UInteger16
,
observedParentOffsetScaledLogVariance
),
DUMP_FIELD
(
Integer32
,
observedParentClockPhaseChangeRate
),
...
...
@@ -300,7 +300,7 @@ struct dump_info dsp_info [] = {
#undef DUMP_STRUCT
#define DUMP_STRUCT DSTimeProperties
/* Horrible typedef */
struct
dump_info
dstp_info
[]
=
{
st
atic
st
ruct
dump_info
dstp_info
[]
=
{
DUMP_FIELD
(
Integer16
,
currentUtcOffset
),
DUMP_FIELD
(
Boolean
,
currentUtcOffsetValid
),
DUMP_FIELD
(
Boolean
,
leap59
),
...
...
@@ -313,7 +313,7 @@ struct dump_info dstp_info [] = {
#undef DUMP_STRUCT
#define DUMP_STRUCT struct wr_servo_state
struct
dump_info
servo_state_info
[]
=
{
st
atic
st
ruct
dump_info
servo_state_info
[]
=
{
DUMP_FIELD_SIZE
(
char
,
if_name
,
16
),
DUMP_FIELD
(
unsigned_long
,
flags
),
DUMP_FIELD
(
int
,
state
),
...
...
@@ -345,7 +345,7 @@ struct dump_info servo_state_info [] = {
#undef DUMP_STRUCT
#define DUMP_STRUCT struct pp_instance
struct
dump_info
ppi_info
[]
=
{
st
atic
st
ruct
dump_info
ppi_info
[]
=
{
DUMP_FIELD
(
int
,
state
),
DUMP_FIELD
(
int
,
next_state
),
DUMP_FIELD
(
int
,
next_delay
),
...
...
@@ -463,15 +463,68 @@ int main(int argc, char **argv)
exit
(
1
);
}
#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
/* Now check the "name" to be dumped */
if
(
!
strcmp
(
argv
[
3
],
"ppg"
))
{
printf
(
"ppg at 0x%lx
\n
"
,
offset
);
dump_many_fields
(
mapaddr
+
offset
,
ARRAY_AND_SIZE
(
ppg_info
));
}
if
(
!
strcmp
(
argv
[
3
],
"ppi"
))
{
printf
(
"ppi at 0x%lx
\n
"
,
offset
);
dump_many_fields
(
mapaddr
+
offset
,
ppi_info
,
ARRAY
_SIZE
(
ppi_info
));
ARRAY_AND
_SIZE
(
ppi_info
));
}
if
(
!
strcmp
(
argv
[
3
],
"servo_state"
))
{
printf
(
"servo_state at 0x%lx
\n
"
,
offset
);
dump_many_fields
(
mapaddr
+
offset
,
servo_state_info
,
ARRAY_SIZE
(
servo_state_info
));
dump_many_fields
(
mapaddr
+
offset
,
ARRAY_AND_SIZE
(
servo_state_info
));
}
if
(
!
strcmp
(
argv
[
3
],
"all"
))
{
unsigned
long
newoffset
;
struct
pp_globals
*
ppg
;
struct
pp_instance
*
ppi
;
ppg
=
mapaddr
+
offset
;
printf
(
"ppg at 0x%lx
\n
"
,
offset
);
dump_many_fields
(
ppg
,
ARRAY_AND_SIZE
(
ppg_info
));
newoffset
=
wrpc_get_l32
(
&
ppg
->
pp_instances
);
printf
(
"ppi at 0x%lx
\n
"
,
newoffset
);
ppi
=
mapaddr
+
newoffset
;
dump_many_fields
(
ppi
,
ARRAY_AND_SIZE
(
ppi_info
));
newoffset
=
wrpc_get_l32
(
&
ppg
->
defaultDS
);
printf
(
"defaultDS at 0x%lx
\n
"
,
newoffset
);
dump_many_fields
(
mapaddr
+
newoffset
,
ARRAY_AND_SIZE
(
dsd_info
));
newoffset
=
wrpc_get_l32
(
&
ppg
->
currentDS
);
printf
(
"currentDS at 0x%lx
\n
"
,
newoffset
);
dump_many_fields
(
mapaddr
+
newoffset
,
ARRAY_AND_SIZE
(
dsc_info
));
newoffset
=
wrpc_get_l32
(
&
ppg
->
parentDS
);
printf
(
"parentDS at 0x%lx
\n
"
,
newoffset
);
dump_many_fields
(
mapaddr
+
newoffset
,
ARRAY_AND_SIZE
(
dsp_info
));
newoffset
=
wrpc_get_l32
(
&
ppg
->
timePropertiesDS
);
printf
(
"timePropertiesDS at 0x%lx
\n
"
,
newoffset
);
dump_many_fields
(
mapaddr
+
newoffset
,
ARRAY_AND_SIZE
(
dstp_info
));
newoffset
=
wrpc_get_l32
(
&
ppg
->
global_ext_data
);
printf
(
"servo_state at 0x%lx
\n
"
,
newoffset
);
dump_many_fields
(
mapaddr
+
newoffset
,
ARRAY_AND_SIZE
(
servo_state_info
));
}
exit
(
0
);
}
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