Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for writeHeapProto (0.25 sec)

  1. src/runtime/pprof/protomem.go

    // license that can be found in the LICENSE file.
    
    package pprof
    
    import (
    	"internal/profilerecord"
    	"io"
    	"math"
    	"runtime"
    	"strings"
    )
    
    // writeHeapProto writes the current heap profile in protobuf format to w.
    func writeHeapProto(w io.Writer, p []profilerecord.MemProfileRecord, rate int64, defaultSampleType string) error {
    	b := newProfileBuilder(w)
    	b.pbValueType(tagProfile_PeriodType, "space", "bytes")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 14:38:45 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  2. src/runtime/pprof/protomem_test.go

    		name              string
    		defaultSampleType string
    	}{
    		{"heap", ""},
    		{"allocs", "alloc_space"},
    	} {
    		t.Run(tc.name, func(t *testing.T) {
    			var buf bytes.Buffer
    			if err := writeHeapProto(&buf, rec, rate, tc.defaultSampleType); err != nil {
    				t.Fatalf("writing profile: %v", err)
    			}
    
    			p, err := profile.Parse(&buf)
    			if err != nil {
    				t.Fatalf("profile.Parse: %v", err)
    			}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 14:38:45 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  3. src/runtime/pprof/pprof.go

    		p = make([]profilerecord.MemProfileRecord, n+50)
    		n, ok = pprof_memProfileInternal(p, true)
    		if ok {
    			p = p[0:n]
    			break
    		}
    		// Profile grew; try again.
    	}
    
    	if debug == 0 {
    		return writeHeapProto(w, p, int64(runtime.MemProfileRate), defaultSampleType)
    	}
    
    	slices.SortFunc(p, func(a, b profilerecord.MemProfileRecord) int {
    		return cmp.Compare(a.InUseBytes(), b.InUseBytes())
    	})
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:52:17 UTC 2024
    - 30.6K bytes
    - Viewed (0)
Back to top