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
bca096a5
Commit
bca096a5
authored
Jul 14, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b0acbea8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
4 deletions
+17
-4
go/neo/server/ztrace_test.go
go/neo/server/ztrace_test.go
+1
-1
go/xcommon/tracing/cmd/gotrace/gotrace.go
go/xcommon/tracing/cmd/gotrace/gotrace.go
+9
-1
go/xcommon/tracing/cmd/gotrace/testdata/src/c/pkg3/ztrace_test.go.ok
...tracing/cmd/gotrace/testdata/src/c/pkg3/ztrace_test.go.ok
+1
-1
go/xcommon/tracing/cmd/gotrace/testdata/src/c/pkg3/ztrace_x_test.go.ok
...acing/cmd/gotrace/testdata/src/c/pkg3/ztrace_x_test.go.ok
+1
-1
go/xcommon/tracing/cmd/gotrace/util.go
go/xcommon/tracing/cmd/gotrace/util.go
+5
-0
No files found.
go/neo/server/ztrace_test.go
View file @
bca096a5
...
...
@@ -5,7 +5,7 @@ package server
import
(
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"unsafe"
_
"unsafe"
"lab.nexedi.com/kirr/neo/go/neo"
)
...
...
go/xcommon/tracing/cmd/gotrace/gotrace.go
View file @
bca096a5
...
...
@@ -745,7 +745,6 @@ func tracegen1(P *Program, tpkg *Package, pkgdir string, kind string) error {
prologue
.
emit
(
"// code generated for tracepoints"
)
prologue
.
emit
(
"
\n
import ("
)
prologue
.
emit
(
"
\t
%q"
,
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
)
prologue
.
emit
(
"
\t
%q"
,
"unsafe"
)
// pkgpaths of all packages needed for used types
needPkg
:=
StrSet
{}
...
...
@@ -757,6 +756,7 @@ func tracegen1(P *Program, tpkg *Package, pkgdir string, kind string) error {
// code for trace:event definitions
for
_
,
event
:=
range
tpkg
.
Eventv
{
needPkg
.
Add
(
"unsafe"
)
// used in tr
needPkg
.
Add
(
event
.
NeedPkgv
()
...
)
err
=
traceEventCodeTmpl
.
Execute
(
text
,
event
)
if
err
!=
nil
{
...
...
@@ -826,6 +826,14 @@ func tracegen1(P *Program, tpkg *Package, pkgdir string, kind string) error {
}
// finish prologue with needed imports
if
!
needPkg
.
Has
(
"unsafe"
)
{
// we need it anyway because go:linkname is not allowed without unsafe
prologue
.
emit
(
"
\t
_ %q"
,
"unsafe"
)
}
else
{
prologue
.
emit
(
"
\t
%q"
,
"unsafe"
)
needPkg
.
Delete
(
"unsafe"
)
}
needPkg
.
Delete
(
tpkg
.
Pkgi
.
Pkg
.
Path
())
// our pkg - no need to import
needPkgv
:=
needPkg
.
Itemv
()
if
len
(
needPkgv
)
>
0
{
...
...
go/xcommon/tracing/cmd/gotrace/testdata/src/c/pkg3/ztrace_test.go.ok
View file @
bca096a5
...
...
@@ -5,7 +5,7 @@ package pkg3
import
(
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"unsafe"
_
"unsafe"
aaa1
"a/pkg1"
"net/url"
...
...
go/xcommon/tracing/cmd/gotrace/testdata/src/c/pkg3/ztrace_x_test.go.ok
View file @
bca096a5
...
...
@@ -5,7 +5,7 @@ package pkg3_test
import
(
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"unsafe"
_
"unsafe"
)
//
traceimport
:
"b/pkg2"
...
...
go/xcommon/tracing/cmd/gotrace/util.go
View file @
bca096a5
...
...
@@ -49,6 +49,11 @@ func (s StrSet) Delete(item string) {
delete
(
s
,
item
)
}
func
(
s
StrSet
)
Has
(
item
string
)
bool
{
_
,
has
:=
s
[
item
]
return
has
}
// Itemv returns ordered slice of set items
func
(
s
StrSet
)
Itemv
()
[]
string
{
itemv
:=
make
([]
string
,
0
,
len
(
s
))
...
...
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