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
|
2
(6) |
3
(1) |
4
(1) |
5
(20) |
6
(3) |
|
7
(1) |
8
(3) |
9
(4) |
10
(1) |
11
(1) |
12
(3) |
13
(5) |
|
14
|
15
|
16
(2) |
17
(3) |
18
(4) |
19
(2) |
20
(1) |
|
21
(1) |
22
(2) |
23
(3) |
24
(2) |
25
(2) |
26
(7) |
27
(1) |
|
28
(28) |
29
|
30
(1) |
|
|
|
|
|
From: <sv...@va...> - 2015-06-26 15:44:08
|
Author: weidendo
Date: Fri Jun 26 16:44:01 2015
New Revision: 15360
Log:
Minor shuffling in Callgrind format doc
Modified:
trunk/callgrind/docs/cl-format.xml
Modified: trunk/callgrind/docs/cl-format.xml
==============================================================================
--- trunk/callgrind/docs/cl-format.xml (original)
+++ trunk/callgrind/docs/cl-format.xml Fri Jun 26 16:44:01 2015
@@ -378,18 +378,21 @@
<screen>NoNewLineChar := all characters without "\n"</screen>
</para>
+<para>A profile data file ("ProfileDataFile") starts with basic information
+ such as the version and creator information, and then has a list of parts, where
+ each part has its own header and body. Parts typically are different threads
+ and/or time spans/phases within a profiled application run.</para>
+
+<para>Note that callgrind_annotate currently only supports profile data files with
+ one part. Callgrind may produce multiple parts for one profile run, but defaults
+ to one output file for each part.</para>
+
</sect2>
<sect2 id="cl-format.reference.header" xreflabel="Description of Header Lines">
<title>Description of Header Lines</title>
-<para>As given in the grammar, a profile data file starts with basic information
- such as the version and creator information, and then has a list of parts, where
- each part has its own header and body. Parts typically are different threads
- and/or time spans/phases within a profiled application run.</para>
-
-<para>Basic information in the first lines of a profile data file,
- optionally, allowed to appear only once:</para>
+<para>Basic information in the first lines of a profile data file:</para>
<itemizedlist>
<listitem>
@@ -465,11 +468,11 @@
<listitem>
<para><computeroutput>events: event type abbreviations</computeroutput> [Cachegrind]</para>
- <para>A list of short names of the event types logged in this
- file. Arbitrary short names are allowed. The order given
- specifies the required order in cost lines within the body of
- this part. Thus, the first event type is the second or third number
- in a cost line, depending on the value of "positions".
+ <para>A list of short names of the event types logged in cost
+ lines in this part of the profile data file. Arbitrary short
+ names are allowed. The order given specifies the required order
+ in cost lines. Thus, the first event type is the second or third
+ number in a cost line, depending on the value of "positions".
Required to appear for each header part exactly once.</para>
</listitem>
|
|
From: <sv...@va...> - 2015-06-26 15:26:27
|
Author: florian
Date: Fri Jun 26 16:26:20 2015
New Revision: 15359
Log:
Change vg_assert to aspacem_assert. This was already fixed in r13530
but got re-introduced in r15357.
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c Fri Jun 26 16:26:20 2015
@@ -2331,7 +2331,7 @@
aspacem_assert(seg->kind == SkResvn);
const NSegment *anon_seg = ML_(am_next_segment)(seg);
- vg_assert(anon_seg != NULL);
+ aspacem_assert(anon_seg != NULL);
udelta = VG_PGROUNDUP(anon_seg->start - addr);
*new_stack_base = anon_seg->start - udelta;
|
|
From: <sv...@va...> - 2015-06-26 14:05:42
|
Author: weidendo
Date: Fri Jun 26 15:05:33 2015
New Revision: 15358
Log:
Complete/Fix Callgrind format specification.
Modified:
trunk/callgrind/docs/cl-format.xml
Modified: trunk/callgrind/docs/cl-format.xml
==============================================================================
--- trunk/callgrind/docs/cl-format.xml (original)
+++ trunk/callgrind/docs/cl-format.xml Fri Jun 26 15:05:33 2015
@@ -103,7 +103,7 @@
position specifications, but consist of two lines. For calls, the format
looks like
<screen>
- calls=(Call Count) (Destination position)
+ calls=(Call Count) (Target position)
(Source position) (Inclusive cost of call)
</screen></para>
@@ -327,7 +327,7 @@
<para>
<screen>ProfileDataFile := FormatVersion? Creator? PartData*</screen>
-<screen>FormatVersion := "version:" Space* Number "\n"</screen>
+<screen>FormatVersion := "version: 1\n"</screen>
<screen>Creator := "creator:" NoNewLineChar* "\n"</screen>
<screen>PartData := (HeaderLine "\n")+ (BodyLine "\n")+</screen>
<screen>HeaderLine := (empty line)
@@ -351,22 +351,23 @@
<screen>BodyLine := (empty line)
| ('#' NoNewLineChar*)
| CostLine
- | PositionSpecification
- | AssociationSpecification</screen>
+ | PositionSpec
+ | CallSpec
+ | UncondJumpSpec
+ | CondJumpSpec</screen>
<screen>CostLine := SubPositionList Costs?</screen>
<screen>SubPositionList := (SubPosition+ Space+)+</screen>
<screen>SubPosition := Number | "+" Number | "-" Number | "*"</screen>
<screen>Costs := (Number Space+)+</screen>
-<screen>PositionSpecification := Position "=" Space* PositionName</screen>
+<screen>PositionSpec := Position "=" Space* PositionName</screen>
<screen>Position := CostPosition | CalledPosition</screen>
<screen>CostPosition := "ob" | "fl" | "fi" | "fe" | "fn"</screen>
<screen>CalledPosition := " "cob" | "cfi" | "cfl" | "cfn"</screen>
<screen>PositionName := ( "(" Number ")" )? (Space* NoNewLineChar* )?</screen>
-<screen>AssociationSpecification := CallSpecification
- | JumpSpecification</screen>
-<screen>CallSpecification := CallLine "\n" CostLine</screen>
+<screen>CallSpec := CallLine "\n" CostLine</screen>
<screen>CallLine := "calls=" Space* Number Space+ SubPositionList</screen>
-<screen>JumpSpecification := ...</screen>
+<screen>UncondJumpSpec := "jump=" Space* Number Space+ SubPositionList</screen>
+<screen>CondJumpSpec := "jcnd=" Space* Number Space+ Number Space+ SubPositionList</screen>
<screen>Space := " " | "\t"</screen>
<screen>Number := HexNumber | (Digit)+</screen>
<screen>Digit := "0" | ... | "9"</screen>
@@ -382,11 +383,15 @@
<sect2 id="cl-format.reference.header" xreflabel="Description of Header Lines">
<title>Description of Header Lines</title>
-<para>The header has an arbitrary number of lines of the format
-"key: value". Possible <emphasis>key</emphasis> values for the header are:</para>
+<para>As given in the grammar, a profile data file starts with basic information
+ such as the version and creator information, and then has a list of parts, where
+ each part has its own header and body. Parts typically are different threads
+ and/or time spans/phases within a profiled application run.</para>
-<itemizedlist>
+<para>Basic information in the first lines of a profile data file,
+ optionally, allowed to appear only once:</para>
+<itemizedlist>
<listitem>
<para><computeroutput>version: number</computeroutput> [Callgrind]</para>
<para>This is used to distinguish future profile data formats. A
@@ -396,6 +401,19 @@
</listitem>
<listitem>
+ <para><computeroutput>creator: string</computeroutput> [Callgrind]</para>
+ <para>This is an arbitrary string to denote the creator of this file.
+ Optional.</para>
+ </listitem>
+
+</itemizedlist>
+
+<para>The header for each part has an arbitrary number of lines of the format
+"key: value". Possible <emphasis>key</emphasis> values for the header are:</para>
+
+<itemizedlist>
+
+ <listitem>
<para><computeroutput>pid: process id</computeroutput> [Callgrind]</para>
<para>Optional. This specifies the process ID of the supervised application
for which this profile was generated.</para>
@@ -441,33 +459,18 @@
responsible for the events raised. Note that the mapping of "instr"
and "line" positions are given by the debugging line information
produced by the compiler.</para>
- <para>This field is optional. If not specified, "line" is supposed
- only.</para>
+ <para>This header line is optional, defaulting to "positions:
+ line" if not specified.</para>
</listitem>
<listitem>
<para><computeroutput>events: event type abbreviations</computeroutput> [Cachegrind]</para>
- <para>A list of short names of the event types logged in this file.
- The order is the same as in cost lines. The first event type is the
- second or third number in a cost line, depending on the value of
- "positions". Callgrind does not add additional cost types. Specify
- exactly once.</para>
- <para>Cost types from original Cachegrind are:
- <itemizedlist>
- <listitem>
- <para><command>Ir</command>: Instruction read access</para>
- </listitem>
- <listitem>
- <para><command>I1mr</command>: Instruction Level 1 read cache miss</para>
- </listitem>
- <listitem>
- <para><command>ILmr</command>: Instruction last-level read cache miss</para>
- </listitem>
- <listitem>
- <para>...</para>
- </listitem>
- </itemizedlist>
- </para>
+ <para>A list of short names of the event types logged in this
+ file. Arbitrary short names are allowed. The order given
+ specifies the required order in cost lines within the body of
+ this part. Thus, the first event type is the second or third number
+ in a cost line, depending on the value of "positions".
+ Required to appear for each header part exactly once.</para>
</listitem>
<listitem>
@@ -491,9 +494,19 @@
<sect2 id="cl-format.reference.body" xreflabel="Description of Body Lines">
<title>Description of Body Lines</title>
-<para>There exist lines
-<computeroutput>spec=position</computeroutput>. The values for position
-specifications are arbitrary strings. When starting with "(" and a
+<para>The regular body line is a cost line consisting of one or two
+position numbers (depending on "positions:" header line, see above)
+and an array of cost numbers. A position number either is a
+line numbers into a source file or an instruction address within binary
+code, with source/binary file names specified as position names (see
+below). The cost numbers get mapped to event types in the same order
+as specified in the "events:" header line. If less numbers than event
+types are given, the costs default to zero for the remaining event
+types.</para>
+
+<para>Further, there exist lines
+<computeroutput>spec=position name</computeroutput>. A position name
+is an arbitrary string. If it starts with "(" and a
digit, it's a string in compressed format. Otherwise it's the real
position string. This allows for file and symbol names as position
strings, as these never start with "(" + <emphasis>digit</emphasis>.
@@ -558,26 +571,30 @@
lines.</para>
</listitem>
+</itemizedlist>
+
+<para>The last type of body line provides specific costs not just
+related to one position as regular cost lines. It starts with specific
+strings similar to position name specifications.</para>
+
+<itemizedlist>
+
<listitem>
- <para><computeroutput>calls=</computeroutput> [Callgrind]</para>
- <para>The number of nonrecursive calls which are responsible for the
- cost specified by the next call cost line. This is the cost spent
- inside of the called function.</para>
- <para>After "calls=" there MUST be a cost line. This is the cost
- spent in the called function. The first number is the source line
- from where the call happened.</para>
+ <para><computeroutput>calls=count target-position</computeroutput> [Callgrind]</para>
+ <para>Call executed "count" times to "target-position".
+ After a "calls=" line there MUST be a cost line. This provides the source position
+ of the call and the cost spent in the called function in total.</para>
</listitem>
<listitem>
- <para><computeroutput>jump=count target position</computeroutput> [Callgrind]</para>
- <para>Unconditional jump, executed count times, to the given target
- position.</para>
+ <para><computeroutput>jump=count target-position</computeroutput> [Callgrind]</para>
+ <para>Unconditional jump, executed "count" times, to "target-position".</para>
</listitem>
<listitem>
- <para><computeroutput>jcnd=exe.count jumpcount target position</computeroutput> [Callgrind]</para>
- <para>Conditional jump, executed exe.count times with jumpcount
- jumps to the given target position.</para>
+ <para><computeroutput>jcnd=exe-count jump-count target-position</computeroutput> [Callgrind]</para>
+ <para>Conditional jump, executed "exe-count" times with "jump-count" jumps
+ happening (rest is fall-through) to "target-position".</para>
</listitem>
</itemizedlist>
|
|
From: <sv...@va...> - 2015-06-26 13:12:09
|
Author: florian
Date: Fri Jun 26 14:12:01 2015
New Revision: 15357
Log:
Make aspacemgr-linux.c independent of the nsegments array.
Functions ML_(am_next_segment) and ML_(am_prev_segment) can
be used to traverse the ordered segment collection.
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-segments.c
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/priv_aspacemgr.h
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c Fri Jun 26 14:12:01 2015
@@ -41,15 +41,6 @@
#include "priv_aspacemgr.h"
#include "config.h"
-/* FIXME: for now */
-extern NSegment nsegments[];
-extern Int nsegments_used;
-
-/* Note: many of the exported functions implemented below are
- described more fully in comments in pub_core_aspacemgr.h.
-*/
-
-
/*-----------------------------------------------------------------*/
/*--- ---*/
/*--- Overview. ---*/
@@ -382,7 +373,6 @@
const NSegment *segLo = ML_(am_find_segment)( addr );
const NSegment *segHi = ML_(am_find_segment)( addr + len - 1 );
- aspacem_assert(segLo <= segHi);
aspacem_assert(segLo->start <= addr );
aspacem_assert(segHi->end >= addr + len - 1 );
@@ -415,8 +405,9 @@
/* Segments segLo .. segHi inclusive should agree with the
presented data. */
- for (const NSegment *seg = segLo; seg <= segHi; seg++) {
-
+ const NSegment *seg;
+ Int i;
+ for (i = 0, seg = segLo; True; seg = ML_(am_next_segment)(seg), ++i) {
Bool same, cmp_offsets, cmp_devino;
UInt seg_prot;
@@ -489,7 +480,7 @@
VG_(debugLog)(
0,"aspacem",
"segment mismatch: V's seg 1st, kernel's 2nd:\n");
- ML_(am_show_segment_full)( 0, -1, seg );
+ ML_(am_show_segment_full)( 0, i, seg );
VG_(debugLog)(0,"aspacem",
"...: .... %010llx-%010llx %s %c%c%c.. ....... "
"d=0x%03llx i=%-7lld o=%-7lld (.) m=. %s\n",
@@ -501,6 +492,7 @@
return;
}
+ if (seg == segHi) break;
}
/* Looks harmless. Keep going. */
@@ -526,13 +518,12 @@
const NSegment *segLo = ML_(am_find_segment)( addr );
const NSegment *segHi = ML_(am_find_segment)( addr + len - 1 );
- aspacem_assert(segLo <= segHi);
aspacem_assert(segLo->start <= addr );
aspacem_assert(segHi->end >= addr + len - 1 );
/* Segments segLo .. segHo inclusive should agree with the
presented data. */
- for (const NSegment *seg = segLo; seg <= segHi; seg++) {
+ for (const NSegment *seg = segLo; True; seg = ML_(am_next_segment)(seg)) {
Bool same;
/* compare the kernel's offering against ours. */
@@ -555,6 +546,7 @@
(ULong)start, (ULong)end, len_buf);
return;
}
+ if (seg == segHi) break;
}
/* Looks harmless. Keep going. */
@@ -635,7 +627,7 @@
segHi = ML_(am_find_segment)(start + len - 1);
}
- for (const NSegment *seg = segLo; seg <= segHi; seg++) {
+ for (const NSegment *seg = segLo; True; seg = ML_(am_next_segment)(seg)) {
if ( (seg->kind & kinds) != 0
&& (needR ? seg->hasR : True)
&& (needW ? seg->hasW : True)
@@ -644,6 +636,7 @@
} else {
return False;
}
+ if (seg == segHi) break;
}
return True;
@@ -689,9 +682,11 @@
aspacem_assert(start + len > start);
const NSegment *segLo = ML_(am_find_segment)(start);
const NSegment *segHi = ML_(am_find_segment)(start + len - 1);
- for (const NSegment *seg = segLo; seg <= segHi; seg++) {
+
+ for (const NSegment *seg = segLo; True; seg = ML_(am_next_segment)(seg)) {
if (seg->hasT)
return True;
+ if (seg == segHi) break;
}
return False;
}
@@ -724,7 +719,7 @@
if (seg->smode != SmUpper) return False;
/* If the the abutting segment towards higher addresses is an SkAnonC
segment, then ADDR is a future stack pointer. */
- const NSegment *next = ML_(am_next_segment)(seg, /*forward*/ True);
+ const NSegment *next = ML_(am_next_segment)(seg);
if (next == NULL || next->kind != SkAnonC) return False;
/* OK; looks like a stack segment */
@@ -735,7 +730,7 @@
/* If the abutting segment towards lower addresses is an SkResvn
segment, then ADDR is a stack pointer into mapped memory. */
if (kind == MkUnmapped) return False;
- const NSegment *next = ML_(am_next_segment)(seg, /*forward*/ False);
+ const NSegment *next = ML_(am_prev_segment)(seg);
if (next == NULL || next->kind != SkResvn || next->smode != SmUpper)
return False;
@@ -775,7 +770,7 @@
then this is OK. */
if (seg->smode != SmUpper) goto bad;
*start = seg->start;
- seg = ML_(am_next_segment)(seg, /*forward*/ True);
+ seg = ML_(am_next_segment)(seg);
if (!seg || seg->kind != SkAnonC || !seg->hasR || !seg->hasW) goto bad;
*end = seg->end;
return True;
@@ -1082,8 +1077,6 @@
it does not trash either any of its own mappings or any of
valgrind's mappings.
*/
- UInt j;
-
Addr startPoint = forClient ? aspacem_cStart : aspacem_vStart;
Addr reqStart = req->rkind==MAny ? 0 : req->start;
@@ -1115,7 +1108,7 @@
const NSegment *segLo = ML_(am_find_segment)(reqStart);
const NSegment *segHi = ML_(am_find_segment)(reqEnd);
Bool allow = True;
- for (const NSegment *seg = segLo; seg <= segHi; seg++) {
+ for (const NSegment *seg = segLo; True; seg = ML_(am_next_segment)(seg)) {
if (seg->kind == SkFree
|| seg->kind == SkFileC
|| seg->kind == SkAnonC
@@ -1126,6 +1119,7 @@
allow = False;
break;
}
+ if (seg == segHi) break;
}
if (allow) {
/* Acceptable. Granted. */
@@ -1143,13 +1137,14 @@
const NSegment *segLo = ML_(am_find_segment)(reqStart);
const NSegment *segHi = ML_(am_find_segment)(reqEnd);
Bool allow = True;
- for (const NSegment *seg = segLo; seg <= segHi; seg++) {
+ for (const NSegment *seg = segLo; True; seg = ML_(am_next_segment)(seg)) {
if (seg->kind == SkFree || seg->kind == SkResvn) {
/* ok */
} else {
allow = False;
break;
}
+ if (seg == segHi) break;
}
if (allow) {
/* Acceptable. Granted. */
@@ -1169,12 +1164,12 @@
Bool fixed_not_required = req->rkind == MAny;
const NSegment *seg = ML_(am_find_segment)(startPoint);
+ const NSegment *sentinel = ML_(am_prev_segment)(seg);
/* Examine holes from index i back round to i-1. Record the
index first fixed hole and the first floating hole which would
satisfy the request. */
- for (j = 0; j < nsegments_used; j++) {
-
+ while (True) {
if (seg->kind == SkFree) {
Addr holeStart = seg->start;
Addr holeEnd = seg->end;
@@ -1197,9 +1192,9 @@
if ((fixed_not_required || fixedSeg != NULL) && floatSeg != NULL)
break;
}
- seg++;
- if (seg == nsegments + nsegments_used)
- seg = nsegments + 0; // wrap around
+ if (seg == sentinel) break; // we're done
+ seg = ML_(am_next_segment)(seg);
+ if (seg == NULL) seg = ML_(am_find_segment)(Addr_MIN); // wrap around
}
if (fixedSeg != NULL)
@@ -2075,10 +2070,8 @@
if (delta > 0) {
/* Extending the segment forwards. */
- segR = segA+1;
- if (segR >= nsegments + nsegments_used
- || segR->kind != SkResvn
- || segR->smode != SmLower)
+ segR = ML_(am_next_segment)(segA);
+ if (segR == NULL || segR->kind != SkResvn || segR->smode != SmLower)
return NULL;
if (delta + VKI_PAGE_SIZE
@@ -2113,10 +2106,9 @@
/* Extending the segment backwards. */
delta = -delta;
aspacem_assert(delta > 0);
- aspacem_assert(segA > nsegments);
- segR = segA-1;
- if (segR->kind != SkResvn || segR->smode != SmUpper)
+ segR = ML_(am_prev_segment)(segA);
+ if (segR == NULL || segR->kind != SkResvn || segR->smode != SmUpper)
return NULL;
if ((delta + VKI_PAGE_SIZE) > (segR->end - segR->start + 1)) {
@@ -2243,7 +2235,7 @@
try hard to ensure we're not going to segfault by doing the
write - check both ends of the range are in the same segment
and that segment is writable. */
- const NSegment *nseg = VG_(am_find_nsegment)(newbrk);
+ const NSegment *nseg = ML_(am_find_segment)(newbrk);
aspacem_assert(nseg == aseg);
if (aseg->hasW)
VG_(memset)( (void*)newbrk, 0, oldbrk - newbrk );
@@ -2327,8 +2319,7 @@
Bool overflow = False;
/* Get the segment containing addr. */
- const NSegment *seg = VG_(am_find_nsegment)(addr);
- aspacem_assert(seg != NULL);
+ const NSegment *seg = ML_(am_find_segment)(addr);
if (seg->kind == SkAnonC) {
/* Ought to be the extensible stack segment */
@@ -2338,8 +2329,9 @@
return sres;
}
- const NSegment *anon_seg = ML_(am_next_segment)(seg, True/*fwds*/);
- aspacem_assert(anon_seg != NULL);
+ aspacem_assert(seg->kind == SkResvn);
+ const NSegment *anon_seg = ML_(am_next_segment)(seg);
+ vg_assert(anon_seg != NULL);
udelta = VG_PGROUNDUP(anon_seg->start - addr);
*new_stack_base = anon_seg->start - udelta;
@@ -2386,8 +2378,8 @@
/* The segment following the client segment must be a free segment and
it must be large enough to cover the additional memory. */
- NSegment *segf = seg + 1;
- aspacem_assert(segf->kind == SkFree);
+ const NSegment *segf = ML_(am_next_segment)(seg);
+ aspacem_assert(segf && segf->kind == SkFree);
aspacem_assert(segf->start == xStart);
aspacem_assert(xStart + delta - 1 <= segf->end);
@@ -2430,9 +2422,6 @@
Addr old_addr, SizeT old_len,
Addr new_addr, SizeT new_len )
{
- SysRes sres;
- NSegment seg;
-
*need_discard = False;
if (old_len == 0 || new_len == 0)
@@ -2461,8 +2450,9 @@
segLo->kind != SkShmC)
return False;
- sres = ML_(am_do_relocate_nooverlap_mapping_NO_NOTIFY)
- ( old_addr, old_len, new_addr, new_len );
+ SysRes sres =
+ ML_(am_do_relocate_nooverlap_mapping_NO_NOTIFY)( old_addr, old_len,
+ new_addr, new_len );
if (sr_isError(sres)) {
AM_SANITY_CHECK();
return False;
@@ -2473,7 +2463,7 @@
*need_discard = any_Ts_in_range( old_addr, old_len )
|| any_Ts_in_range( new_addr, new_len );
- seg = *segLo;
+ NSegment seg = *segLo;
/* Mark the new area based on the old seg. */
if (seg.kind == SkFileC) {
@@ -2919,7 +2909,7 @@
/* NSegments segLo .. segHi inclusive should agree with the presented
data. */
- for (const NSegment *seg = segLo; seg <= segHi; seg++) {
+ for (const NSegment *seg = segLo; True; seg = ML_(am_next_segment)(seg)) {
switch (seg->kind) {
case SkAnonV:
case SkFileV:
@@ -2985,6 +2975,7 @@
default:
aspacem_assert(0);
}
+ if (seg == segHi) break;
}
}
@@ -3003,7 +2994,7 @@
/* Segments segLo .. segHi inclusive should agree with the
presented data. */
- for (const NSegment *seg = segLo; seg <= segHi; seg++) {
+ for (const NSegment *seg = segLo; True; seg = ML_(am_next_segment)(seg)) {
if (seg->kind != SkFree && seg->kind != SkResvn) {
/* V has a mapping, kernel doesn't. Add to css_local[],
directives to chop off the part of the V mapping that
@@ -3027,6 +3018,7 @@
css_overflowed = True;
}
}
+ if (seg == segHi) break;
}
}
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-segments.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-segments.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-segments.c Fri Jun 26 14:12:01 2015
@@ -58,8 +58,37 @@
/* I: the segments cover the entire address space precisely. */
/* Each segment can optionally hold an index into the filename table. */
-NSegment nsegments[VG_N_SEGMENTS];
-Int nsegments_used = 0;
+static NSegment nsegments[VG_N_SEGMENTS];
+static Int nsegments_used = 0;
+
+
+/*-----------------------------------------------------------------*/
+/*--- ---*/
+/*--- Low level access of segment nodes. ---*/
+/*--- ---*/
+/*-----------------------------------------------------------------*/
+
+/* From the ordered collection of segments, return the segment
+ succeeding SEG, or NULL if there is no such segment. */
+NSegment *ML_(am_next_segment)( const NSegment *seg )
+{
+ UInt ix = seg - nsegments;
+ if (ix != nsegments_used - 1)
+ return nsegments + ix + 1;
+
+ return NULL; // no succeeding segment
+}
+
+/* From the ordered collection of segments, return the segment
+ preceding SEG, or NULL if there is no such segment. */
+NSegment *ML_(am_prev_segment)( const NSegment *seg )
+{
+ UInt ix = seg - nsegments;
+ if (ix != 0)
+ return nsegments + ix - 1;
+
+ return NULL; // no preceding segment
+}
/*-----------------------------------------------------------------*/
@@ -447,23 +476,6 @@
return seg->kind == SkFree ? NULL : seg;
}
-/* Find the next segment along from 'here', if it is a non-SkFree segment. */
-const NSegment *ML_(am_next_segment)( const NSegment *here, Bool fwds )
-{
- const NSegment *next;
-
- if (fwds) {
- next = here + 1;
- if (next >= nsegments + nsegments_used)
- return NULL;
- } else {
- if (here == nsegments)
- return NULL;
- next = here - 1;
- }
- return (next->kind == SkFree) ? NULL : next;
-}
-
/*-----------------------------------------------------------------*/
/*--- ---*/
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/priv_aspacemgr.h
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/priv_aspacemgr.h (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/priv_aspacemgr.h Fri Jun 26 14:12:01 2015
@@ -163,7 +163,8 @@
void ML_(am_clientise)( Addr start, SizeT len );
void ML_(am_init_segment)( /*OUT*/NSegment *seg, SegKind kind, Addr start,
Addr end);
-const NSegment *ML_(am_next_segment)( const NSegment *here, Bool fwds );
+NSegment *ML_(am_next_segment)( const NSegment *seg );
+NSegment *ML_(am_prev_segment)( const NSegment *seg );
NSegment *ML_(am_find_segment)( Addr a );
|
|
From: Rhys K. <rhy...@gm...> - 2015-06-26 12:27:18
|
Proposed patch below for comment, to resolve Coverity report #1233786.
See: coregrind/m_syswrap/syswrap-xen.c
==============================
PRE_MEM_READ("__HYPERVISOR_tmem_op pool_id",
(Addr)&tmem->pool_id, sizeof(&tmem->pool_id));
Taking the size of &tmem->pool_id, which is the address of an object, is
suspicious.
It appears that the code should read sizeof(tmem->pool_id). Would a V user
on xen or at Citrix please be able to test the below proposed patch?
It appears to be a straightforward fix, but would appreciate a more
knowledgeable user with that platform to confirm.
Regards,
Rhys
Index: coregrind/m_syswrap/syswrap-xen.c
===================================================================
--- coregrind/m_syswrap/syswrap-xen.c (revision 15356)
+++ coregrind/m_syswrap/syswrap-xen.c (working copy)
@@ -943,7 +943,7 @@
* vki_uint32_t subop;
*/
PRE_MEM_READ("__HYPERVISOR_tmem_op pool_id",
- (Addr)&tmem->pool_id, sizeof(&tmem->pool_id));
+ (Addr)&tmem->pool_id, sizeof(tmem->pool_id));
PRE_XEN_TMEMOP_READ(ctrl, subop);
switch (tmem->u.ctrl.subop) {
|
|
From: <sv...@va...> - 2015-06-26 11:00:54
|
Author: florian
Date: Fri Jun 26 12:00:47 2015
New Revision: 15356
Log:
Use switch statement instead of if-else-cascade.
Modified:
branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c
==============================================================================
--- branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c (original)
+++ branches/ASPACEM_TWEAKS/coregrind/m_aspacemgr/aspacemgr-linux.c Fri Jun 26 12:00:47 2015
@@ -271,7 +271,6 @@
/* Limits etc */
-
Addr VG_(clo_aspacem_minAddr)
#if defined(VGO_darwin)
# if VG_WORDSIZE == 4
@@ -2921,15 +2920,15 @@
/* NSegments segLo .. segHi inclusive should agree with the presented
data. */
for (const NSegment *seg = segLo; seg <= segHi; seg++) {
-
- UInt seg_prot;
-
- if (seg->kind == SkAnonV || seg->kind == SkFileV) {
+ switch (seg->kind) {
+ case SkAnonV:
+ case SkFileV:
/* Ignore V regions */
- continue;
- }
- else if (seg->kind == SkFree || seg->kind == SkResvn) {
- /* Add mapping for SkResvn regions */
+ break;
+
+ case SkFree:
+ case SkResvn: {
+ /* Add mapping */
ChangedSeg* cs = &css_local[css_used_local];
if (css_used_local < css_size_local) {
cs->is_added = True;
@@ -2942,15 +2941,15 @@
css_overflowed = True;
}
return;
-
}
- else if (seg->kind == SkAnonC ||
- seg->kind == SkFileC ||
- seg->kind == SkShmC)
- {
+
+ case SkAnonC:
+ case SkFileC:
+ case SkShmC: {
/* Check permissions on client regions */
// GrP fixme
- seg_prot = 0;
+ UInt seg_prot = 0;
+
if (seg->hasR) seg_prot |= VKI_PROT_READ;
if (seg->hasW) seg_prot |= VKI_PROT_WRITE;
# if defined(VGA_x86)
@@ -2979,10 +2978,11 @@
css_overflowed = True;
}
return;
-
}
+ break;
+ }
- } else {
+ default:
aspacem_assert(0);
}
}
|
|
From: Lukasz M. <luk...@gm...> - 2015-06-26 01:19:38
|
Hi, For some time I wanted to write valgrdind tool that tracks "resources". It is something you mention on webpage as a proposal. I made some initial implementation, it has hardcoded functions, but about it later. I assumed the tracked API is like this: token = create_resource() retain_resource(token) retain_resource(token) ... ... release_resource(token) release_resource(token) So, there is alloc function(s). Resource can be retained and released by token provided by allocator. Even this implementation allow multiple allocators retainers and releasers, but it is not my point for now. For now I have 2 questions, I hope you don't mind, they may seem trivial for you, but can't find answer myself. 1. does result of VG_(record_ExeContext) have to be freed in some way? 2. is there way to check if valgrind's tool have some leaks? Running valgrind under valgrind? :) The implemntation I'm sending has hardcoded functions: create_resource retain_resource release_resource I'm Ok, to customize this implementation to my real need, but perfectly it should be configurable by config file. I have just doubts how it should work eventually. You say on you webside, there should be no wrappers, that mismatch original function signature not match everything. At valgrind compilation time there is not way to know function's signature nor it's arguments that user want to track. I assume there is a config file, that describes rules containing allocator, deallocators, etc... I have just an idea to create parser that creates *.c file basing on config and valgrind compiles it and dlopen in preloaded library. In attached implementation I made almost all necessary stuff. Preloaded library would wrap main function and do all stuff to initialize analyzing. It attached implementation preloaded library wraps example functions, in final version where would only be a wrapper for main that loads user provided library/config. My question is: do you have better solution for this? Do not do major review of attached patch, it is still work in progress, I just want consult an idea. Best Regards, Lukasz Marek |