Hi, when trying out smaps I have encountered the following problem: > cat /proc/$P/smaps | diff - /proc/$P/smaps 239,241c239,241 < bfbaf000-bfbc4000 rw-p bfbaf000 00:00 0 [stack] < Size: 84 kB < Rss: 24 kB --- > b7fc4000-b7fc6000 rwxp 00015000 08:02 12558 /lib/ld-2.3.4.so > Size: 8 kB > Rss: 8 kB 245c245 < Private_Dirty: 24 kB --- > Private_Dirty: 8 kB Further investigation shows that diff reads /proc/$P/smaps in 1 kB blocks as do cat if stdout is a terminal. But if stdout is a pipe cat reads the file in 128 kB blocks. The culprit is probably fs/proc/task_mmu.c:m_start(). I think it doesn't properly convert the current file position. Reading in blocks up to 3700 bytes yields the correct result. Higher block sizes are wrong. Is that a known problem? Torsten
Attachment:
pgpi2Tm0cc06v.pgp
Description: PGP signature
- Follow-Ups:
- [PATCH] Problem with smaps in 2.6.13-rc4-mm1
- From: Torsten Foertsch <[email protected]>
- [PATCH] Problem with smaps in 2.6.13-rc4-mm1
- Prev by Date: [PATCH 2/8] Move privileged processor operations to the subarch layer
- Next by Date: [PATCH] 3/8 Move sensitive system definitions into the sub-arch layer
- Previous by thread: [PATCH 2/8] Move privileged processor operations to the subarch layer
- Next by thread: [PATCH] Problem with smaps in 2.6.13-rc4-mm1
- Index(es):