Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
a1a10ade
Commit
a1a10ade
authored
Jul 04, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
48043365
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
go/xcommon/tracing/cmd/gotrace/gotrace.go
go/xcommon/tracing/cmd/gotrace/gotrace.go
+16
-6
No files found.
go/xcommon/tracing/cmd/gotrace/gotrace.go
View file @
a1a10ade
...
...
@@ -753,7 +753,11 @@ func tracegen1(P *Program, tpkg *Package, pkgdir string, kind string) error {
}
}
// TODO export hash
// emit export hash symbol
text
.
emit
(
"
\n
---- 8< ----"
)
fmt
.
Fprintf
(
text
,
"%s"
,
traceExport
(
tpkg
,
kind
))
text
.
emit
(
"---- 8< ----
\n
"
)
//text.emit("var xxx_export_%s bool", traceExportHash(tpkg, kind))
// code for trace:import imports
for
_
,
timport
:=
range
tpkg
.
Importv
{
...
...
@@ -836,10 +840,9 @@ func tracegen1(P *Program, tpkg *Package, pkgdir string, kind string) error {
return
nil
}
// traceExportHash computes signature of tracing-related exports of a package
func
traceExportHash
(
tpkg
*
Package
,
kind
string
)
string
{
// implementation: it is sha1 of associated header + importing code as
// if it was executed from universe scope
// traceExport returns signatures of all tracing-related exports of a package
// in canonical order as would be seen from universe scope
func
traceExport
(
tpkg
*
Package
,
kind
string
)
[]
byte
{
pkgpath
:=
tpkg
.
Pkgi
.
Pkg
.
Path
()
pkgname
:=
tpkg
.
Pkgi
.
Pkg
.
Name
()
...
...
@@ -859,7 +862,14 @@ func traceExportHash(tpkg *Package, kind string) string {
}
}
return
fmt
.
Sprintf
(
"%x"
,
sha1
.
Sum
(
exported
.
Bytes
()))
return
exported
.
Bytes
()
}
// traceExportHash computes signature of tracing-related exports of a package
// implementation note: it is sha1 of associated header + importing code as
// if it was executed from universe scope.
func
traceExportHash
(
tpkg
*
Package
,
kind
string
)
string
{
return
fmt
.
Sprintf
(
"%x"
,
sha1
.
Sum
(
traceExport
(
tpkg
,
kind
)))
}
...
...
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