const maxTraceStringLen … type traceStringTable … // put adds a string to the table, emits it, and returns a unique ID for it. func (t *traceStringTable) put(gen uintptr, s string) uint64 { … } // emit emits a string and creates an ID for it, but doesn't add it to the table. Returns the ID. func (t *traceStringTable) emit(gen uintptr, s string) uint64 { … } // writeString writes the string to t.buf. // // Must run on the systemstack because it acquires t.lock. // //go:systemstack func (t *traceStringTable) writeString(gen uintptr, id uint64, s string) { … } // reset clears the string table and flushes any buffers it has. // // Must be called only once the caller is certain nothing else will be // added to this table. func (t *traceStringTable) reset(gen uintptr) { … }