[SERVER-80400] [CQF] Shorten PolyValue symbols / stack traces Created: 24/Aug/23  Updated: 02/Feb/24

Status: In Progress
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: David Percy Assignee: David Percy
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: QO 2024-02-05, QO 2024-02-19
Participants:

 Description   

PolyValue is a class template similar to std::variant: it takes any number of parameters. In one case (ABT) we instantiate this template with around 50 type arguments. This is a totally reasonable type to want, but one consequence is that the canonical name of this type is very long. And this means the name of any function whose signature mentions this type also has a very long name. Type aliases (typedef / using) only exist in the source code, so they don't make the true names of these functions (which show up in stack traces) any shorter.

A partial solution would be to customize gdb to abbreviate these long function names. But gdb is only one tool that deals with function names and stack traces:

  • other debuggers would need a similar workaround
  • many performance tools like linux perf, callgrind record stack traces
  • mongod can print its own stack trace

Maybe we can tweak the interface to PolyValue (without changing its memory layout or the code it generates) so that its name is not proportional to the number of type arguments.


Generated at Thu Feb 08 06:43:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.