You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(10) |
2
(8) |
3
(17) |
4
(28) |
5
(22) |
6
(8) |
|
7
(8) |
8
(22) |
9
(12) |
10
(17) |
11
(14) |
12
(15) |
13
(6) |
|
14
(9) |
15
(9) |
16
(16) |
17
(13) |
18
(18) |
19
(7) |
20
(5) |
|
21
(6) |
22
(5) |
23
(11) |
24
(5) |
25
(11) |
26
(7) |
27
(15) |
|
28
(11) |
29
(12) |
30
(12) |
31
(15) |
|
|
|
|
From: <sv...@va...> - 2007-10-04 23:12:12
|
Author: dirk
Date: 2007-10-05 00:12:12 +0100 (Fri, 05 Oct 2007)
New Revision: 6951
Log:
fix format strings for the tools (except for helgrind)
Modified:
branches/FORMATCHECK/callgrind/bb.c
branches/FORMATCHECK/callgrind/bbcc.c
branches/FORMATCHECK/callgrind/callstack.c
branches/FORMATCHECK/callgrind/debug.c
branches/FORMATCHECK/callgrind/dump.c
branches/FORMATCHECK/callgrind/fn.c
branches/FORMATCHECK/callgrind/main.c
branches/FORMATCHECK/callgrind/sim.c
branches/FORMATCHECK/memcheck/mc_leakcheck.c
branches/FORMATCHECK/memcheck/mc_main.c
Modified: branches/FORMATCHECK/callgrind/bb.c
===================================================================
--- branches/FORMATCHECK/callgrind/bb.c 2007-10-04 22:48:53 UTC (rev 6950)
+++ branches/FORMATCHECK/callgrind/bb.c 2007-10-04 23:12:12 UTC (rev 6951)
@@ -187,7 +187,7 @@
bb = bb->next;
}
- CLG_DEBUG(5, " lookup_bb (Obj %s, off %p): %p\n",
+ CLG_DEBUG(5, " lookup_bb (Obj %s, off %#lx): %p\n",
obj->name, offset, bb);
return bb;
}
@@ -207,7 +207,7 @@
if (obj->offset != offset) {
Addr start = si ? VG_(seginfo_start)(si) : 0;
- CLG_DEBUG(0, "Mapping changed for '%s': %p -> %p\n",
+ CLG_DEBUG(0, "Mapping changed for '%s': %#lx -> %#lx\n",
obj->name, obj->start, start);
/* Size should be the same, and offset diff == start diff */
@@ -242,7 +242,7 @@
UInt n_instrs, n_jmps;
Bool cjmp_inverted = False;
- CLG_DEBUG(5, "+ get_bb(BB %p)\n", addr);
+ CLG_DEBUG(5, "+ get_bb(BB %#lx)\n", addr);
obj = obj_of_address(addr);
bb = lookup_bb(obj, addr - obj->offset);
@@ -269,13 +269,13 @@
CLG_ASSERT(bb->cjmp_count == n_jmps );
CLG_(stat).bb_retranslations++;
- CLG_DEBUG(5, "- get_bb(BB %p): seen before.\n", addr);
+ CLG_DEBUG(5, "- get_bb(BB %#lx): seen before.\n", addr);
return bb;
}
bb = new_bb(obj, addr - obj->offset, n_instrs, n_jmps, cjmp_inverted);
- CLG_DEBUG(5, "- get_bb(BB %p)\n", addr);
+ CLG_DEBUG(5, "- get_bb(BB %#lx)\n", addr);
return bb;
}
@@ -303,7 +303,7 @@
}
if (bb == NULL) {
- CLG_DEBUG(3, " delete_bb (Obj %s, off %p): NOT FOUND\n",
+ CLG_DEBUG(3, " delete_bb (Obj %s, off %lx): NOT FOUND\n",
obj->name, offset);
/* we didn't find it.
@@ -324,7 +324,7 @@
bp->next = bb->next;
}
- CLG_DEBUG(3, " delete_bb (Obj %s, off %p): %p, BBCC head: %p\n",
+ CLG_DEBUG(3, " delete_bb (Obj %s, off %#lx): %p, BBCC head: %p\n",
obj->name, offset, bb, bb->bbcc_list);
if (bb->bbcc_list == 0) {
Modified: branches/FORMATCHECK/callgrind/bbcc.c
===================================================================
--- branches/FORMATCHECK/callgrind/bbcc.c 2007-10-04 22:48:53 UTC (rev 6950)
+++ branches/FORMATCHECK/callgrind/bbcc.c 2007-10-04 23:12:12 UTC (rev 6951)
@@ -85,7 +85,7 @@
jCC* jcc;
CLG_ASSERT(bbcc->cxt != 0);
- CLG_DEBUG(1, " zero_bbcc: BB %p, Cxt %d "
+ CLG_DEBUG(1, " zero_bbcc: BB %lx, Cxt %d "
"(fn '%s', rec %d)\n",
bb_addr(bbcc->bb),
bbcc->cxt->base_number + bbcc->rec_index,
@@ -177,7 +177,7 @@
bbcc = bbcc->next;
}
- CLG_DEBUG(2," lookup_bbcc(BB %p, Cxt %d, fn '%s'): %p (tid %d)\n",
+ CLG_DEBUG(2," lookup_bbcc(BB %lx, Cxt %d, fn '%s'): %p (tid %d)\n",
bb_addr(bb), cxt->base_number, cxt->fn[0]->name,
bbcc, bbcc ? bbcc->tid : 0);
@@ -294,7 +294,7 @@
CLG_(stat).distinct_bbccs++;
- CLG_DEBUG(3, " new_bbcc(BB %p): %p (now %d)\n",
+ CLG_DEBUG(3, " new_bbcc(BB %lx): %p (now %d)\n",
bb_addr(bb), new, CLG_(stat).distinct_bbccs);
return new;
@@ -319,7 +319,7 @@
CLG_ASSERT(bbcc->cxt != 0);
- CLG_DEBUG(3,"+ insert_bbcc_into_hash(BB %p, fn '%s')\n",
+ CLG_DEBUG(3,"+ insert_bbcc_into_hash(BB %lx, fn '%s')\n",
bb_addr(bbcc->bb), bbcc->cxt->fn[0]->name);
/* check fill degree of hash and resize if needed (>90%) */
@@ -368,7 +368,7 @@
{
BBCC* new;
- CLG_DEBUG(3,"+ clone_bbcc(BB %p, rec %d, fn %s)\n",
+ CLG_DEBUG(3,"+ clone_bbcc(BB %lx, rec %d, fn %s)\n",
bb_addr(orig->bb), rec_index, cxt->fn[0]->name);
new = new_bbcc(orig->bb);
@@ -410,7 +410,7 @@
CLG_DEBUGIF(3)
CLG_(print_bbcc)(-2, new, False);
- CLG_DEBUG(2,"- clone_BBCC(%p, %d) for BB %p\n"
+ CLG_DEBUG(2,"- clone_BBCC(%p, %d) for BB %#lx\n"
" orig %s\n"
" new %s\n",
orig, rec_index, bb_addr(orig->bb),
@@ -433,7 +433,7 @@
{
BBCC* bbcc;
- CLG_DEBUG(3, "+ get_bbcc(BB %p)\n", bb_addr(bb));
+ CLG_DEBUG(3, "+ get_bbcc(BB %#lx)\n", bb_addr(bb));
bbcc = bb->bbcc_list;
@@ -453,7 +453,7 @@
CLG_(print_bbcc)(-2, bbcc, False);
}
- CLG_DEBUG(3, "- get_bbcc(BB %p): BBCC %p\n",
+ CLG_DEBUG(3, "- get_bbcc(BB %#lx): BBCC %p\n",
bb_addr(bb), bbcc);
return bbcc;
@@ -558,7 +558,7 @@
Bool ret_without_call = False;
Int popcount_on_return = 1;
- CLG_DEBUG(3,"+ setup_bbcc(BB %p)\n", bb_addr(bb));
+ CLG_DEBUG(3,"+ setup_bbcc(BB %#lx)\n", bb_addr(bb));
/* This is needed because thread switches can not reliable be tracked
* with callback CLG_(run_thread) only: we have otherwise no way to get
@@ -714,7 +714,7 @@
else
ppIRJumpKind( jmpkind );
- VG_(printf)(" %08lx -> %08x, SP %08x\n",
+ VG_(printf)(" %08lx -> %08lx, SP %08lx\n",
last_bb ? bb_jmpaddr(last_bb) : 0,
bb_addr(bb), sp);
}
@@ -870,7 +870,7 @@
VG_(printf)("\n");
}
- CLG_DEBUG(3,"- setup_bbcc (BB %p): Cost %p (Len %d), Instrs %d (Len %d)\n",
+ CLG_DEBUG(3,"- setup_bbcc (BB %#lx): Cost %p (Len %d), Instrs %d (Len %d)\n",
bb_addr(bb), bbcc->cost, bb->cost_count,
bb->instr_count, bb->instr_len);
CLG_DEBUGIF(3)
Modified: branches/FORMATCHECK/callgrind/callstack.c
===================================================================
--- branches/FORMATCHECK/callgrind/callstack.c 2007-10-04 22:48:53 UTC (rev 6950)
+++ branches/FORMATCHECK/callgrind/callstack.c 2007-10-04 23:12:12 UTC (rev 6951)
@@ -275,7 +275,7 @@
BB* bb = jcc->to->bb;
if (s>40) s=40;
- VG_(printf)("%s> %s(0x%x, 0x%x, ...) [%s / %p]\n", spaces[s%4]+40-s, bb->fn->name,
+ VG_(printf)("%s> %s(0x%x, 0x%x, ...) [%s / %#lx]\n", spaces[s%4]+40-s, bb->fn->name,
pars ? pars[1]:0,
pars ? pars[2]:0,
bb->obj->name + bb->obj->last_slash_pos,
@@ -285,7 +285,7 @@
else if (CLG_(clo).verbose<4) {
VG_(printf)("+ %2d ", CLG_(current_call_stack).sp);
CLG_(print_short_jcc)(jcc);
- VG_(printf)(", SP %p, RA %p\n", sp, ret_addr);
+ VG_(printf)(", SP %#lx, RA %#lx\n", sp, ret_addr);
}
else {
VG_(printf)(" Pushed ");
@@ -365,16 +365,16 @@
if (CLG_(clo).verbose<4) {
if (jcc) {
/* popped JCC target first */
- VG_(printf)("- %2d %p => ",
+ VG_(printf)("- %2d %#lx => ",
CLG_(current_call_stack).sp,
bb_addr(jcc->to->bb));
CLG_(print_addr)(bb_jmpaddr(jcc->from->bb));
- VG_(printf)(", SP %p\n",
+ VG_(printf)(", SP %#lx\n",
CLG_(current_call_stack).entry[CLG_(current_call_stack).sp].sp);
CLG_(print_cost)(10, CLG_(sets).full, jcc->cost);
}
else
- VG_(printf)("- %2d [Skipped JCC], SP %p\n",
+ VG_(printf)("- %2d [Skipped JCC], SP %#lx\n",
CLG_(current_call_stack).sp,
CLG_(current_call_stack).entry[CLG_(current_call_stack).sp].sp);
}
@@ -397,7 +397,7 @@
void CLG_(unwind_call_stack)(Addr sp, Int minpops)
{
Int csp;
- CLG_DEBUG(4,"+ unwind_call_stack(sp %p, minpops %d): frame %d\n",
+ CLG_DEBUG(4,"+ unwind_call_stack(sp %#lx, minpops %d): frame %d\n",
sp, minpops, CLG_(current_call_stack).sp);
/* We pop old stack frames.
Modified: branches/FORMATCHECK/callgrind/debug.c
===================================================================
--- branches/FORMATCHECK/callgrind/debug.c 2007-10-04 22:48:53 UTC (rev 6950)
+++ branches/FORMATCHECK/callgrind/debug.c 2007-10-04 23:12:12 UTC (rev 6951)
@@ -51,7 +51,7 @@
print_indent(s);
}
- VG_(printf)("BB %p (Obj '%s')", bb_addr(bb), bb->obj->name);
+ VG_(printf)("BB %#lx (Obj '%s')", bb_addr(bb), bb->obj->name);
}
static
@@ -136,7 +136,7 @@
bb->jmp_offset, bb_jmpaddr(bb));
else
#endif
- VG_(printf)("%s +%p=%p, ",
+ VG_(printf)("%s +%#lx=%#lx, ",
bb->obj->name + bb->obj->last_slash_pos,
bb->offset, bb_addr(bb));
CLG_(print_cxt)(s+8, bbcc->cxt, bbcc->rec_index);
@@ -220,7 +220,7 @@
void CLG_(print_short_jcc)(jCC* jcc)
{
if (jcc)
- VG_(printf)("%p => %p [%llu/%llu,%llu,%llu]",
+ VG_(printf)("%#lx => %#lx [%llu/%llu,%llu,%llu]",
bb_jmpaddr(jcc->from->bb),
bb_addr(jcc->to->bb),
jcc->call_counter,
@@ -264,9 +264,9 @@
}
ce = CLG_(get_call_entry)(sp);
- VG_(printf)("[%-2d] SP %p, RA %p", sp, ce->sp, ce->ret_addr);
+ VG_(printf)("[%-2d] SP %#lx, RA %#lx", sp, ce->sp, ce->ret_addr);
if (ce->nonskipped)
- VG_(printf)(" NonSkipped BB %p / %s",
+ VG_(printf)(" NonSkipped BB %#lx / %s",
bb_addr(ce->nonskipped->bb),
ce->nonskipped->cxt->fn[0]->name);
VG_(printf)("\n");
@@ -381,9 +381,9 @@
CLG_(get_debug_info)(addr, fl_buf, fn_buf, &ln, &si);
if (VG_(strcmp)(fn_buf,"???")==0)
- VG_(printf)("%p", addr);
+ VG_(printf)("%#lx", addr);
else
- VG_(printf)("%p %s", addr, fn_buf);
+ VG_(printf)("%#lx %s", addr, fn_buf);
if (si) {
obj_name = VG_(seginfo_filename)(si);
Modified: branches/FORMATCHECK/callgrind/dump.c
===================================================================
--- branches/FORMATCHECK/callgrind/dump.c 2007-10-04 22:48:53 UTC (rev 6950)
+++ branches/FORMATCHECK/callgrind/dump.c 2007-10-04 23:12:12 UTC (rev 6951)
@@ -477,7 +477,7 @@
p->addr = addr - bbcc->bb->obj->offset;
p->bb_addr = bbcc->bb->offset;
- CLG_DEBUG(3, " get_debug_pos(%p): BB %p, fn '%s', file '%s', line %u\n",
+ CLG_DEBUG(3, " get_debug_pos(%#lx): BB %#lx, fn '%s', file '%s', line %u\n",
addr, bb_addr(bbcc->bb), bbcc->cxt->fn[0]->name,
p->file->name, p->line);
@@ -519,7 +519,7 @@
static void fprint_apos(Int fd, AddrPos* curr, AddrPos* last, file_node* func_file)
{
CLG_ASSERT(curr->file != 0);
- CLG_DEBUG(2, " print_apos(file '%s', line %d, bb %p, addr %p) fnFile '%s'\n",
+ CLG_DEBUG(2, " print_apos(file '%s', line %d, bb %#lx, addr %#lx) fnFile '%s'\n",
curr->file->name, curr->line, curr->bb_addr, curr->addr,
func_file->name);
@@ -569,7 +569,7 @@
p = VG_(sprintf)(outbuf, "%d ", diff);
}
else
- p = VG_(sprintf)(outbuf, "%p ", curr->addr);
+ p = VG_(sprintf)(outbuf, "%#lx ", curr->addr);
}
if (CLG_(clo).dump_bb) {
@@ -584,7 +584,7 @@
p += VG_(sprintf)(outbuf+p, "%d ", diff);
}
else
- p += VG_(sprintf)(outbuf+p, "%p ", curr->bb_addr);
+ p += VG_(sprintf)(outbuf+p, "%#lx ", curr->bb_addr);
}
if (CLG_(clo).dump_line) {
@@ -630,7 +630,7 @@
static void fprint_fcost(Int fd, AddrCost* c, AddrPos* last)
{
CLG_DEBUGIF(3) {
- CLG_DEBUG(2, " print_fcost(file '%s', line %d, bb %p, addr %p):\n",
+ CLG_DEBUG(2, " print_fcost(file '%s', line %d, bb %#lx, addr %#lx):\n",
c->p.file->name, c->p.line, c->p.bb_addr, c->p.addr);
CLG_(print_cost)(-5, CLG_(sets).full, c->cost);
}
@@ -1027,7 +1027,7 @@
CLG_DEBUGIF(8) {
for (pm = a; pm < a+n; pm++) {
- VG_(printf)(" %3d BB %p, ", pm - qsort_start,
+ VG_(printf)(" %3d BB %#lx, ", pm - qsort_start,
bb_addr((*pm)->bb));
CLG_(print_cxt)(9, (*pm)->cxt, (*pm)->rec_index);
}
@@ -1081,14 +1081,14 @@
if ((s = a+n-1-pd)>0) { for(r=0;r<s;r++) swap(pc+r, a+n-s+r); }
CLG_DEBUGIF(8) {
- VG_(printf)(" PV BB %p, ", bb_addr((*pv)->bb));
+ VG_(printf)(" PV BB %#lx, ", bb_addr((*pv)->bb));
CLG_(print_cxt)(9, (*pv)->cxt, (*pv)->rec_index);
s = pb-pa+1;
VG_(printf)(" Lower %d - %d:\n", a-qsort_start, a+s-1-qsort_start);
for (r=0;r<s;r++) {
pm = a+r;
- VG_(printf)(" %3d BB %p, ",
+ VG_(printf)(" %3d BB %#lx, ",
pm-qsort_start,bb_addr((*pm)->bb));
CLG_(print_cxt)(9, (*pm)->cxt, (*pm)->rec_index);
}
@@ -1098,7 +1098,7 @@
a+n-s-qsort_start, a+n-1-qsort_start);
for (r=0;r<s;r++) {
pm = a+n-s+r;
- VG_(printf)(" %3d BB %p, ",
+ VG_(printf)(" %3d BB %#lx, ",
pm-qsort_start,bb_addr((*pm)->bb));
CLG_(print_cxt)(9, (*pm)->cxt, (*pm)->rec_index);
}
@@ -1549,7 +1549,7 @@
/* FIXME: Specify Object of BB if different to object of fn */
int i, pos = 0;
ULong ecounter = (*p)->ecounter_sum;
- pos = VG_(sprintf)(print_buf, "bb=%p ", (*p)->bb->offset);
+ pos = VG_(sprintf)(print_buf, "bb=%#lx ", (*p)->bb->offset);
for(i = 0; i<(*p)->bb->cjmp_count;i++) {
pos += VG_(sprintf)(print_buf+pos, "%d %llu ",
(*p)->bb->jmp[i].instr,
Modified: branches/FORMATCHECK/callgrind/fn.c
===================================================================
--- branches/FORMATCHECK/callgrind/fn.c 2007-10-04 22:48:53 UTC (rev 6950)
+++ branches/FORMATCHECK/callgrind/fn.c 2007-10-04 23:12:12 UTC (rev 6951)
@@ -128,7 +128,7 @@
r = range + 2;
found = True;
while(r[1]) {
- CLG_DEBUG(1, " [%p] Found! Checking %d bytes of [%x %x %x...]\n",
+ CLG_DEBUG(1, " [%#lx] Found! Checking %d bytes of [%x %x %x...]\n",
addr, r[1], code[r[0]], code[r[0]+1], code[r[0]+2]);
if (VG_(memcmp)( (void*)(addr+r[0]), code+r[0], r[1]) != 0) {
@@ -372,7 +372,7 @@
Char dir[FILENAME_LEN];
UInt line;
- CLG_DEBUG(6, " + get_debug_info(%p)\n", instr_addr);
+ CLG_DEBUG(6, " + get_debug_info(%#lx)\n", instr_addr);
if (pSegInfo) {
*pSegInfo = VG_(find_seginfo)(instr_addr);
@@ -418,7 +418,7 @@
if (line_num) *line_num=0;
}
- CLG_DEBUG(6, " - get_debug_info(%p): seg '%s', fn %s\n",
+ CLG_DEBUG(6, " - get_debug_info(%#lx): seg '%s', fn %s\n",
instr_addr,
!pSegInfo ? (const UChar*)"-" :
(*pSegInfo) ? VG_(seginfo_filename)(*pSegInfo) :
@@ -445,7 +445,7 @@
/* fn from debug info is idempotent for a BB */
if (bb->fn) return bb->fn;
- CLG_DEBUG(3,"+ get_fn_node(BB %p)\n", bb_addr(bb));
+ CLG_DEBUG(3,"+ get_fn_node(BB %#lx)\n", bb_addr(bb));
/* get function/file name, line number and object of
* the BB according to debug information
@@ -458,10 +458,10 @@
/* Use address as found in library */
if (sizeof(Addr) == 4)
- p = VG_(sprintf)(fnname, "%08p", bb->offset);
+ p = VG_(sprintf)(fnname, "%#08lx", bb->offset);
else
// 64bit address
- p = VG_(sprintf)(fnname, "%016p", bb->offset);
+ p = VG_(sprintf)(fnname, "%#016lx", bb->offset);
VG_(sprintf)(fnname+p, "%s",
(bb->sect_kind == Vg_SectData) ? " [Data]" :
@@ -536,7 +536,7 @@
bb->fn = fn;
bb->line = line_num;
- CLG_DEBUG(3,"- get_fn_node(BB %p): %s (in %s:%u)\n",
+ CLG_DEBUG(3,"- get_fn_node(BB %#lx): %s (in %s:%u)\n",
bb_addr(bb), fnname, filename, line_num);
return fn;
Modified: branches/FORMATCHECK/callgrind/main.c
===================================================================
--- branches/FORMATCHECK/callgrind/main.c 2007-10-04 22:48:53 UTC (rev 6950)
+++ branches/FORMATCHECK/callgrind/main.c 2007-10-04 23:12:12 UTC (rev 6951)
@@ -522,12 +522,12 @@
// No instrumentation if it is switched off
if (! CLG_(instrument_state)) {
- CLG_DEBUG(5, "instrument(BB %p) [Instrumentation OFF]\n",
+ CLG_DEBUG(5, "instrument(BB %#lx) [Instrumentation OFF]\n",
(Addr)closure->readdr);
return bbIn;
}
- CLG_DEBUG(3, "+ instrument(BB %p)\n", (Addr)closure->readdr);
+ CLG_DEBUG(3, "+ instrument(BB %#lx)\n", (Addr)closure->readdr);
/* Set up SB for instrumented IR */
bbOut = deepCopyIRSBExceptStmts(bbIn);
@@ -681,7 +681,7 @@
bb->jmpkind = bbIn->jumpkind;
}
- CLG_DEBUG(3, "- instrument(BB %p): byteLen %u, CJumps %u, CostLen %u\n",
+ CLG_DEBUG(3, "- instrument(BB %#lx): byteLen %u, CJumps %u, CostLen %u\n",
origAddr, bb->instr_len, bb->cjmp_count, bb->cost_count);
if (cJumps>0) {
CLG_DEBUG(3, " [ ");
Modified: branches/FORMATCHECK/callgrind/sim.c
===================================================================
--- branches/FORMATCHECK/callgrind/sim.c 2007-10-04 22:48:53 UTC (rev 6950)
+++ branches/FORMATCHECK/callgrind/sim.c 2007-10-04 23:12:12 UTC (rev 6951)
@@ -790,7 +790,7 @@
UWord *set, tmp_tag; \
UInt use_mask; \
\
- CLG_DEBUG(6,"%s.Acc(Addr %p, size %d): Sets [%d/%d]\n", \
+ CLG_DEBUG(6,"%s.Acc(Addr %#lx, size %d): Sets [%d/%d]\n", \
L.name, a, size, set1, set2); \
\
/* First case: word entirely within line. */ \
@@ -808,7 +808,7 @@
idx = (set1 << L.assoc_bits) | (set[0] & ~L.tag_mask); \
L.use[idx].count ++; \
L.use[idx].mask |= use_mask; \
- CLG_DEBUG(6," Hit0 [idx %d] (line %p from %p): %x => %08x, count %d\n",\
+ CLG_DEBUG(6," Hit0 [idx %d] (line %#lx from %#lx): %x => %08x, count %d\n",\
idx, L.loaded[idx].memline, L.loaded[idx].iaddr, \
use_mask, L.use[idx].mask, L.use[idx].count); \
return L1_Hit; \
@@ -825,7 +825,7 @@
idx = (set1 << L.assoc_bits) | (tmp_tag & ~L.tag_mask); \
L.use[idx].count ++; \
L.use[idx].mask |= use_mask; \
- CLG_DEBUG(6," Hit%d [idx %d] (line %p from %p): %x => %08x, count %d\n",\
+ CLG_DEBUG(6," Hit%d [idx %d] (line %#lx from %#lx): %x => %08x, count %d\n",\
i, idx, L.loaded[idx].memline, L.loaded[idx].iaddr, \
use_mask, L.use[idx].mask, L.use[idx].count); \
return L1_Hit; \
@@ -852,7 +852,7 @@
idx = (set1 << L.assoc_bits) | (set[0] & ~L.tag_mask); \
L.use[idx].count ++; \
L.use[idx].mask |= use_mask; \
- CLG_DEBUG(6," Hit0 [idx %d] (line %p from %p): %x => %08x, count %d\n",\
+ CLG_DEBUG(6," Hit0 [idx %d] (line %#lx from %#lx): %x => %08x, count %d\n",\
idx, L.loaded[idx].memline, L.loaded[idx].iaddr, \
use_mask, L.use[idx].mask, L.use[idx].count); \
goto block2; \
@@ -867,7 +867,7 @@
idx = (set1 << L.assoc_bits) | (tmp_tag & ~L.tag_mask); \
L.use[idx].count ++; \
L.use[idx].mask |= use_mask; \
- CLG_DEBUG(6," Hit%d [idx %d] (line %p from %p): %x => %08x, count %d\n",\
+ CLG_DEBUG(6," Hit%d [idx %d] (line %#lx from %#lx): %x => %08x, count %d\n",\
i, idx, L.loaded[idx].memline, L.loaded[idx].iaddr, \
use_mask, L.use[idx].mask, L.use[idx].count); \
goto block2; \
@@ -889,7 +889,7 @@
idx = (set2 << L.assoc_bits) | (set[0] & ~L.tag_mask); \
L.use[idx].count ++; \
L.use[idx].mask |= use_mask; \
- CLG_DEBUG(6," Hit0 [idx %d] (line %p from %p): %x => %08x, count %d\n",\
+ CLG_DEBUG(6," Hit0 [idx %d] (line %#lx from %#lx): %x => %08x, count %d\n",\
idx, L.loaded[idx].memline, L.loaded[idx].iaddr, \
use_mask, L.use[idx].mask, L.use[idx].count); \
return miss1; \
@@ -904,7 +904,7 @@
idx = (set2 << L.assoc_bits) | (tmp_tag & ~L.tag_mask); \
L.use[idx].count ++; \
L.use[idx].mask |= use_mask; \
- CLG_DEBUG(6," Hit%d [idx %d] (line %p from %p): %x => %08x, count %d\n",\
+ CLG_DEBUG(6," Hit%d [idx %d] (line %lx from %#lx): %x => %08x, count %d\n",\
i, idx, L.loaded[idx].memline, L.loaded[idx].iaddr, \
use_mask, L.use[idx].mask, L.use[idx].count); \
return miss1; \
@@ -921,7 +921,7 @@
return (miss1==MemAccess || miss2==MemAccess) ? MemAccess:L2_Hit; \
\
} else { \
- VG_(printf)("addr: %p size: %u sets: %d %d", a, size, set1, set2); \
+ VG_(printf)("addr: %#lx size: %u sets: %d %d", a, size, set1, set2); \
VG_(tool_panic)("item straddles more than two cache sets"); \
} \
return 0; \
@@ -952,10 +952,10 @@
line_use* use = &(L2.use[idx]);
int i = ((32 - countBits(use->mask)) * L2.line_size)>>5;
- CLG_DEBUG(2, " L2.miss [%d]: at %p accessing memline %p\n",
+ CLG_DEBUG(2, " L2.miss [%d]: at %#lx accessing memline %#lx\n",
idx, bb_base + current_ii->instr_offset, memline);
if (use->count>0) {
- CLG_DEBUG(2, " old: used %d, loss bits %d (%08x) [line %p from %p]\n",
+ CLG_DEBUG(2, " old: used %d, loss bits %d (%08x) [line %#lx from %#lx]\n",
use->count, i, use->mask, loaded->memline, loaded->iaddr);
CLG_DEBUG(2, " collect: %d, use_base %p\n",
CLG_(current_state).collect, loaded->use_base);
@@ -986,13 +986,13 @@
int i, j, idx;
UWord tmp_tag;
- CLG_DEBUG(6,"L2.Acc(Memline %p): Set %d\n", memline, setNo);
+ CLG_DEBUG(6,"L2.Acc(Memline %#lx): Set %d\n", memline, setNo);
if (tag == (set[0] & L2.tag_mask)) {
idx = (setNo << L2.assoc_bits) | (set[0] & ~L2.tag_mask);
l1_loaded->dep_use = &(L2.use[idx]);
- CLG_DEBUG(6," Hit0 [idx %d] (line %p from %p): => %08x, count %d\n",
+ CLG_DEBUG(6," Hit0 [idx %d] (line %#lx from %#lx): => %08x, count %d\n",
idx, L2.loaded[idx].memline, L2.loaded[idx].iaddr,
L2.use[idx].mask, L2.use[idx].count);
return L2_Hit;
@@ -1007,7 +1007,7 @@
idx = (setNo << L2.assoc_bits) | (tmp_tag & ~L2.tag_mask);
l1_loaded->dep_use = &(L2.use[idx]);
- CLG_DEBUG(6," Hit%d [idx %d] (line %p from %p): => %08x, count %d\n",
+ CLG_DEBUG(6," Hit%d [idx %d] (line %#lx from %#lx): => %08x, count %d\n",
i, idx, L2.loaded[idx].memline, L2.loaded[idx].iaddr,
L2.use[idx].mask, L2.use[idx].count);
return L2_Hit;
@@ -1040,10 +1040,10 @@
line_use* use = &(cache->use[idx]); \
int c = ((32 - countBits(use->mask)) * cache->line_size)>>5; \
\
- CLG_DEBUG(2, " %s.miss [%d]: at %p accessing memline %p (mask %08x)\n", \
+ CLG_DEBUG(2, " %s.miss [%d]: at %#lx accessing memline %#lx (mask %08x)\n", \
cache->name, idx, bb_base + current_ii->instr_offset, memline, mask); \
if (use->count>0) { \
- CLG_DEBUG(2, " old: used %d, loss bits %d (%08x) [line %p from %p]\n",\
+ CLG_DEBUG(2, " old: used %d, loss bits %d (%08x) [line %#lx from %#lx]\n",\
use->count, c, use->mask, loaded->memline, loaded->iaddr); \
CLG_DEBUG(2, " collect: %d, use_base %p\n", \
CLG_(current_state).collect, loaded->use_base); \
@@ -1149,7 +1149,7 @@
current_ii = ii;
IrRes = (*simulator.I1_Read)(bb_base + ii->instr_offset, ii->instr_size);
- CLG_DEBUG(6, "log_1I0D: Ir=%p/%u => Ir %d\n",
+ CLG_DEBUG(6, "log_1I0D: Ir=%#lx/%u => Ir %d\n",
bb_base + ii->instr_offset, ii->instr_size, IrRes);
if (CLG_(current_state).collect) {
@@ -1177,7 +1177,7 @@
IrRes = (*simulator.I1_Read)(bb_base + ii->instr_offset, ii->instr_size);
DrRes = (*simulator.D1_Read)(data, ii->data_size);
- CLG_DEBUG(6, "log_1I1Dr: Ir=%p/%u, Dr=%p/%u => Ir %d, Dr %d\n",
+ CLG_DEBUG(6, "log_1I1Dr: Ir=%#lx/%u, Dr=%#lx/%u => Ir %d, Dr %d\n",
bb_base + ii->instr_offset, ii->instr_size,
data, ii->data_size, IrRes, DrRes);
@@ -1209,7 +1209,7 @@
current_ii = ii;
DrRes = (*simulator.D1_Read)(data, ii->data_size);
- CLG_DEBUG(6, "log_0I1Dr: Dr=%p/%u => Dr %d\n",
+ CLG_DEBUG(6, "log_0I1Dr: Dr=%#lx/%u => Dr %d\n",
data, ii->data_size, DrRes);
if (CLG_(current_state).collect) {
@@ -1239,7 +1239,7 @@
IrRes = (*simulator.I1_Read)(bb_base + ii->instr_offset, ii->instr_size);
DwRes = (*simulator.D1_Write)(data, ii->data_size);
- CLG_DEBUG(6, "log_1I1Dw: Ir=%p/%u, Dw=%p/%u => Ir %d, Dw %d\n",
+ CLG_DEBUG(6, "log_1I1Dw: Ir=%#lx/%u, Dw=%#lx/%u => Ir %d, Dw %d\n",
bb_base + ii->instr_offset, ii->instr_size,
data, ii->data_size, IrRes, DwRes);
@@ -1270,7 +1270,7 @@
current_ii = ii;
DwRes = (*simulator.D1_Write)(data, ii->data_size);
- CLG_DEBUG(6, "log_0I1Dw: Dw=%p/%u => Dw %d\n",
+ CLG_DEBUG(6, "log_0I1Dw: Dw=%#lx/%u => Dw %d\n",
data, ii->data_size, DwRes);
if (CLG_(current_state).collect) {
@@ -1301,7 +1301,7 @@
DwRes = (*simulator.D1_Write)(data2, ii->data_size);
CLG_DEBUG(6,
- "log_1I2D: Ir=%p/%u, Dr=%p/%u, Dw=%p/%u => Ir %d, Dr %d, Dw %d\n",
+ "log_1I2D: Ir=%#lx/%u, Dr=%#lx/%u, Dw=%#lx/%u => Ir %d, Dr %d, Dw %d\n",
bb_base + ii->instr_offset, ii->instr_size,
data1, ii->data_size, data2, ii->data_size, IrRes, DrRes, DwRes);
@@ -1338,7 +1338,7 @@
DwRes = (*simulator.D1_Write)(data2, ii->data_size);
CLG_DEBUG(6,
- "log_0D2D: Dr=%p/%u, Dw=%p/%u => Dr %d, Dw %d\n",
+ "log_0D2D: Dr=%#lx/%u, Dw=%#lx/%u => Dr %d, Dw %d\n",
data1, ii->data_size, data2, ii->data_size, DrRes, DwRes);
if (CLG_(current_state).collect) {
Modified: branches/FORMATCHECK/memcheck/mc_leakcheck.c
===================================================================
--- branches/FORMATCHECK/memcheck/mc_leakcheck.c 2007-10-04 22:48:53 UTC (rev 6950)
+++ branches/FORMATCHECK/memcheck/mc_leakcheck.c 2007-10-04 23:12:12 UTC (rev 6951)
@@ -65,7 +65,7 @@
void scan_all_valid_memory_catcher ( Int sigNo, Addr addr )
{
if (0)
- VG_(printf)("OUCH! sig=%d addr=%p\n", sigNo, addr);
+ VG_(printf)("OUCH! sig=%d addr=%#lx\n", sigNo, addr);
if (sigNo == VKI_SIGSEGV || sigNo == VKI_SIGBUS)
__builtin_longjmp(memscan_jmpbuf, 1);
}
@@ -232,7 +232,7 @@
sh_no = find_shadow_for(ptr, lc_shadows, lc_n_shadows);
if (VG_DEBUG_LEAKCHECK)
- VG_(printf)("ptr=%p -> block %d\n", ptr, sh_no);
+ VG_(printf)("ptr=%#lx -> block %d\n", ptr, sh_no);
if (sh_no == -1)
return;
@@ -245,7 +245,7 @@
if (lc_markstack[sh_no].state == Unreached) {
if (0)
- VG_(printf)("pushing %p-%p\n", lc_shadows[sh_no]->data,
+ VG_(printf)("pushing %#lx-%#lx\n", lc_shadows[sh_no]->data,
lc_shadows[sh_no]->data + lc_shadows[sh_no]->szB);
tl_assert(lc_markstack[sh_no].next == -1);
@@ -257,7 +257,7 @@
if (clique != -1) {
if (0)
- VG_(printf)("mopup: %d: %p is %d\n",
+ VG_(printf)("mopup: %d: %#lx is %d\n",
sh_no, lc_shadows[sh_no]->data, lc_markstack[sh_no].state);
/* An unmarked block - add it to the clique. Add its size to
@@ -273,11 +273,11 @@
if (sh_no != clique) {
if (VG_DEBUG_CLIQUE) {
if (lc_markstack[sh_no].indirect)
- VG_(printf)(" clique %d joining clique %d adding %lu+%lu bytes\n",
+ VG_(printf)(" clique %d joining clique %d adding %u+%lu bytes\n",
sh_no, clique,
lc_shadows[sh_no]->szB, lc_markstack[sh_no].indirect);
else
- VG_(printf)(" %d joining %d adding %lu\n",
+ VG_(printf)(" %d joining %d adding %u\n",
sh_no, clique, lc_shadows[sh_no]->szB);
}
@@ -325,7 +325,7 @@
vki_sigset_t sigmask;
if (VG_DEBUG_LEAKCHECK)
- VG_(printf)("scan %p-%p\n", start, start+len);
+ VG_(printf)("scan %#lx-%#lx\n", start, start+len);
VG_(sigprocmask)(VKI_SIG_SETMASK, NULL, &sigmask);
VG_(set_fault_catcher)(scan_all_valid_memory_catcher);
@@ -355,7 +355,7 @@
addr = *(Addr *)ptr;
lc_markstack_push_WRK(addr, clique);
} else if (0 && VG_DEBUG_LEAKCHECK)
- VG_(printf)("%p not valid\n", ptr);
+ VG_(printf)("%#lx not valid\n", ptr);
ptr += sizeof(Addr);
} else {
/* We need to restore the signal mask, because we were
@@ -413,7 +413,7 @@
pass), then the cliques are merged. */
for (i = 0; i < lc_n_shadows; i++) {
if (VG_DEBUG_CLIQUE)
- VG_(printf)("cliques: %d at %p -> Loss state %d\n",
+ VG_(printf)("cliques: %d at %#lx -> Loss state %d\n",
i, lc_shadows[i]->data, lc_markstack[i].state);
if (lc_markstack[i].state != Unreached)
continue;
@@ -421,7 +421,7 @@
tl_assert(lc_markstack_top == -1);
if (VG_DEBUG_CLIQUE)
- VG_(printf)("%d: gathering clique %p\n", i, lc_shadows[i]->data);
+ VG_(printf)("%d: gathering clique %#lx\n", i, lc_shadows[i]->data);
lc_markstack_push_WRK(lc_shadows[i]->data, i);
@@ -769,7 +769,7 @@
}
if (0)
- VG_(printf)("ACCEPT %2d %p %p\n", i, seg->start, seg->end);
+ VG_(printf)("ACCEPT %2d %#lx %#lx\n", i, seg->start, seg->end);
lc_scan_memory(seg->start, seg->end+1 - seg->start);
}
}
Modified: branches/FORMATCHECK/memcheck/mc_main.c
===================================================================
--- branches/FORMATCHECK/memcheck/mc_main.c 2007-10-04 22:48:53 UTC (rev 6950)
+++ branches/FORMATCHECK/memcheck/mc_main.c 2007-10-04 23:12:12 UTC (rev 6951)
@@ -2196,7 +2196,7 @@
{
tl_assert(sizeof(UWord) == sizeof(SizeT));
if (0)
- VG_(printf)("helperc_MAKE_STACK_UNINIT %p %lu\n", base, len );
+ VG_(printf)("helperc_MAKE_STACK_UNINIT %#lx %lu\n", base, len );
# if 0
/* Really slow version */
|
|
From: <sv...@va...> - 2007-10-04 22:48:57
|
Author: dirk Date: 2007-10-04 23:48:53 +0100 (Thu, 04 Oct 2007) New Revision: 6950 Log: fix format strings for coregrind/ Modified: branches/FORMATCHECK/coregrind/m_debuginfo/debuginfo.c branches/FORMATCHECK/coregrind/m_debuginfo/readdwarf.c branches/FORMATCHECK/coregrind/m_debuginfo/readelf.c branches/FORMATCHECK/coregrind/m_debuginfo/storage.c branches/FORMATCHECK/coregrind/m_initimg/initimg-linux.c branches/FORMATCHECK/coregrind/m_main.c branches/FORMATCHECK/coregrind/m_sigframe/sigframe-x86-linux.c branches/FORMATCHECK/coregrind/m_stacktrace.c branches/FORMATCHECK/coregrind/m_syswrap/syswrap-generic.c branches/FORMATCHECK/coregrind/m_syswrap/syswrap-linux.c branches/FORMATCHECK/coregrind/m_syswrap/syswrap-main.c branches/FORMATCHECK/coregrind/m_syswrap/syswrap-x86-linux.c [... diff too large to include ...] |
|
From: <sv...@va...> - 2007-10-04 21:39:05
|
Author: dirk
Date: 2007-10-04 22:38:47 +0100 (Thu, 04 Oct 2007)
New Revision: 6949
Log:
implement '#' modifier for 'x' and 'X' at least
Modified:
branches/FORMATCHECK/coregrind/m_debuglog.c
Modified: branches/FORMATCHECK/coregrind/m_debuglog.c
===================================================================
--- branches/FORMATCHECK/coregrind/m_debuglog.c 2007-10-04 21:36:40 UTC (rev 6948)
+++ branches/FORMATCHECK/coregrind/m_debuglog.c 2007-10-04 21:38:47 UTC (rev 6949)
@@ -446,8 +446,8 @@
#define VG_MSG_LJUSTIFY 4 /* Must justify on the left. */
#define VG_MSG_PAREN 8 /* Parenthesize if present (for %y) */
#define VG_MSG_COMMA 16 /* Add commas to numbers (for %d, %u) */
+#define VG_MSG_ALTFORMAT 32 /* Convert the value to alternate format */
-
/* Copy a string into the buffer. */
static
UInt myvprintf_str ( void(*send)(HChar,void*),
@@ -647,25 +647,32 @@
flags = 0;
n_ls = 0;
width = 0; /* length of the field. */
- if (format[i] == '(') {
- flags |= VG_MSG_PAREN;
+ while (1) {
+ switch (format[i]) {
+ case '(':
+ flags |= VG_MSG_PAREN;
+ break;
+ case ',':
+ /* If ',' follows '%', commas will be inserted. */
+ flags |= VG_MSG_COMMA;
+ break;
+ case '-':
+ flags |= VG_MSG_LJUSTIFY;
+ break;
+ case '0':
+ /* If '0' follows '%', pads will be inserted. */
+ flags |= VG_MSG_ZJUSTIFY;
+ break;
+ case '#':
+ /* If '#' follows '%', alternative format will be used. */
+ flags |= VG_MSG_ALTFORMAT;
+ break;
+ default:
+ goto parse_fieldwidth;
+ }
i++;
}
- /* If ',' follows '%', commas will be inserted. */
- if (format[i] == ',') {
- flags |= VG_MSG_COMMA;
- i++;
- }
- /* If '-' follows '%', justify on the left. */
- if (format[i] == '-') {
- flags |= VG_MSG_LJUSTIFY;
- i++;
- }
- /* If '0' follows '%', pads will be inserted. */
- if (format[i] == '0') {
- flags |= VG_MSG_ZJUSTIFY;
- i++;
- }
+parse_fieldwidth:
/* Compute the field length. */
while (format[i] >= '0' && format[i] <= '9') {
width *= 10;
@@ -711,6 +718,11 @@
case 'x': /* %x */
case 'X': /* %X */
caps = toBool(format[i] == 'X');
+ if (flags & VG_MSG_ALTFORMAT) {
+ ret += 2;
+ send('0',send_arg2);
+ send('x',send_arg2);
+ }
if (is_long)
ret += myvprintf_int64(send, send_arg2, flags, 16, width, caps,
(ULong)(va_arg (vargs, ULong)));
|
|
From: <sv...@va...> - 2007-10-04 21:36:39
|
Author: dirk
Date: 2007-10-04 22:36:40 +0100 (Thu, 04 Oct 2007)
New Revision: 6948
Log:
readd right adjustment.
Modified:
trunk/coregrind/m_stacktrace.c
Modified: trunk/coregrind/m_stacktrace.c
===================================================================
--- trunk/coregrind/m_stacktrace.c 2007-10-04 21:35:21 UTC (rev 6947)
+++ trunk/coregrind/m_stacktrace.c 2007-10-04 21:36:40 UTC (rev 6948)
@@ -158,7 +158,7 @@
fp = (((UWord*)fp)[0]);
ips[i++] = ip;
if (debug)
- VG_(printf)(" ipsF[%d]=%p\n", i-1, ips[i-1]);
+ VG_(printf)(" ipsF[%d]=0x%08lx\n", i-1, ips[i-1]);
ip = ip - 1;
continue;
}
@@ -168,7 +168,7 @@
if ( VG_(use_CF_info)( &ip, &sp, &fp, fp_min, fp_max ) ) {
ips[i++] = ip;
if (debug)
- VG_(printf)(" ipsC[%d]=%p\n", i-1, ips[i-1]);
+ VG_(printf)(" ipsC[%d]=0x%08lx\n", i-1, ips[i-1]);
ip = ip - 1;
continue;
}
|
|
From: <sv...@va...> - 2007-10-04 21:35:26
|
Author: dirk
Date: 2007-10-04 22:35:21 +0100 (Thu, 04 Oct 2007)
New Revision: 6947
Log:
revert format checking warnings from trunk, will
be done in a branch
Modified:
trunk/include/pub_tool_libcprint.h
Modified: trunk/include/pub_tool_libcprint.h
===================================================================
--- trunk/include/pub_tool_libcprint.h 2007-10-04 21:34:06 UTC (rev 6946)
+++ trunk/include/pub_tool_libcprint.h 2007-10-04 21:35:21 UTC (rev 6947)
@@ -35,26 +35,19 @@
Basic printing
------------------------------------------------------------------ */
-#ifdef __GNUC__
-# define PRINTF_CHECK(x,y) __attribute__((format(__printf__, x, y)))
-#else
-# define PRINTF_CHECK(x,y) /* x, y */
-#endif
-
/* Note that they all output to the file descriptor given by the
* --log-fd/--log-file/--log-socket argument, which defaults to 2 (stderr).
* Hence no need for VG_(fprintf)().
*/
-
-extern UInt VG_(printf) ( const HChar *format, ... ) PRINTF_CHECK(1,2);
+extern UInt VG_(printf) ( const HChar *format, ... );
extern UInt VG_(vprintf) ( const HChar *format, va_list vargs );
/* too noisy ... __attribute__ ((format (printf, 1, 2))) ; */
-extern UInt VG_(sprintf) ( Char* buf, const HChar* format, ... ) PRINTF_CHECK(2,3);
+extern UInt VG_(sprintf) ( Char* buf, const HChar* format, ... );
extern UInt VG_(vsprintf) ( Char* buf, const HChar* format, va_list vargs );
extern UInt VG_(snprintf) ( Char* buf, Int size,
- const HChar *format, ... ) PRINTF_CHECK(3,4);
+ const HChar *format, ... );
extern UInt VG_(vsnprintf)( Char* buf, Int size,
const HChar *format, va_list vargs );
|
|
From: <sv...@va...> - 2007-10-04 21:34:13
|
Author: dirk Date: 2007-10-04 22:34:06 +0100 (Thu, 04 Oct 2007) New Revision: 6946 Log: create format checking branch Added: branches/FORMATCHECK/ Copied: branches/FORMATCHECK (from rev 6945, trunk) |
|
From: Dirk M. <dm...@gm...> - 2007-10-04 21:32:41
|
On Wednesday, 3. October 2007, Julian Seward wrote:
> Addr/Word/UWord args with %p formats, either by casting the arg to void*
> or changing the format to 0x%lx.
I'm currently unable to decide which route to take. We can represent Addr in
two ways:
VG_(printf)("%#lx", ..)
or
VG_(printf)("%p", (void*)..)
I would prefer the first, given that it is shorter. Any comments? I'll make
sure that I change it consistently (in a new branch, like requested).
Greetings,
Dirk
|
|
From: Dirk M. <dm...@gm...> - 2007-10-04 21:30:58
|
On Thursday, 4. October 2007, Nicholas Nethercote wrote: > Making things more ANSI would be good My primary concern was to ensure that no format string mismatches occur that could cause strange misbehaviour or crashes on rare (possible not regression tested) scenarios. > , but then the ',' prefix is also > extremely useful -- it inserts commas into printed numbers, eg. prints > "1,234,567" instead of "1234567". Any ideas for how to get the best of > both worlds? There is one death to die. For now, we can keep the ',' prefix as long as gcc does not complain about it. Otherwise we have to either overload the meaning of one of the ANSI format string characters with it - e.g. '00' could mean comma insertion instead of zero extension, or remove the flag alltogether. the only fully ANSI correct solution would be to use %s and wrap the actual integer in a "comma_convert_decimal()" helper routine which formats the number and returns a pointer to a string instead. Greetings, Dirk |
|
From: Dirk M. <dm...@gm...> - 2007-10-04 21:18:27
|
On Monday, 1. October 2007, Bart Van Assche wrote: > you changed the > format string %08p into %p. As a result, the printed pointers are no longer > right-aligned. True. It was my impression that %p does this by default, but it seems I was wrong. I'll correct this mistake shortly, thanks for pointing it out. > Did you understand what I wrote in the mail I sent on > September 26 to the valgrind-developers mailing list ? Yes, I was able to understand it, thanks for asking again. Greetings, Dirk |
|
From: <js...@ac...> - 2007-10-04 14:07:30
|
Nightly build on minnie ( SuSE 10.0, ppc32 ) started at 2007-10-04 09:00:01 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 220 tests, 10 stderr failures, 6 stdout failures, 0 posttest failures == memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-fp (stderr) none/tests/ppc32/round (stdout) none/tests/ppc32/round (stderr) none/tests/ppc32/test_fx (stdout) none/tests/ppc32/test_fx (stderr) none/tests/ppc32/test_gx (stdout) |
|
From: Bart V. A. <bar...@gm...> - 2007-10-04 10:26:34
|
On 10/4/07, Oswald Buddenhagen <os...@kd...> wrote: > > On Thu, Oct 04, 2007 at 09:31:28AM +1000, Nicholas Nethercote wrote: > > Making things more ANSI would be good, but then the ',' prefix is also > > extremely useful -- it inserts commas into printed numbers, eg. prints > > "1,234,567" instead of "1234567". Any ideas for how to get the best of > both > > worlds? > > > this one isn't particularly hard, because you just got the "elevation" > of the sign wrong - the susv2 grouping char is '. unlike in the > standard, you don't need to take the locale into account to make (newer > versions of) gcc happy ... > This is an interesting observation. I have found confirmation of the fact that the apostrophe character is a thousands group separator on the following URL (Single UNIX Specification, Version 2): http://www.opengroup.org/onlinepubs/007908775/xsh/fprintf.html Bart. |
|
From: Oswald B. <os...@kd...> - 2007-10-04 08:58:55
|
On Thu, Oct 04, 2007 at 09:31:28AM +1000, Nicholas Nethercote wrote: > Making things more ANSI would be good, but then the ',' prefix is also > extremely useful -- it inserts commas into printed numbers, eg. prints > "1,234,567" instead of "1234567". Any ideas for how to get the best of both > worlds? > this one isn't particularly hard, because you just got the "elevation" of the sign wrong - the susv2 grouping char is '. unlike in the standard, you don't need to take the locale into account to make (newer versions of) gcc happy ... -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done. |
|
From: <sv...@va...> - 2007-10-04 06:43:41
|
Author: njn
Date: 2007-10-04 07:43:42 +0100 (Thu, 04 Oct 2007)
New Revision: 6945
Log:
comment wibble
Modified:
branches/MASSIF2/massif/ms_main.c
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-04 06:38:28 UTC (rev 6944)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-04 06:43:42 UTC (rev 6945)
@@ -1809,11 +1809,6 @@
VG_(track_new_mem_stack_signal)( new_mem_stack_signal );
VG_(track_die_mem_stack_signal)( die_mem_stack_signal );
}
-
- // We don't take a snapshot now, because there's still some core
- // initialisation to do, in which case we have an artificial gap.
- // Instead we do it when the first translation occurs. See
- // ms_instrument().
}
static void ms_pre_clo_init(void)
|
|
From: <sv...@va...> - 2007-10-04 06:38:28
|
Author: njn
Date: 2007-10-04 07:38:28 +0100 (Thu, 04 Oct 2007)
New Revision: 6944
Log:
- don't do stack snapshots until we've started executing code, to avoid the
strange start-up SP updates
- other minor changes
Modified:
branches/MASSIF2/massif/ms_main.c
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-04 06:18:25 UTC (rev 6943)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-04 06:38:28 UTC (rev 6944)
@@ -58,31 +58,6 @@
// - in each XPt, record both bytes and the number of live allocations? (or
// even total allocations and total deallocations?)
//
-// Work out how to take the peak.
-// - exact peak, or within a certain percentage?
-// - include the stack? makes it harder
-//
-// Option #1
-// - just take the peak snapshot.
-// - pros:
-// - easy, fast
-// - cons:
-// - not the true peak
-//
-// #2: true peak
-// - check every malloc, every new_mem_stack
-// - slow
-// - most accurate
-//
-// #2a:
-// - same, but only do detailed snapshot if x% larger than previous peak
-//
-// #3: in-between
-// - check every malloc, but not every new_mem_stack
-//
-// What is the proportion of stack allocs/deallocs vs heap allocs/deallocs?
-// Try with Konqueror.
-//
// Dumping the results to file:
// - work out the file format (Josef wants Callgrind format, Donna wants
// XML, Nick wants something easy to read in Perl)
@@ -281,6 +256,16 @@
// Current directory at startup.
static Char base_dir[VKI_PATH_MAX]; // XXX: currently unused
+// We don't start taking snapshots until the first basic block is executed,
+// rather than doing it in ms_post_clo_init (which is the obvious spot), for
+// two reasons.
+// - It lets us ignore stack events prior to that, because they're not
+// really proper ones and just would screw things up.
+// - Because there's still some core initialisation to do, and so there
+// would be an artificial time gap between the first and second snapshots.
+//
+static Bool have_started_executing_code = False;
+
//------------------------------------------------------------//
//--- Alloc fns ---//
//------------------------------------------------------------//
@@ -1095,6 +1080,8 @@
Snapshot* snapshot = &snapshots[snapshot_i];
+ tl_assert(have_started_executing_code);
+
// Right! We're taking a real snapshot.
n_real_snapshots++;
@@ -1161,17 +1148,15 @@
// we don't take it. Initialised to zero so that we begin by taking
// snapshots as quickly as possible.
static Time min_time_interval = 0;
- static Time time_of_prev_snapshot = 0;
// Zero allows startup snapshot.
static Time earliest_possible_time_of_next_snapshot = 0;
- Time time, time_since_prev;
+ Time time;
Snapshot* snapshot;
time = get_time();
// Only do a snapshot if it's time.
- time_since_prev = time - time_of_prev_snapshot;
if (time < earliest_possible_time_of_next_snapshot) {
n_skipped_snapshots++;
n_skipped_snapshots_since_last_snapshot++;
@@ -1189,7 +1174,6 @@
}
// Work out the earliest time when the next snapshot can happen.
- time_of_prev_snapshot = time;
earliest_possible_time_of_next_snapshot = time + min_time_interval;
}
@@ -1464,42 +1448,55 @@
update_alloc_stats(stack_szB_delta);
}
+static void update_sigstack_stats(SSizeT sigstack_szB_delta)
+{
+ if (sigstack_szB_delta < 0) tl_assert(sigstacks_szB >= sigstack_szB_delta);
+ sigstacks_szB += sigstack_szB_delta;
+
+ update_alloc_stats(sigstack_szB_delta);
+}
+
static void new_mem_stack(Addr a, SizeT len)
{
- VERB(2, "<<< new_mem_stack (%ld)", len);
- n_stack_allocs++;
- update_stack_stats(len);
- maybe_take_snapshot("stk-new");
- VERB(2, ">>>");
+ if (have_started_executing_code) {
+ VERB(2, "<<< new_mem_stack (%ld)", len);
+ n_stack_allocs++;
+ update_stack_stats(len);
+ maybe_take_snapshot("stk-new");
+ VERB(2, ">>>");
+ }
}
static void die_mem_stack(Addr a, SizeT len)
{
- VERB(2, "<<< die_mem_stack (%ld)", -len);
- n_stack_frees++;
- update_stack_stats(-len);
- maybe_take_snapshot("stk-die");
- VERB(2, ">>>");
+ if (have_started_executing_code) {
+ VERB(2, "<<< die_mem_stack (%ld)", -len);
+ n_stack_frees++;
+ update_stack_stats(-len);
+ maybe_take_snapshot("stk-die");
+ VERB(2, ">>>");
+ }
}
static void new_mem_stack_signal(Addr a, SizeT len)
{
- VERB(2, "<<< new_mem_stack_signal (%ld)", len);
- sigstacks_szB += len;
- update_stack_stats(len);
- maybe_take_snapshot("sig-new");
- VERB(2, ">>>");
+ if (have_started_executing_code) {
+ VERB(2, "<<< new_mem_stack_signal (%ld)", len);
+ update_sigstack_stats(len);
+ maybe_take_snapshot("sig-new");
+ VERB(2, ">>>");
+ }
}
static void die_mem_stack_signal(Addr a, SizeT len)
{
- VERB(2, "<<< die_mem_stack_signal (%ld)", -len);
- tl_assert(sigstacks_szB >= len);
- sigstacks_szB -= len;
- update_stack_stats(len);
- maybe_take_snapshot("sig-die");
- VERB(2, ">>>");
+ if (have_started_executing_code) {
+ VERB(2, "<<< die_mem_stack_signal (%ld)", -len);
+ update_sigstack_stats(-len);
+ maybe_take_snapshot("sig-die");
+ VERB(2, ">>>");
+ }
}
@@ -1543,16 +1540,12 @@
VexGuestExtents* vge,
IRType gWordTy, IRType hWordTy )
{
- static Bool is_first_SB = True;
-
- if (is_first_SB) {
+ if (! have_started_executing_code) {
// Do an initial sample to guarantee that we have at least one.
// We use 'maybe_take_snapshot' instead of 'take_snapshot' to ensure
// 'maybe_take_snapshot's internal static variables are initialised.
- // However, with --stacks=yes this snapshot may not actually be the
- // first one, surprisingly enough.
+ have_started_executing_code = True;
maybe_take_snapshot("startup");
- is_first_SB = False;
}
return bb_in;
|
|
From: <sv...@va...> - 2007-10-04 06:18:23
|
Author: njn
Date: 2007-10-04 07:18:25 +0100 (Thu, 04 Oct 2007)
New Revision: 6943
Log:
this should have gone in the last commit
Modified:
branches/MASSIF2/massif/ms_main.c
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-04 06:13:37 UTC (rev 6942)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-04 06:18:25 UTC (rev 6943)
@@ -1351,6 +1351,7 @@
// Remove the old block
hc = VG_(HT_remove)(malloc_list, (UWord)p_old);
if (hc == NULL) {
+ VERB(2, ">>> (bogus)");
return NULL; // must have been a bogus realloc()
}
|
|
From: <sv...@va...> - 2007-10-04 06:13:40
|
Author: njn
Date: 2007-10-04 07:13:37 +0100 (Thu, 04 Oct 2007)
New Revision: 6942
Log:
Add some more verbosity output.
Modified:
branches/MASSIF2/massif/ms_main.c
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-04 06:02:41 UTC (rev 6941)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-04 06:13:37 UTC (rev 6942)
@@ -1122,6 +1122,8 @@
Addr stack_min, stack_max;
VG_(thread_stack_reset_iter)();
while ( VG_(thread_stack_next)(&tid, &stack_min, &stack_max) ) {
+ VERB(2, "stack %d: %p -- %p (%ld)",
+ tid, stack_min, stack_max, stack_max - stack_min);
snapshot->stacks_szB += (stack_max - stack_min);
}
snapshot->stacks_szB += sigstacks_szB; // Add signal stacks, too
@@ -1255,6 +1257,8 @@
Bool custom_alloc = (NULL == p);
if (szB < 0) return NULL;
+ VERB(2, "<<< new_mem_heap (%lu)", szB);
+
// Update statistics
n_allocs++;
if (0 == szB) n_zero_allocs++;
@@ -1263,6 +1267,7 @@
if (!p) {
p = VG_(cli_malloc)( alignB, szB );
if (!p) {
+ VERB(2, ">>> (null)");
return NULL;
}
if (is_zeroed) VG_(memset)(p, 0, szB);
@@ -1287,6 +1292,8 @@
// Maybe take a snapshot.
maybe_take_snapshot(" alloc");
+ VERB(2, ">>>");
+
return p;
}
@@ -1294,6 +1301,9 @@
void die_block ( void* p, Bool custom_free )
{
HP_Chunk* hc;
+ SizeT die_szB;
+
+ VERB(2, "<<< die_mem_heap");
// Update statistics
n_frees++;
@@ -1301,11 +1311,13 @@
// Remove HP_Chunk from malloc_list
hc = VG_(HT_remove)(malloc_list, (UWord)p);
if (NULL == hc) {
+ VERB(2, ">>> (bogus)");
return; // must have been a bogus free()
}
+ die_szB = hc->szB;
// Update heap stats
- update_heap_stats(-hc->szB, /*n_heap_blocks_delta*/-1);
+ update_heap_stats(-die_szB, /*n_heap_blocks_delta*/-1);
// Update XTree, if necessary
if (clo_heap) {
@@ -1319,6 +1331,8 @@
// Maybe take a snapshot.
maybe_take_snapshot("dealloc");
+
+ VERB(2, ">>> (-%lu)", die_szB);
}
static __inline__
@@ -1328,6 +1342,8 @@
void* p_new;
SizeT old_szB;
XPt *old_where, *new_where;
+
+ VERB(2, "<<< renew_mem_heap (%lu)", new_szB);
// Update statistics
n_reallocs++;
@@ -1382,6 +1398,8 @@
// Maybe take a snapshot.
maybe_take_snapshot("realloc");
+ VERB(2, ">>> (%ld)", new_szB - old_szB);
+
return p_new;
}
@@ -1447,32 +1465,40 @@
static void new_mem_stack(Addr a, SizeT len)
{
+ VERB(2, "<<< new_mem_stack (%ld)", len);
n_stack_allocs++;
update_stack_stats(len);
maybe_take_snapshot("stk-new");
+ VERB(2, ">>>");
}
static void die_mem_stack(Addr a, SizeT len)
{
+ VERB(2, "<<< die_mem_stack (%ld)", -len);
n_stack_frees++;
update_stack_stats(-len);
maybe_take_snapshot("stk-die");
+ VERB(2, ">>>");
}
static void new_mem_stack_signal(Addr a, SizeT len)
{
+ VERB(2, "<<< new_mem_stack_signal (%ld)", len);
sigstacks_szB += len;
update_stack_stats(len);
maybe_take_snapshot("sig-new");
+ VERB(2, ">>>");
}
static void die_mem_stack_signal(Addr a, SizeT len)
{
+ VERB(2, "<<< die_mem_stack_signal (%ld)", -len);
tl_assert(sigstacks_szB >= len);
sigstacks_szB -= len;
update_stack_stats(len);
maybe_take_snapshot("sig-die");
+ VERB(2, ">>>");
}
|
|
From: <sv...@va...> - 2007-10-04 06:02:40
|
Author: njn
Date: 2007-10-04 07:02:41 +0100 (Thu, 04 Oct 2007)
New Revision: 6941
Log:
factor stats taking a little
Modified:
branches/MASSIF2/massif/ms_main.c
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-04 05:51:24 UTC (rev 6940)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-04 06:02:41 UTC (rev 6941)
@@ -1230,6 +1230,13 @@
static VgHashTable malloc_list = NULL; // HP_Chunks
+static void update_alloc_stats(SSizeT szB_delta)
+{
+ // Update total_allocs_deallocs_szB.
+ if (szB_delta < 0) szB_delta = -szB_delta;
+ total_allocs_deallocs_szB += szB_delta;
+}
+
static void update_heap_stats(SSizeT heap_szB_delta, Int n_heap_blocks_delta)
{
if (n_heap_blocks_delta<0) tl_assert(n_heap_blocks >= -n_heap_blocks_delta);
@@ -1237,9 +1244,7 @@
n_heap_blocks += n_heap_blocks_delta;
heap_szB += heap_szB_delta;
- if (heap_szB_delta < 0) total_allocs_deallocs_szB -= heap_szB_delta;
- if (heap_szB_delta > 0) total_allocs_deallocs_szB += heap_szB_delta;
- total_allocs_deallocs_szB += clo_heap_admin;
+ update_alloc_stats(heap_szB_delta + clo_heap_admin*n_heap_blocks_delta);
}
static
@@ -1435,9 +1440,9 @@
//--- Stacks ---//
//------------------------------------------------------------//
-static void update_stack_stats(SSizeT stack_szB_len)
+static void update_stack_stats(SSizeT stack_szB_delta)
{
- total_allocs_deallocs_szB += stack_szB_len;
+ update_alloc_stats(stack_szB_delta);
}
static void new_mem_stack(Addr a, SizeT len)
@@ -1450,7 +1455,7 @@
static void die_mem_stack(Addr a, SizeT len)
{
n_stack_frees++;
- update_stack_stats(len);
+ update_stack_stats(-len);
maybe_take_snapshot("stk-die");
}
|
|
From: <sv...@va...> - 2007-10-04 05:51:23
|
Author: njn
Date: 2007-10-04 06:51:24 +0100 (Thu, 04 Oct 2007)
New Revision: 6940
Log:
Minor changes.
Modified:
branches/MASSIF2/massif/ms_main.c
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-04 05:45:01 UTC (rev 6939)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-04 05:51:24 UTC (rev 6940)
@@ -839,9 +839,11 @@
// Time is measured either in ms or bytes, depending on the --time-unit
// option. It's a Long because it can exceed 32-bits reasonably easily, and
-// because we need to allow -1 as a possible value.
+// because we need to allow negative values to represent unset times.
typedef Long Time;
+#define UNUSED_SNAPSHOT_TIME -333 // A conspicuous negative number.
+
typedef
struct {
Time time;
@@ -858,7 +860,7 @@
static Bool is_snapshot_in_use(Snapshot* snapshot)
{
- if (-1 == snapshot->time) {
+ if (UNUSED_SNAPSHOT_TIME == snapshot->time) {
// If .time looks unused, check everything else is.
tl_assert(snapshot->total_szB == 0);
tl_assert(snapshot->heap_admin_szB == 0);
@@ -902,7 +904,7 @@
static void clear_snapshot(Snapshot* snapshot)
{
sanity_check_snapshot(snapshot);
- snapshot->time = -1;
+ snapshot->time = UNUSED_SNAPSHOT_TIME;
snapshot->total_szB = 0;
snapshot->heap_admin_szB = 0;
snapshot->heap_szB = 0;
@@ -980,14 +982,14 @@
jp = 0;
FIND_SNAPSHOT(1, j);
FIND_SNAPSHOT(j+1, jn);
- min_timespan = snapshots[jn].time - snapshots[jp].time;
- min_j = j;
+ min_timespan = 0x7fffffffffffffffLL;
+ min_j = -1;
while (jn < MAX_N_SNAPSHOTS) {
Time timespan = snapshots[jn].time - snapshots[jp].time;
tl_assert(timespan >= 0);
if (timespan < min_timespan) {
min_timespan = timespan;
- min_j = j;
+ min_j = j;
}
// Move on to next triple
jp = j;
@@ -996,6 +998,7 @@
}
// We've found the least important snapshot, now delete it. First
// print it if necessary.
+ tl_assert(-1 != min_j); // Check we found a minimum.
min_snapshot = & snapshots[ min_j ];
if (VG_(clo_verbosity) > 1) {
Char buf[64];
@@ -1028,9 +1031,9 @@
// deletion. Here we only measure single intervals because all the
// deletions have occurred.
tl_assert(next_snapshot_i > 1);
- min_timespan = snapshots[1].time - snapshots[0].time;
- min_timespan_i = 1;
- for (i = 2; i < next_snapshot_i; i++) {
+ min_timespan = 0x7fffffffffffffffLL;
+ min_timespan_i = -1;
+ for (i = 1; i < next_snapshot_i; i++) {
Time timespan = snapshots[i].time - snapshots[i-1].time;
tl_assert(timespan >= 0);
if (timespan < min_timespan) {
@@ -1038,6 +1041,7 @@
min_timespan_i = i;
}
}
+ tl_assert(-1 != min_timespan_i); // Check we found a minimum.
// Print remaining snapshots, if necessary.
if (VG_(clo_verbosity) > 1) {
@@ -1649,9 +1653,7 @@
FP("mem_stacks_B=%lu\n", snapshot->stacks_szB);
if (is_detailed_snapshot(snapshot)) {
- // Detailed snapshot -- print heap tree
- // XXX: check this works ok when no heap memory has been allocated
- // [need to do it with --time-unit=ms]
+ // Detailed snapshot -- print heap tree.
Int depth_str_len = clo_depth + 3;
Char* depth_str = VG_(malloc)(sizeof(Char) * depth_str_len);
depth_str[0] = '\0'; // Initialise depth_str to "".
|
|
From: <sv...@va...> - 2007-10-04 05:45:00
|
Author: njn
Date: 2007-10-04 06:45:01 +0100 (Thu, 04 Oct 2007)
New Revision: 6939
Log:
Various comment, formatting, etc, changes. No functional changes.
Modified:
branches/MASSIF2/massif/ms_main.c
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-04 05:34:56 UTC (rev 6938)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-04 05:45:01 UTC (rev 6939)
@@ -31,7 +31,6 @@
// XXX:
//---------------------------------------------------------------------------
// Todo:
-// - make --time-unit=B include heap-admin bytes
// - Add ability to draw multiple graphs, eg. heap-only, stack-only, total.
// Give each graph a title.
// - do peak-taking.
@@ -854,8 +853,8 @@
} // otherwise NULL
Snapshot;
+static UInt next_snapshot_i = 0; // Index of where next snapshot will go.
static Snapshot snapshots[MAX_N_SNAPSHOTS];
-static UInt next_snapshot_i = 0; // Points to where next snapshot will go.
static Bool is_snapshot_in_use(Snapshot* snapshot)
{
@@ -937,8 +936,9 @@
);
}
-// Weed out half the snapshots; we choose those that represent the smallest
-// time-spans, because that loses the least information.
+// Cull half the snapshots; we choose those that represent the smallest
+// time-spans, because that gives us the most even distribution of snapshots
+// over time. (It's possible to lose interesting spikes, however.)
//
// Algorithm for N snapshots: We find the snapshot representing the smallest
// timeframe, and remove it. We repeat this until (N/2) snapshots are gone.
@@ -1123,7 +1123,7 @@
snapshot->stacks_szB += sigstacks_szB; // Add signal stacks, too
}
- // Finish writing snapshot ------------------------------------------
+ // Rest of snapshot -------------------------------------------------
snapshot->time = time;
snapshot->total_szB =
snapshot->heap_szB + snapshot->heap_admin_szB + snapshot->stacks_szB;
@@ -1313,11 +1313,11 @@
}
static __inline__
-void* renew_block ( ThreadId tid, void* p_old, SizeT new_size )
+void* renew_block ( ThreadId tid, void* p_old, SizeT new_szB )
{
HP_Chunk* hc;
void* p_new;
- SizeT old_size;
+ SizeT old_szB;
XPt *old_where, *new_where;
// Update statistics
@@ -1329,20 +1329,20 @@
return NULL; // must have been a bogus realloc()
}
- old_size = hc->szB;
+ old_szB = hc->szB;
// Update heap stats
- update_heap_stats(new_size - old_size, /*n_heap_blocks_delta*/0);
+ update_heap_stats(new_szB - old_szB, /*n_heap_blocks_delta*/0);
- if (new_size <= old_size) {
+ if (new_szB <= old_szB) {
// new size is smaller or same; block not moved
p_new = p_old;
} else {
// new size is bigger; make new block, copy shared contents, free old
- p_new = VG_(cli_malloc)(VG_(clo_alignment), new_size);
+ p_new = VG_(cli_malloc)(VG_(clo_alignment), new_szB);
if (p_new) {
- VG_(memcpy)(p_new, p_old, old_size);
+ VG_(memcpy)(p_new, p_old, old_szB);
VG_(cli_free)(p_old);
}
}
@@ -1353,13 +1353,13 @@
// Update HP_Chunk
hc->data = (Addr)p_new;
- hc->szB = new_size;
+ hc->szB = new_szB;
hc->where = new_where;
// Update XPt curr_szB fields
if (clo_heap) {
- update_XCon(old_where, -old_size);
- update_XCon(new_where, new_size);
+ update_XCon(old_where, -old_szB);
+ update_XCon(new_where, new_szB);
}
}
@@ -1668,7 +1668,7 @@
}
}
-static void write_detailed_snapshots(void)
+static void write_snapshots_to_file(void)
{
Int i, fd;
SysRes sres;
@@ -1729,7 +1729,7 @@
static void ms_fini(Int exit_status)
{
// Output.
- write_detailed_snapshots();
+ write_snapshots_to_file();
// Stats
tl_assert(n_xpts > 0); // always have alloc_xpt
|
|
From: <sv...@va...> - 2007-10-04 05:34:54
|
Author: njn
Date: 2007-10-04 06:34:56 +0100 (Thu, 04 Oct 2007)
New Revision: 6938
Log:
minor VERB changes
Modified:
branches/MASSIF2/massif/ms_main.c
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-04 05:32:17 UTC (rev 6937)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-04 05:34:56 UTC (rev 6938)
@@ -963,9 +963,7 @@
j < MAX_N_SNAPSHOTS && !is_snapshot_in_use(&snapshots[j]); \
j++) { }
- if (VG_(clo_verbosity) > 1) {
- VERB(1, "Culling...");
- }
+ VERB(1, "Culling...");
// First we remove enough snapshots by clearing them in-place. Once
// that's done, we can slide the remaining ones down.
@@ -1734,29 +1732,27 @@
write_detailed_snapshots();
// Stats
- if (VG_(clo_verbosity) > 1) {
- tl_assert(n_xpts > 0); // always have alloc_xpt
- VERB(1, "allocs: %u", n_allocs);
- VERB(1, "zeroallocs: %u (%d%%)",
- n_zero_allocs,
- ( n_allocs ? n_zero_allocs * 100 / n_allocs : 0 ));
- VERB(1, "reallocs: %u", n_reallocs);
- VERB(1, "frees: %u", n_frees);
- VERB(1, "stack allocs: %u", n_stack_allocs);
- VERB(1, "stack frees: %u", n_stack_frees);
- VERB(1, "XPts: %u", n_xpts);
- VERB(1, "top-XPts: %u (%d%%)",
- alloc_xpt->n_children,
- ( n_xpts ? alloc_xpt->n_children * 100 / n_xpts : 0));
- VERB(1, "dup'd XPts: %u", n_dupd_xpts);
- VERB(1, "dup'd/freed XPts: %u", n_dupd_xpts_freed);
- VERB(1, "XPt-init-expansions: %u", n_xpt_init_expansions);
- VERB(1, "XPt-later-expansions: %u", n_xpt_later_expansions);
- VERB(1, "skipped snapshots: %u", n_skipped_snapshots);
- VERB(1, "real snapshots: %u", n_real_snapshots);
- VERB(1, "cullings: %u", n_cullings);
- VERB(1, "XCon_redos: %u", n_getXCon_redo);
- }
+ tl_assert(n_xpts > 0); // always have alloc_xpt
+ VERB(1, "allocs: %u", n_allocs);
+ VERB(1, "zeroallocs: %u (%d%%)",
+ n_zero_allocs,
+ ( n_allocs ? n_zero_allocs * 100 / n_allocs : 0 ));
+ VERB(1, "reallocs: %u", n_reallocs);
+ VERB(1, "frees: %u", n_frees);
+ VERB(1, "stack allocs: %u", n_stack_allocs);
+ VERB(1, "stack frees: %u", n_stack_frees);
+ VERB(1, "XPts: %u", n_xpts);
+ VERB(1, "top-XPts: %u (%d%%)",
+ alloc_xpt->n_children,
+ ( n_xpts ? alloc_xpt->n_children * 100 / n_xpts : 0));
+ VERB(1, "dup'd XPts: %u", n_dupd_xpts);
+ VERB(1, "dup'd/freed XPts: %u", n_dupd_xpts_freed);
+ VERB(1, "XPt-init-expansions: %u", n_xpt_init_expansions);
+ VERB(1, "XPt-later-expansions: %u", n_xpt_later_expansions);
+ VERB(1, "skipped snapshots: %u", n_skipped_snapshots);
+ VERB(1, "real snapshots: %u", n_real_snapshots);
+ VERB(1, "cullings: %u", n_cullings);
+ VERB(1, "XCon_redos: %u", n_getXCon_redo);
}
|
|
From: <sv...@va...> - 2007-10-04 05:32:15
|
Author: njn
Date: 2007-10-04 06:32:17 +0100 (Thu, 04 Oct 2007)
New Revision: 6937
Log:
parameterise VERB
Modified:
branches/MASSIF2/massif/ms_main.c
Modified: branches/MASSIF2/massif/ms_main.c
===================================================================
--- branches/MASSIF2/massif/ms_main.c 2007-10-04 05:28:54 UTC (rev 6936)
+++ branches/MASSIF2/massif/ms_main.c 2007-10-04 05:32:17 UTC (rev 6937)
@@ -225,10 +225,13 @@
// requests. They are always kept.
// Used for printing things when clo_verbosity > 1.
-#define VERB(format, args...) \
- VG_(message)(Vg_DebugMsg, "Massif: " format, ##args)
+#define VERB(verb, format, args...) \
+ if (VG_(clo_verbosity) > verb) { \
+ VG_(message)(Vg_DebugMsg, "Massif: " format, ##args); \
+ }
+
//------------------------------------------------------------//
//--- Statistics ---//
//------------------------------------------------------------//
@@ -922,11 +925,10 @@
}
}
-static void VERB_snapshot(Char* prefix, Int i)
+static void VERB_snapshot(Int verbosity, Char* prefix, Int i)
{
Char* suffix = ( is_detailed_snapshot(&snapshots[i]) ? "d" : ".");
- VERB("%s S%s%3d "
- "(t:%lld, hp:%ld, ad:%ld, st:%ld)",
+ VERB(verbosity, "%s S%s%3d (t:%lld, hp:%ld, ad:%ld, st:%ld)",
prefix, suffix, i,
snapshots[i].time,
snapshots[i].heap_szB,
@@ -962,7 +964,7 @@
j++) { }
if (VG_(clo_verbosity) > 1) {
- VERB("Culling...");
+ VERB(1, "Culling...");
}
// First we remove enough snapshots by clearing them in-place. Once
@@ -1000,7 +1002,7 @@
if (VG_(clo_verbosity) > 1) {
Char buf[64];
VG_(snprintf)(buf, 64, " %3d (t-span = %lld)", i, min_timespan);
- VERB_snapshot(buf, min_j);
+ VERB_snapshot(1, buf, min_j);
}
delete_snapshot(min_snapshot);
n_deleted++;
@@ -1041,11 +1043,12 @@
// Print remaining snapshots, if necessary.
if (VG_(clo_verbosity) > 1) {
- VERB("Finished culling (%3d of %3d deleted)", n_deleted, MAX_N_SNAPSHOTS);
+ VERB(1, "Finished culling (%3d of %3d deleted)",
+ n_deleted, MAX_N_SNAPSHOTS);
for (i = 0; i < next_snapshot_i; i++) {
- VERB_snapshot(" post-cull", i);
+ VERB_snapshot(1, " post-cull", i);
}
- VERB("New time interval = %lld (between snapshots %d and %d)",
+ VERB(1, "New time interval = %lld (between snapshots %d and %d)",
min_timespan, min_timespan_i-1, min_timespan_i);
}
@@ -1136,14 +1139,12 @@
}
// Finish up verbosity and stats stuff.
- if (VG_(clo_verbosity) > 1) {
- if (n_skipped_snapshots_since_last_snapshot > 0) {
- VERB(" (skipped %d snapshot%s)",
- n_skipped_snapshots_since_last_snapshot,
- ( n_skipped_snapshots_since_last_snapshot == 1 ? "" : "s") );
- }
- VERB_snapshot(kind, snapshot_i);
- }
+ if (n_skipped_snapshots_since_last_snapshot > 0) {
+ VERB(1, " (skipped %d snapshot%s)",
+ n_skipped_snapshots_since_last_snapshot,
+ ( n_skipped_snapshots_since_last_snapshot == 1 ? "" : "s") );
+ }
+ VERB_snapshot(1, kind, snapshot_i);
n_skipped_snapshots_since_last_snapshot = 0;
}
@@ -1735,26 +1736,26 @@
// Stats
if (VG_(clo_verbosity) > 1) {
tl_assert(n_xpts > 0); // always have alloc_xpt
- VERB("allocs: %u", n_allocs);
- VERB("zeroallocs: %u (%d%%)",
+ VERB(1, "allocs: %u", n_allocs);
+ VERB(1, "zeroallocs: %u (%d%%)",
n_zero_allocs,
( n_allocs ? n_zero_allocs * 100 / n_allocs : 0 ));
- VERB("reallocs: %u", n_reallocs);
- VERB("frees: %u", n_frees);
- VERB("stack allocs: %u", n_stack_allocs);
- VERB("stack frees: %u", n_stack_frees);
- VERB("XPts: %u", n_xpts);
- VERB("top-XPts: %u (%d%%)",
+ VERB(1, "reallocs: %u", n_reallocs);
+ VERB(1, "frees: %u", n_frees);
+ VERB(1, "stack allocs: %u", n_stack_allocs);
+ VERB(1, "stack frees: %u", n_stack_frees);
+ VERB(1, "XPts: %u", n_xpts);
+ VERB(1, "top-XPts: %u (%d%%)",
alloc_xpt->n_children,
( n_xpts ? alloc_xpt->n_children * 100 / n_xpts : 0));
- VERB("dup'd XPts: %u", n_dupd_xpts);
- VERB("dup'd/freed XPts: %u", n_dupd_xpts_freed);
- VERB("XPt-init-expansions: %u", n_xpt_init_expansions);
- VERB("XPt-later-expansions: %u", n_xpt_later_expansions);
- VERB("skipped snapshots: %u", n_skipped_snapshots);
- VERB("real snapshots: %u", n_real_snapshots);
- VERB("cullings: %u", n_cullings);
- VERB("XCon_redos: %u", n_getXCon_redo);
+ VERB(1, "dup'd XPts: %u", n_dupd_xpts);
+ VERB(1, "dup'd/freed XPts: %u", n_dupd_xpts_freed);
+ VERB(1, "XPt-init-expansions: %u", n_xpt_init_expansions);
+ VERB(1, "XPt-later-expansions: %u", n_xpt_later_expansions);
+ VERB(1, "skipped snapshots: %u", n_skipped_snapshots);
+ VERB(1, "real snapshots: %u", n_real_snapshots);
+ VERB(1, "cullings: %u", n_cullings);
+ VERB(1, "XCon_redos: %u", n_getXCon_redo);
}
}
@@ -1769,10 +1770,10 @@
Word alloc_fn_word;
if (VG_(clo_verbosity) > 1) {
- VERB("alloc-fns:");
+ VERB(1, "alloc-fns:");
VG_(OSetWord_ResetIter)(alloc_fns);
while ( VG_(OSetWord_Next)(alloc_fns, &alloc_fn_word) ) {
- VERB(" %d: %s", i, (Char*)alloc_fn_word);
+ VERB(1, " %d: %s", i, (Char*)alloc_fn_word);
i++;
}
}
|
|
From: <sv...@va...> - 2007-10-04 05:28:53
|
Author: njn Date: 2007-10-04 06:28:54 +0100 (Thu, 04 Oct 2007) New Revision: 6936 Log: comment Modified: branches/MASSIF2/massif/ms_main.c Modified: branches/MASSIF2/massif/ms_main.c =================================================================== --- branches/MASSIF2/massif/ms_main.c 2007-10-04 00:26:24 UTC (rev 6935) +++ branches/MASSIF2/massif/ms_main.c 2007-10-04 05:28:54 UTC (rev 6936) @@ -89,7 +89,7 @@ // XML, Nick wants something easy to read in Perl) // - allow truncation of long fnnames if the exact line number is // identified? [hmm, could make getting the name of alloc-fns more -// difficult] +// difficult] [could dump full names to file, truncate in ms_print] // // Examine and fix bugs on bugzilla: // IGNORE: |
|
From: Tom H. <th...@cy...> - 2007-10-04 02:30:43
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2007-10-04 03:15:01 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 256 tests, 27 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/addressable (stderr) memcheck/tests/badjump (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-pool-0 (stderr) memcheck/tests/leak-pool-1 (stderr) memcheck/tests/leak-pool-2 (stderr) memcheck/tests/leak-pool-3 (stderr) memcheck/tests/leak-pool-4 (stderr) memcheck/tests/leak-pool-5 (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/long_namespace_xml (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/partial_load_dflt (stderr) memcheck/tests/partial_load_ok (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/xor-undef-x86 (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2007-10-04 02:26:47
|
Nightly build on dellow ( x86_64, Fedora 7 ) started at 2007-10-04 03:10:07 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 293 tests, 4 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2007-10-04 02:19:15
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2007-10-04 03:05:05 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 293 tests, 4 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |