2022-03-27 01:34:36 +05:30
|
|
|
// Copyright 2022 The Gitea Authors. All rights reserved.
|
2022-11-27 23:50:29 +05:30
|
|
|
// SPDX-License-Identifier: MIT
|
2022-03-27 01:34:36 +05:30
|
|
|
|
|
|
|
package log
|
|
|
|
|
|
|
|
import "unsafe"
|
|
|
|
|
|
|
|
//go:linkname runtime_getProfLabel runtime/pprof.runtime_getProfLabel
|
2022-12-08 13:51:37 +05:30
|
|
|
func runtime_getProfLabel() unsafe.Pointer //nolint
|
2022-03-27 01:34:36 +05:30
|
|
|
|
|
|
|
type labelMap map[string]string
|
|
|
|
|
|
|
|
func getGoroutineLabels() map[string]string {
|
|
|
|
l := (*labelMap)(runtime_getProfLabel())
|
|
|
|
if l == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return *l
|
|
|
|
}
|