Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository 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
f4grx
NuttX RTOS
Commits
0abe6c66
Commit
0abe6c66
authored
10 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
Update everything under nuttx/net to use the corrected syslog interfaces
parent
e493e087
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
net/iob/iob_dump.c
+12
-27
12 additions, 27 deletions
net/iob/iob_dump.c
net/tcp/tcp_wrbuffer_dump.c
+2
-18
2 additions, 18 deletions
net/tcp/tcp_wrbuffer_dump.c
with
14 additions
and
45 deletions
net/iob/iob_dump.c
+
12
−
27
View file @
0abe6c66
...
...
@@ -54,22 +54,6 @@
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/* Select the lowest level debug interface available */
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_ARCH_LOWPUTC
# define message(format, ...) lowsyslog(format, ##__VA_ARGS__)
# else
# define message(format, ...) syslog(format, ##__VA_ARGS__)
# endif
#else
# ifdef CONFIG_ARCH_LOWPUTC
# define message lowsyslog
# else
# define message syslog
# endif
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
...
...
@@ -93,7 +77,7 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len,
unsigned
int
cndx
;
head
=
iob
;
message
(
"%s: iob=%p pktlen=%d
\n
"
,
msg
,
head
,
head
->
io_pktlen
);
lowsyslog
(
LOG_DEBUG
,
"%s: iob=%p pktlen=%d
\n
"
,
msg
,
head
,
head
->
io_pktlen
);
/* Check if the offset is beyond the data in the I/O buffer chain */
...
...
@@ -108,7 +92,8 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len,
for
(;
iob
;
iob
=
iob
->
io_flink
)
{
message
(
" iob=%p len=%d offset=%d
\n
"
,
iob
,
iob
->
io_len
,
iob
->
io_offset
);
lowsyslog
(
LOG_DEBUG
,
" iob=%p len=%d offset=%d
\n
"
,
iob
,
iob
->
io_len
,
iob
->
io_offset
);
}
/* Get the amount of data to be displayed, limited by the amount that we
...
...
@@ -132,47 +117,47 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len,
if
(
nbytes
>
0
)
{
message
(
" %04x: "
,
offset
);
lowsyslog
(
LOG_DEBUG
,
" %04x: "
,
offset
);
for
(
cndx
=
0
;
cndx
<
32
;
cndx
++
)
{
if
(
cndx
==
16
)
{
message
(
" "
);
lowsyslog
(
LOG_DEBUG
,
" "
);
}
if
((
lndx
+
cndx
)
<
len
)
{
message
(
"%02x"
,
data
[
cndx
]);
lowsyslog
(
LOG_DEBUG
,
"%02x"
,
data
[
cndx
]);
}
else
{
message
(
" "
);
lowsyslog
(
LOG_DEBUG
,
" "
);
}
}
message
(
" "
);
lowsyslog
(
LOG_DEBUG
,
" "
);
for
(
cndx
=
0
;
cndx
<
32
;
cndx
++
)
{
if
(
cndx
==
16
)
{
message
(
" "
);
lowsyslog
(
LOG_DEBUG
,
" "
);
}
if
((
lndx
+
cndx
)
<
len
)
{
if
(
data
[
cndx
]
>=
0x20
&&
data
[
cndx
]
<
0x7f
)
{
message
(
"%c"
,
data
[
cndx
]);
lowsyslog
(
LOG_DEBUG
,
"%c"
,
data
[
cndx
]);
}
else
{
message
(
"."
);
lowsyslog
(
LOG_DEBUG
,
"."
);
}
}
}
message
(
"
\n
"
);
lowsyslog
(
LOG_DEBUG
,
"
\n
"
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
net/tcp/tcp_wrbuffer_dump.c
+
2
−
18
View file @
0abe6c66
...
...
@@ -52,22 +52,6 @@
* Pre-processor definitions
****************************************************************************/
/* Select the lowest level debug interface available */
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_ARCH_LOWPUTC
# define message(format, ...) lowsyslog(format, ##__VA_ARGS__)
# else
# define message(format, ...) syslog(format, ##__VA_ARGS__)
# endif
#else
# ifdef CONFIG_ARCH_LOWPUTC
# define message lowsyslog
# else
# define message syslog
# endif
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
...
...
@@ -83,8 +67,8 @@
void
tcp_wrbuffer_dump
(
FAR
const
char
*
msg
,
FAR
struct
tcp_wrbuffer_s
*
wrb
,
unsigned
int
len
,
unsigned
int
offset
)
{
message
(
"%s: wrb=%p segno=%d sent=%d nrtx=%d
\n
"
,
msg
,
wrb
,
WRB_SEQNO
(
wrb
),
WRB_SENT
(
wrb
),
WRB_NRTX
(
wrb
));
lowsyslog
(
LOG_DEBUG
,
"%s: wrb=%p segno=%d sent=%d nrtx=%d
\n
"
,
msg
,
wrb
,
WRB_SEQNO
(
wrb
),
WRB_SENT
(
wrb
),
WRB_NRTX
(
wrb
));
iob_dump
(
"I/O Buffer Chain"
,
WRB_IOB
(
wrb
),
len
,
offset
);
}
...
...
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