2022-03-26 21:04:36 +01:00
|
|
|
// Copyright 2022 The Gitea Authors. All rights reserved.
|
2022-11-27 19:20:29 +01:00
|
|
|
// SPDX-License-Identifier: MIT
|
2022-03-26 21:04:36 +01: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
|
|
|
|
}
|