Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
27cc1441
Commit
27cc1441
authored
Dec 06, 2016
by
Stéphane Graber
Committed by
GitHub
Dec 06, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1342 from brauner/2016-12-06/fix_printf_lxc_top
tools: account for different architectures
parents
862722a2
9dba726e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
lxc_top.c
src/lxc/tools/lxc_top.c
+10
-10
No files found.
src/lxc/tools/lxc_top.c
View file @
27cc1441
...
@@ -21,11 +21,14 @@
...
@@ -21,11 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#define __STDC_FORMAT_MACROS
/* Required for PRIu64 to work. */
#include <errno.h>
#include <errno.h>
#include <inttypes.h>
#include <signal.h>
#include <signal.h>
#include <stdbool.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <stdint.h>
#include <termios.h>
#include <termios.h>
#include <unistd.h>
#include <unistd.h>
#include <sys/epoll.h>
#include <sys/epoll.h>
...
@@ -337,16 +340,13 @@ static void stats_print(const char *name, const struct stats *stats,
...
@@ -337,16 +340,13 @@ static void stats_print(const char *name, const struct stats *stats,
}
else
{
}
else
{
gettimeofday
(
&
time_val
,
NULL
);
gettimeofday
(
&
time_val
,
NULL
);
time_ms
=
(
unsigned
long
long
)
(
time_val
.
tv_sec
)
*
1000
+
(
unsigned
long
long
)
(
time_val
.
tv_usec
)
/
1000
;
time_ms
=
(
unsigned
long
long
)
(
time_val
.
tv_sec
)
*
1000
+
(
unsigned
long
long
)
(
time_val
.
tv_usec
)
/
1000
;
printf
(
"%llu,%s,%lu,%lu,%lu,%lu,%lu,%lu,%lu"
,
printf
(
"%"
PRIu64
",%s,%"
PRIu64
",%"
PRIu64
",%"
PRIu64
time_ms
,
",%"
PRIu64
",%"
PRIu64
",%"
PRIu64
",%"
PRIu64
,
name
,
(
uint64_t
)
time_ms
,
name
,
(
uint64_t
)
stats
->
cpu_use_nanos
,
stats
->
cpu_use_nanos
,
(
uint64_t
)
stats
->
cpu_use_sys
,
stats
->
cpu_use_sys
,
(
uint64_t
)
stats
->
cpu_use_user
,
(
uint64_t
)
stats
->
blkio
,
stats
->
cpu_use_user
,
(
uint64_t
)
stats
->
blkio_iops
,
(
uint64_t
)
stats
->
mem_used
,
stats
->
blkio
,
(
uint64_t
)
stats
->
kmem_used
);
stats
->
blkio_iops
,
stats
->
mem_used
,
stats
->
kmem_used
);
}
}
}
}
...
...
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