本文整理匯總了Golang中github.com/google/pprof/profile.Profile.PruneFrom方法的典型用法代碼示例。如果您正苦於以下問題:Golang Profile.PruneFrom方法的具體用法?Golang Profile.PruneFrom怎麽用?Golang Profile.PruneFrom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/google/pprof/profile.Profile
的用法示例。
在下文中一共展示了Profile.PruneFrom方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: applyFocus
// applyFocus filters samples based on the focus/ignore options
func applyFocus(prof *profile.Profile, v variables, ui plugin.UI) error {
focus, err := compileRegexOption("focus", v["focus"].value, nil)
ignore, err := compileRegexOption("ignore", v["ignore"].value, err)
hide, err := compileRegexOption("hide", v["hide"].value, err)
show, err := compileRegexOption("show", v["show"].value, err)
tagfocus, err := compileTagFilter("tagfocus", v["tagfocus"].value, ui, err)
tagignore, err := compileTagFilter("tagignore", v["tagignore"].value, ui, err)
prunefrom, err := compileRegexOption("prune_from", v["prune_from"].value, err)
if err != nil {
return err
}
fm, im, hm, hnm := prof.FilterSamplesByName(focus, ignore, hide, show)
warnNoMatches(focus == nil || fm, "Focus", ui)
warnNoMatches(ignore == nil || im, "Ignore", ui)
warnNoMatches(hide == nil || hm, "Hide", ui)
warnNoMatches(show == nil || hnm, "Show", ui)
tfm, tim := prof.FilterSamplesByTag(tagfocus, tagignore)
warnNoMatches(tagfocus == nil || tfm, "TagFocus", ui)
warnNoMatches(tagignore == nil || tim, "TagIgnore", ui)
if prunefrom != nil {
prof.PruneFrom(prunefrom)
}
return nil
}