-.\" $OpenBSD: dpb.1,v 1.33 2023/05/29 21:13:24 aisha Exp $
+.\" $OpenBSD: dpb.1,v 1.34 2023/06/17 19:35:54 espie Exp $
.\"
.\" Copyright (c) 2010-2013 Marc Espie <espie@openbsd.org>
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: May 29 2023 $
+.Dd $Mdocdate: June 17 2023 $
.Dt DPB 1
.Os
.Sh NAME
Some log files ("rolling logs") are kept from one run to the run and
stored under
.Pa ${DISTDIR}/build-stats .
+On each run, the most recent entries for each pkgpath
+.Po
+see
+.Ar STATS_USED
+.Pc
+are used to figure out in which order things should be built.
+Meanwhile, some more entries are kept around
+.Po
+see
+.Ar STATS_BACKLOG
+.Pc
+for potential data analysis over longer periods.
.Pp
Option
.Fl h Ar file
.It Fl b Ar logfile
Explicitly prime the heuristics module with a previous build log,
so that packages that take a long time to build will happen earlier.
-The rolling log under
+The rolling log file under
.Pa %f/build-stats/%a
is automatically used.
.It Fl C Ar pathlist
can be set to nothing to disable.
.It Ar STARTUP
Define a start-up script on the command-line, override any host file contents.
+.It Ar STATS_BACKLOG
+Max number of stats (per individual pkgpath) to save in the rolling log file
+.Po
+defaults to 25
+.Pc .
+.It Ar STATS_USED
+Clamp number of stats (per individual pkgpath) used for computing build
+order
+.Po
+defaults to 10
+.Pc .
.It Ar STUCK_TIMEOUT
Timeout (in seconds * speed factor) after which tasks that don't show
any progress will be killed.
.It Fl s
Compute workdir sizes before cleaning up, and stash them in log file
.Pa %L/size.log .
-Also maintain a rolling log of build sizes under
+This will also maintain a rolling log of build sizes under
.Pa %f/build-stats/%a-size .
In order to save time,
.Nm
.Nm
also records rolling build statistics under
.Pa ${DISTDIR}/build-stats/${ARCH} ,
-and uses them automatically in the absence of
+and uses them automatically
+.Po
+see
+.Ar STATS_BACKLOG
+and
+.Ar STATS_USED
+.Pc
+in the absence of
.Fl b Ar logfile .
That file belongs to the
.Ar LOG_USER