Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iproute2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
iproute2
Commits
db08bdb8
Commit
db08bdb8
authored
Jan 20, 2015
by
Vadim Kochan
Committed by
Stephen Hemminger
Feb 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ss: Unify meminfo output
Signed-off-by:
Vadim Kochan
<
vadim4j@gmail.com
>
parent
4cec9db0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
misc/ss.c
misc/ss.c
+18
-12
No files found.
misc/ss.c
View file @
db08bdb8
...
...
@@ -1613,8 +1613,24 @@ static char *sprint_bw(char *buf, double bw)
static
void
print_skmeminfo
(
struct
rtattr
*
tb
[],
int
attrtype
)
{
const
__u32
*
skmeminfo
;
if
(
!
tb
[
attrtype
])
if
(
!
tb
[
attrtype
])
{
if
(
attrtype
==
INET_DIAG_SKMEMINFO
)
{
if
(
!
tb
[
INET_DIAG_MEMINFO
])
return
;
const
struct
inet_diag_meminfo
*
minfo
=
RTA_DATA
(
tb
[
INET_DIAG_MEMINFO
]);
printf
(
" mem:(r%u,w%u,f%u,t%u)"
,
minfo
->
idiag_rmem
,
minfo
->
idiag_wmem
,
minfo
->
idiag_fmem
,
minfo
->
idiag_tmem
);
}
return
;
}
skmeminfo
=
RTA_DATA
(
tb
[
attrtype
]);
printf
(
" skmem:(r%u,rb%u,t%u,tb%u,f%u,w%u,o%u"
,
...
...
@@ -1639,17 +1655,7 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
char
b1
[
64
];
double
rtt
=
0
;
if
(
tb
[
INET_DIAG_SKMEMINFO
])
{
print_skmeminfo
(
tb
,
INET_DIAG_SKMEMINFO
);
}
else
if
(
tb
[
INET_DIAG_MEMINFO
])
{
const
struct
inet_diag_meminfo
*
minfo
=
RTA_DATA
(
tb
[
INET_DIAG_MEMINFO
]);
printf
(
" mem:(r%u,w%u,f%u,t%u)"
,
minfo
->
idiag_rmem
,
minfo
->
idiag_wmem
,
minfo
->
idiag_fmem
,
minfo
->
idiag_tmem
);
}
if
(
tb
[
INET_DIAG_INFO
])
{
struct
tcp_info
*
info
;
...
...
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