summaryrefslogtreecommitdiff
path: root/libpagemap/pm_process.c
diff options
context:
space:
mode:
authorSelim Gurun <sgurun@google.com>2012-01-20 19:44:54 -0800
committerSelim Gurun <sgurun@google.com>2012-01-20 20:10:22 -0800
commit76e6cb55fed01824e44306aa0485a3f8f122b228 (patch)
treec5abbce40e8fde59895ff7e7a484fc44758fc681 /libpagemap/pm_process.c
parentda63f160c29892a1f4a418e42dbaab57bb038d7c (diff)
downloadextras-76e6cb55fed01824e44306aa0485a3f8f122b228.tar.gz
Fix various issues in procrank.
Fixed these problems: 1. Page swapped bit was not extracted correctly. 2. Pages were ignored when page present bit is not set. 3. Bit operations were not correct. 4. There was a compiler warning about unsigned/signed comparision. 5. Line limit was too short for the map file. This was causing procrank to generate a warning and remove the related process from results. Change-Id: Ifed3913a49b15f59010cfa842090a13228074df9
Diffstat (limited to 'libpagemap/pm_process.c')
-rw-r--r--libpagemap/pm_process.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpagemap/pm_process.c b/libpagemap/pm_process.c
index b3c077ee..dddff011 100644
--- a/libpagemap/pm_process.c
+++ b/libpagemap/pm_process.c
@@ -122,7 +122,7 @@ int pm_process_pagemap_range(pm_process_t *proc,
free(range);
*range_out = NULL;
return 0;
- } else if (error < 0 || (error > 0 && error < numpages * sizeof(uint64_t))) {
+ } else if (error < 0 || (error > 0 && error < (int)(numpages * sizeof(uint64_t)))) {
error = (error < 0) ? errno : -1;
free(range);
return error;
@@ -210,7 +210,7 @@ int pm_process_destroy(pm_process_t *proc) {
}
#define INITIAL_MAPS 10
-#define MAX_LINE 256
+#define MAX_LINE 1024
#define MAX_PERMS 5
/*