Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-unixfs
Commits
1e847059
Commit
1e847059
authored
Oct 29, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style(cmd/ipfs/pprof) move defer close to initialization
parent
79866d33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
cmd/ipfs/Makefile
cmd/ipfs/Makefile
+8
-0
cmd/ipfs/ipfs.go
cmd/ipfs/ipfs.go
+3
-1
No files found.
cmd/ipfs/Makefile
View file @
1e847059
...
...
@@ -5,3 +5,11 @@ build:
install
:
build
go
install
# cpu profiling: `go tool pprof ipfs cpu.prof`
# mem profiling: `go tool pprof ipfs ipfs.mprof`
clean
:
rm
-f
cpu.prof
rm
-f
ipfs.mprof
rm
-f
ipfs
cmd/ipfs/ipfs.go
View file @
1e847059
...
...
@@ -99,12 +99,14 @@ func main() {
// if debugging, setup profiling.
if
u
.
Debug
{
ofi
,
err
:=
os
.
Create
(
"cpu.prof"
)
defer
ofi
.
Close
()
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
}
pprof
.
StartCPUProfile
(
ofi
)
defer
ofi
.
Close
()
defer
pprof
.
StopCPUProfile
()
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment