Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Trigger Distribution
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
White Rabbit Trigger Distribution
Commits
efabd2de
Commit
efabd2de
authored
Dec 19, 2018
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrtd-config, wrtd-logging: improve output.
parent
5c68b2c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
5 deletions
+43
-5
wrtd-config.c
software/tools/wrtd-config.c
+10
-3
wrtd-logging.c
software/tools/wrtd-logging.c
+33
-2
No files found.
software/tools/wrtd-config.c
View file @
efabd2de
...
...
@@ -117,7 +117,12 @@ static void disp_rule_conf(const struct wrtd_rule *rule, unsigned nbr_rules)
" dest: "
);
disp_id
(
cfg
->
dest_id
);
printf
(
"
\n
"
" dest_cpu: %u
\n
"
,
cfg
->
dest_cpu
);
" dest_cpu: %u"
,
cfg
->
dest_cpu
);
if
(
cfg
->
dest_cpu
==
WRTD_DEST_CPU_LOCAL
)
printf
(
" (local)"
);
else
if
(
cfg
->
dest_cpu
==
WRTD_DEST_CH_NET
)
printf
(
" (net)"
);
printf
(
"
\n
"
);
printf
(
" dest_ch: %u
\n
"
,
cfg
->
dest_ch
);
printf
(
" enabled: %d
\n
"
,
cfg
->
enabled
);
printf
(
" hash: %u, hash_chain: %d
\n
"
,
...
...
@@ -879,7 +884,7 @@ int main(int argc, char *argv[])
char
c
;
int
i
;
while
((
c
=
getopt
(
argc
,
argv
,
"hD:c:"
))
!=
-
1
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"
+
hD:c:"
))
!=
-
1
)
{
switch
(
c
)
{
case
'h'
:
case
'?'
:
...
...
@@ -910,7 +915,9 @@ int main(int argc, char *argv[])
/* Open. */
status
=
wrtd_init
(
dev_name
,
0
,
NULL
,
&
wrtd
);
if
(
status
!=
WRTD_SUCCESS
)
{
fprintf
(
stderr
,
"Cannot open WRTD, status=0x%08x
\n
"
,
status
);
fprintf
(
stderr
,
"Cannot open WRTD %s, status=0x%08x (errno=%s)
\n
"
,
dev_name
,
status
,
strerror
(
errno
));
return
1
;
}
...
...
software/tools/wrtd-logging.c
View file @
efabd2de
...
...
@@ -59,7 +59,24 @@ static void print_logging (struct wrtd_dev *wrtd, int n_read)
switch
(
log
.
type
)
{
case
WRTD_LOG_MSG_EV_GENERATED
:
printf
(
"generated %-4u "
,
log
.
reason
);
printf
(
"generated "
);
switch
(
log
.
reason
)
{
case
WRTD_LOG_GENERATED_ALARM
:
printf
(
"alrm "
);
break
;
case
WRTD_LOG_GENERATED_DEVICE_0
:
case
WRTD_LOG_GENERATED_DEVICE_1
:
case
WRTD_LOG_GENERATED_DEVICE_2
:
case
WRTD_LOG_GENERATED_DEVICE_3
:
printf
(
"dev%u "
,
(
log
.
reason
-
WRTD_LOG_GENERATED_DEVICE_0
));
break
;
default:
printf
(
"%-4u "
,
log
.
reason
);
break
;
}
break
;
case
WRTD_LOG_MSG_EV_CONSUMED
:
printf
(
"consumed "
);
...
...
@@ -76,7 +93,21 @@ static void print_logging (struct wrtd_dev *wrtd, int n_read)
}
break
;
case
WRTD_LOG_MSG_EV_DISCARDED
:
printf
(
"discarded %-4u "
,
log
.
reason
);
printf
(
"discarded "
);
switch
(
log
.
reason
)
{
case
WRTD_LOG_DISCARD_NO_SYNC
:
printf
(
"nosy "
);
break
;
case
WRTD_LOG_DISCARD_TIMEOUT
:
printf
(
"tout "
);
break
;
case
WRTD_LOG_DISCARD_OVERFLOW
:
printf
(
"ovf "
);
break
;
default:
printf
(
"%-4u "
,
log
.
reason
);
break
;
}
break
;
case
WRTD_LOG_MSG_EV_NETWORK
:
switch
(
log
.
reason
)
{
...
...
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