2022-03-26 14:04:36 -06:00
|
|
|
// Copyright 2022 The Gitea Authors. All rights reserved.
|
2022-11-27 11:20:29 -07:00
|
|
|
// SPDX-License-Identifier: MIT
|
2022-03-26 14:04:36 -06:00
|
|
|
|
|
|
|
package log
|
|
|
|
|
|
|
|
import "unsafe"
|
|
|
|
|
|
|
|
//go:linkname runtime_getProfLabel runtime/pprof.runtime_getProfLabel
|
2022-12-08 01:21:37 -07:00
|
|
|
func runtime_getProfLabel() unsafe.Pointer //nolint
|
2022-03-26 14:04:36 -06:00
|
|
|
|
|
|
|
type labelMap map[string]string
|
|
|
|
|
|
|
|
func getGoroutineLabels() map[string]string {
|
|
|
|
l := (*labelMap)(runtime_getProfLabel())
|
|
|
|
if l == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return *l
|
|
|
|
}
|