Snap for 4683893 from 136f765fb32bbc8dc8b22645a6fbbf83475d1ec6 to pi-release
Change-Id: Ibe1b07efe8d032d44d2c828bae218c56d4e8078a
This commit is contained in:
commit
ba824be447
7
lmkd.c
7
lmkd.c
|
|
@ -75,6 +75,9 @@
|
||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
|
||||||
#define EIGHT_MEGA (1 << 23)
|
#define EIGHT_MEGA (1 << 23)
|
||||||
|
|
||||||
|
#define STRINGIFY(x) STRINGIFY_INTERNAL(x)
|
||||||
|
#define STRINGIFY_INTERNAL(x) #x
|
||||||
|
|
||||||
/* default to old in-kernel interface if no memory pressure events */
|
/* default to old in-kernel interface if no memory pressure events */
|
||||||
static int use_inkernel_interface = 1;
|
static int use_inkernel_interface = 1;
|
||||||
static bool has_inkernel_module;
|
static bool has_inkernel_module;
|
||||||
|
|
@ -555,10 +558,10 @@ static void ctrl_connect_handler(int data __unused, uint32_t events __unused) {
|
||||||
|
|
||||||
#ifdef LMKD_LOG_STATS
|
#ifdef LMKD_LOG_STATS
|
||||||
static void memory_stat_parse_line(char *line, struct memory_stat *mem_st) {
|
static void memory_stat_parse_line(char *line, struct memory_stat *mem_st) {
|
||||||
char key[LINE_MAX];
|
char key[LINE_MAX + 1];
|
||||||
int64_t value;
|
int64_t value;
|
||||||
|
|
||||||
sscanf(line,"%s %" SCNd64 "", key, &value);
|
sscanf(line, "%" STRINGIFY(LINE_MAX) "s %" SCNd64 "", key, &value);
|
||||||
|
|
||||||
if (strcmp(key, "total_") < 0) {
|
if (strcmp(key, "total_") < 0) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue