summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoît Dejean <bdejean@src.gnome.org>2007-06-25 17:27:29 +0000
committerBenoît Dejean <bdejean@src.gnome.org>2007-06-25 17:27:29 +0000
commit1e0ba1d7aa39c0c33c158073edcdd6bd90a002dd (patch)
treec80b424b0f00c1ce0a2fe81fab4379d17c5daf5e
parent6b0bafcafb6a2bbaf9bacad6088bc801b8f070ae (diff)
downloadlibgtop-1e0ba1d7aa39c0c33c158073edcdd6bd90a002dd.tar.gz
Fixed smaps parsing with linux > 2.6.21.
Closes #449595. Improved example. svn path=/trunk/; revision=2610
-rw-r--r--examples/procmap.c6
-rw-r--r--sysdeps/linux/procmap.c3
2 files changed, 4 insertions, 5 deletions
diff --git a/examples/procmap.c b/examples/procmap.c
index a3de5bf1..46a3a1ea 100644
--- a/examples/procmap.c
+++ b/examples/procmap.c
@@ -140,9 +140,9 @@ main (int argc, char *argv [])
}
- g_print("smaps flags:%#llx size:%llu rss:%llu "
- "shared_clean:%llu shared_dirty:%llu "
- "private_clean:%llu private_dirty: %llu\n",
+ g_print("smaps flags:%#llx size:%lluKiB rss:%lluKiB "
+ "shared_clean:%lluKib shared_dirty:%lluKiB "
+ "private_clean:%lluKiB private_dirty: %lluKiB\n",
maps[i].flags,
maps[i].size >> 10,
maps[i].rss >> 10,
diff --git a/sysdeps/linux/procmap.c b/sysdeps/linux/procmap.c
index e66146d5..f5638bda 100644
--- a/sysdeps/linux/procmap.c
+++ b/sysdeps/linux/procmap.c
@@ -164,11 +164,10 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
if (getline(&line, &line_size, maps) == -1)
break;
- /* 8 arguments */
if (sscanf(line, PROC_MAPS_FORMAT,
&start, &end, flags, &offset,
&dev_major, &dev_minor, &inode, &line_end) != 7)
- break;
+ continue;
filename = line + line_end;
g_strstrip(filename);