|
From: <sv...@va...> - 2005-10-06 03:04:29
|
Author: sewardj
Date: 2005-10-06 04:04:22 +0100 (Thu, 06 Oct 2005)
New Revision: 4872
Log:
Adjustments to the sync-checker:
* show the filename, if any, when printing out disagreeing mappings
* if the kernel offers us a mapping to a file with the name=20
"/dev/zero (deleted)", don't do a /dev/ino comparison.
Modified:
trunk/coregrind/m_aspacemgr/aspacemgr.c
Modified: trunk/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-10-06 02:31:49 UTC (rev =
4871)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-10-06 03:04:22 UTC (rev =
4872)
@@ -490,17 +490,24 @@
static void __attribute__ ((unused))
show_nsegment_full ( Int logLevel, NSegment* seg )
{
+ HChar* name =3D "(none)";
+ if (seg->fnIdx >=3D 0 && seg->fnIdx < segnames_used
+ && segnames[seg->fnIdx].inUse
+ && segnames[seg->fnIdx].fname[0] !=3D 0)
+ name =3D segnames[seg->fnIdx].fname;
+
VG_(debugLog)(logLevel, "aspacem",
"NSegment{%s, start=3D0x%llx, end=3D0x%llx, smode=3D%s, dev=3D%llu=
, "
"ino=3D%llu, offset=3D%llu, fnIdx=3D%d, hasR=3D%d, hasW=3D%d, hasX=
=3D%d, "
- "hasT=3D%d, mark=3D%d}\n",
+ "hasT=3D%d, mark=3D%d, name=3D\"%s\"}\n",
show_SegKind(seg->kind),
(ULong)seg->start,
(ULong)seg->end,
show_ShrinkMode(seg->smode),
(ULong)seg->dev, (ULong)seg->ino, (ULong)seg->offset, seg->fnIdx,
(Int)seg->hasR, (Int)seg->hasW, (Int)seg->hasX, (Int)seg->hasT,
- (Int)seg->mark
+ (Int)seg->mark,=20
+ name
);
}
=20
@@ -904,9 +911,16 @@
=20
cmp_offsets
=3D nsegments[i].kind =3D=3D SkFileC || nsegments[i].kind =3D=3D=
SkFileV;
+
cmp_devino
=3D nsegments[i].dev !=3D 0 || nsegments[i].ino !=3D 0;
=20
+ /* Consider other reasons to not compare dev/inode */
+ /* bproc does some godawful hack on /dev/zero at process
+ migration, which changes the name of it, and its dev & ino */
+ if (filename && 0=3D=3DVG_(strcmp)(filename, "/dev/zero (deleted)"=
))
+ cmp_devino =3D False;
+
same =3D same
&& seg_prot =3D=3D prot
&& (cmp_devino
@@ -930,11 +944,14 @@
=20
show_kern_seg:
VG_(debugLog)(0,"aspacem",
- "sync_check_mapping_callback: segment mismatch: kerne=
l's seg:\n");
+ "sync_check_mapping_callback: "
+ "segment mismatch: kernel's seg:\n");
VG_(debugLog)(0,"aspacem",=20
- "start=3D0x%llx end=3D0x%llx prot=3D%u dev=3D%u ino=3D=
%u offset=3D%lld\n",
+ "start=3D0x%llx end=3D0x%llx prot=3D%u "
+ "dev=3D%u ino=3D%u offset=3D%lld name=3D\"%s\"\n",
(ULong)addr, ((ULong)addr) + ((ULong)len) - 1,
- prot, dev, ino, offset );
+ prot, dev, ino, offset,=20
+ filename ? (HChar*)filename : "(none)" );
return;
}
=20
|