| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| // Package pprof defines an interface for accessing runtime profiling data in |
| // the format expected by the pprof visualization tool. For more information |
| // about pprof, see http://code.google.com/p/google-perftools/. |
| package pprof |
| |
| import "v.io/v23/security/access" |
| |
| type PProf interface { |
| // CmdLine returns the command-line arguments of the server, including |
| // the name of the executable. |
| CmdLine() ([]string | error) {access.Debug} |
| // Profiles returns the list of available profiles. |
| Profiles() ([]string | error) {access.Debug} |
| // Profile streams the requested profile. The debug parameter enables |
| // additional output. Passing debug=0 includes only the hexadecimal |
| // addresses that pprof needs. Passing debug=1 adds comments translating |
| // addresses to function names and line numbers, so that a programmer |
| // can read the profile without tools. |
| Profile(name string, debug int32) stream<_, []byte> error {access.Debug} |
| // CpuProfile enables CPU profiling for the requested duration and |
| // streams the profile data. |
| CpuProfile(seconds int32) stream<_, []byte> error {access.Debug} |
| // Symbol looks up the program counters and returns their respective |
| // function names. |
| Symbol(programCounters []uint64) ([]string | error) {access.Debug} |
| } |