Skip to content

Commit

Permalink
roachtest: enable jemalloc profiling in all roachtests
Browse files Browse the repository at this point in the history
This patch ensures that roachtest clusters start with jemalloc
profiling enabled.

(Ideally we'd like to do this for _all_ cockroachdb servers, however
that would need a more invasive change. Punting until a later PR.)

Release note: None
  • Loading branch information
knz committed Sep 11, 2020
1 parent 114eeb7 commit 2d69b3d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/cmd/roachtest/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -2124,12 +2124,20 @@ func (c *cluster) StartE(ctx context.Context, opts ...option) error {
}
args = append(args, roachprodArgs(opts)...)
args = append(args, c.makeNodes(opts...))
// Enable Jemalloc profiles for all roachtests. This has only
// minimal performance impact and significantly improves the
// troubleshootability of memory-related issues.
args = append(args, enableJemallocArgs()...)
if !argExists(args, "--encrypt") && c.encryptDefault {
args = append(args, "--encrypt")
}
return execCmd(ctx, c.l, args...)
}

func enableJemallocArgs() []string {
return []string{"-e", "MALLOC_CONF=prof:true"}
}

// Start is like StartE() except it takes a test and, on error, calls t.Fatal().
func (c *cluster) Start(ctx context.Context, t *test, opts ...option) {
FatalIfErr(t, c.StartE(ctx, opts...))
Expand Down

0 comments on commit 2d69b3d

Please sign in to comment.