Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
7f88eada
Commit
7f88eada
authored
Mar 08, 2012
by
Alessandro Rubini
Committed by
Aurelio Colosimo
Mar 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ptpdump: print delta time, and empty lines too
parent
abcfc9dd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
ptpdump.c
tools/ptpdump.c
+13
-0
No files found.
tools/ptpdump.c
View file @
7f88eada
...
...
@@ -47,11 +47,24 @@ int dumpstruct(FILE *dest, char *prefix, char *name, void *ptr, int size)
static
void
dump_eth
(
struct
ethhdr
*
eth
)
{
struct
timeval
tv
;
static
struct
timeval
prev
;
struct
tm
tm
;
unsigned
char
*
d
=
eth
->
h_dest
;
unsigned
char
*
s
=
eth
->
h_source
;
gettimeofday
(
&
tv
,
NULL
);
if
(
prev
.
tv_sec
)
{
int
i
;
int
diffms
;
diffms
=
(
tv
.
tv_sec
-
prev
.
tv_sec
)
*
1000
+
(
signed
)(
tv
.
tv_usec
+
500
-
prev
.
tv_usec
)
/
1000
;
/* empty lines, one every .25 seconds, at most 10 of them */
for
(
i
=
250
;
i
<
2500
&&
i
<
diffms
;
i
+=
250
)
printf
(
"
\n
"
);
printf
(
"TIMEDELTA: %i ms
\n
"
,
diffms
);
}
prev
=
tv
;
localtime_r
(
&
tv
.
tv_sec
,
&
tm
);
printf
(
"TIME: (%li - 0x%lx) %02i:%02i:%02i.%06li
\n
"
,
tv
.
tv_sec
,
tv
.
tv_sec
,
...
...
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