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
|
2022-12-08 09:21:37 +01:00
|
|
|
func runtime_getProfLabel() unsafe.Pointer //nolint
|
2022-03-26 21:04:36 +01:00
|
|
|
|
|
|
|
type labelMap map[string]string
|
|
|
|
|
|
|
|
func getGoroutineLabels() map[string]string {
|
|
|
|
l := (*labelMap)(runtime_getProfLabel())
|
|
|
|
if l == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return *l
|
|
|
|
}
|