Skip to content

Include symbols in gitlab-runner binary

Igor requested to merge no-strip into master

What does this MR do?

This patch ensures we compile the binary with symbols.

This is done by removing the -s and -w ldflags. go link defines those as:

-s
	Omit the symbol table and debug information.
-w
	Omit the DWARF symbol table.

Why was this MR needed?

This is a corrective action for gitlab-com/gl-infra/production#3617 (closed).

We often use perf to perform CPU profiling in production in order to diagnose CPU saturation issues.

Getting usable flamegraphs from a profile requires having symbols available. Those are currently not available in gitlab-runner because we are stripping the binary.

Almost all of the go binaries we run are unstripped. As such, the overhead in binary size should not be much of an issue, and the benefit IMO outweighs the cost.

What's the best way to test this MR?

Our standard CI and QA should do the trick. :)

Once it's rolled out on gstg, we can apply some of the techniques from https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/11138.

What are the relevant issue numbers?

Edited by Igor

Merge request reports