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
|
|
|
|
func runtime_getProfLabel() unsafe.Pointer // nolint
|
|
|
|
|
|
|
|
type labelMap map[string]string
|
|
|
|
|
|
|
|
func getGoroutineLabels() map[string]string {
|
|
|
|
l := (*labelMap)(runtime_getProfLabel())
|
|
|
|
if l == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return *l
|
|
|
|
}
|