Skip to content

Commit 337e5dd

Browse files
cuishuangaalexand
andauthored
Fix some comments (#940)
Signed-off-by: cuishuang <imcusg@gmail.com> Co-authored-by: Alexey Alexandrov <aalexand@users.noreply.github.com>
1 parent e1f9c19 commit 337e5dd

File tree

11 files changed

+13
-13
lines changed

11 files changed

+13
-13
lines changed

internal/driver/driver_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ var autoCompleteTests = []struct {
10501050
{"t", "t"}, // many matches
10511051
{"top abc", "top abc"}, // no function name match
10521052
{"top mangledM", "top mangledMALLOC"}, // single function name match
1053-
{"top cmd cmd mangledM", "top cmd cmd mangledMALLOC"},
1053+
{"top cmd mangledM", "top cmd mangledMALLOC"},
10541054
{"top mangled", "top mangled"}, // many function name matches
10551055
{"cmd mangledM", "cmd mangledM"}, // invalid command
10561056
{"top mangledM cmd", "top mangledM cmd"}, // cursor misplaced

internal/driver/fetch_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ func TestHTTPSInsecure(t *testing.T) {
617617
defer os.RemoveAll(tempdir)
618618

619619
// pprof writes to $HOME/pprof by default which is not necessarily
620-
// writeable (e.g. on a Debian buildd) so set $HOME to something we
620+
// writeable (e.g. on a Debian build) so set $HOME to something we
621621
// know we can write to for the duration of the test.
622622
os.Setenv(homeEnv(), tempdir)
623623
defer os.Setenv(homeEnv(), saveHome)
@@ -690,7 +690,7 @@ func TestHTTPSWithServerCertFetch(t *testing.T) {
690690
defer os.RemoveAll(tempdir)
691691

692692
// pprof writes to $HOME/pprof by default which is not necessarily
693-
// writeable (e.g. on a Debian buildd) so set $HOME to something we
693+
// writeable (e.g. on a Debian build) so set $HOME to something we
694694
// know we can write to for the duration of the test.
695695
os.Setenv(homeEnv(), tempdir)
696696
defer os.Setenv(homeEnv(), saveHome)

internal/driver/html/stacks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ function stackViewer(stacks, nodes) {
579579
}
580580

581581
// percentText returns text that displays v in appropriate units alongside its
582-
// percentange.
582+
// percentage.
583583
function percentText(v) {
584584
function percent(v, total) {
585585
return Number(((100.0 * v) / total).toFixed(1)) + '%';

internal/elfexec/elfexec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func GetBase(fh *elf.FileHeader, loadSegment *elf.ProgHeader, stextOffset *uint6
230230
}
231231
if stextOffset == nil && start > 0 && start < 0x8000000000000000 {
232232
// A regular user-mode executable. Compute the base offset using same
233-
// arithmetics as in ET_DYN case below, see the explanation there.
233+
// arithmetic as in ET_DYN case below, see the explanation there.
234234
// Ideally, the condition would just be "stextOffset == nil" as that
235235
// represents the address of _stext symbol in the vmlinux image. Alas,
236236
// the caller may skip reading it from the binary (it's expensive to scan
@@ -313,7 +313,7 @@ func ProgramHeadersForMapping(phdrs []elf.ProgHeader, mapOff, mapSz uint64) []*e
313313
// value is dependent on the memory management unit of the CPU. The page
314314
// size is 4KB virtually on all the architectures that we care about, so we
315315
// define this metric as a constant. If we encounter architectures where
316-
// page sie is not 4KB, we must try to guess the page size on the system
316+
// page size is not 4KB, we must try to guess the page size on the system
317317
// where the profile was collected, possibly using the architecture
318318
// specified in the ELF file header.
319319
pageSize = 4096

internal/elfexec/elfexec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func TestFindProgHeaderForMapping(t *testing.T) {
146146
return
147147
}
148148

149-
// Variuos ELF program headers for unit tests.
149+
// Various ELF program headers for unit tests.
150150
tinyHeaders := []elf.ProgHeader{
151151
{Type: elf.PT_LOAD, Flags: elf.PF_R | elf.PF_X, Off: 0, Vaddr: 0, Paddr: 0, Filesz: 0xc80, Memsz: 0xc80, Align: 0x200000},
152152
{Type: elf.PT_LOAD, Flags: elf.PF_R | elf.PF_W, Off: 0xc80, Vaddr: 0x200c80, Paddr: 0x200c80, Filesz: 0x1f0, Memsz: 0x1f0, Align: 0x200000},

internal/measurement/measurement.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func (ut UnitType) findByAlias(alias string) *Unit {
206206
return nil
207207
}
208208

209-
// sniffUnit simpifies the input alias and returns the unit associated with the
209+
// sniffUnit simplifies the input alias and returns the unit associated with the
210210
// specified alias. It returns nil if the unit with such alias is not found.
211211
func (ut UnitType) sniffUnit(unit string) *Unit {
212212
unit = strings.ToLower(unit)

internal/report/report.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ func symbolsFromBinaries(prof *profile.Profile, g *graph.Graph, rx *regexp.Regex
569569
return objSyms
570570
}
571571

572-
// objSym represents a symbol identified from a binary. It includes
572+
// objSymbol represents a symbol identified from a binary. It includes
573573
// the SymbolInfo from the disasm package and the base that must be
574574
// added to correspond to sample addresses
575575
type objSymbol struct {

internal/report/source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ func (sp *sourcePrinter) addStack(addr uint64, frames []plugin.Frame) {
490490
file.lines[f.Line] = append(file.lines[f.Line], sourceInst{addr, stack})
491491

492492
// Remember the first function name encountered per source line
493-
// and assume that that line belongs to that function.
493+
// and assume that line belongs to that function.
494494
if _, ok := file.funcName[f.Line]; !ok {
495495
file.funcName[f.Line] = f.Func
496496
}

profile/legacy_profile_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func TestLegacyProfileType(t *testing.T) {
5959
}
6060

6161
func TestCpuParse(t *testing.T) {
62-
// profileString is a legacy encoded profile, represnted by words separated by ":"
62+
// profileString is a legacy encoded profile, represented by words separated by ":"
6363
// Each sample has the form value : N : stack1..stackN
6464
// EOF is represented as "0:1:0"
6565
profileString := "1:3:100:999:100:" // sample with bogus 999 and duplicate leaf

profile/profile_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func TestParseError(t *testing.T) {
119119

120120
func TestParseConcatentated(t *testing.T) {
121121
prof := testProfile1.Copy()
122-
// Write the profile twice to buffer to create concatented profile.
122+
// Write the profile twice to buffer to create concatenated profile.
123123
var buf bytes.Buffer
124124
prof.Write(&buf)
125125
prof.Write(&buf)

0 commit comments

Comments
 (0)