Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
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
...
@@ -5,7 +5,7 @@ package server
import
(
import
(
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"unsafe"
_
"unsafe"
"lab.nexedi.com/kirr/neo/go/neo"
"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 {
...
@@ -745,7 +745,6 @@ func tracegen1(P *Program, tpkg *Package, pkgdir string, kind string) error {
prologue
.
emit
(
"// code generated for tracepoints"
)
prologue
.
emit
(
"// code generated for tracepoints"
)
prologue
.
emit
(
"
\n
import ("
)
prologue
.
emit
(
"
\n
import ("
)
prologue
.
emit
(
"
\t
%q"
,
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
)
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
// pkgpaths of all packages needed for used types
needPkg
:=
StrSet
{}
needPkg
:=
StrSet
{}
...
@@ -757,6 +756,7 @@ func tracegen1(P *Program, tpkg *Package, pkgdir string, kind string) error {
...
@@ -757,6 +756,7 @@ func tracegen1(P *Program, tpkg *Package, pkgdir string, kind string) error {
// code for trace:event definitions
// code for trace:event definitions
for
_
,
event
:=
range
tpkg
.
Eventv
{
for
_
,
event
:=
range
tpkg
.
Eventv
{
needPkg
.
Add
(
"unsafe"
)
// used in tr
needPkg
.
Add
(
event
.
NeedPkgv
()
...
)
needPkg
.
Add
(
event
.
NeedPkgv
()
...
)
err
=
traceEventCodeTmpl
.
Execute
(
text
,
event
)
err
=
traceEventCodeTmpl
.
Execute
(
text
,
event
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -826,6 +826,14 @@ func tracegen1(P *Program, tpkg *Package, pkgdir string, kind string) error {
...
@@ -826,6 +826,14 @@ func tracegen1(P *Program, tpkg *Package, pkgdir string, kind string) error {
}
}
// finish prologue with needed imports
// 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
needPkg
.
Delete
(
tpkg
.
Pkgi
.
Pkg
.
Path
())
// our pkg - no need to import
needPkgv
:=
needPkg
.
Itemv
()
needPkgv
:=
needPkg
.
Itemv
()
if
len
(
needPkgv
)
>
0
{
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
...
@@ -5,7 +5,7 @@ package pkg3
import
(
import
(
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"unsafe"
_
"unsafe"
aaa1
"a/pkg1"
aaa1
"a/pkg1"
"net/url"
"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
...
@@ -5,7 +5,7 @@ package pkg3_test
import
(
import
(
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"unsafe"
_
"unsafe"
)
)
//
traceimport
:
"b/pkg2"
//
traceimport
:
"b/pkg2"
...
...
go/xcommon/tracing/cmd/gotrace/util.go
View file @
bca096a5
...
@@ -49,6 +49,11 @@ func (s StrSet) Delete(item string) {
...
@@ -49,6 +49,11 @@ func (s StrSet) Delete(item string) {
delete
(
s
,
item
)
delete
(
s
,
item
)
}
}
func
(
s
StrSet
)
Has
(
item
string
)
bool
{
_
,
has
:=
s
[
item
]
return
has
}
// Itemv returns ordered slice of set items
// Itemv returns ordered slice of set items
func
(
s
StrSet
)
Itemv
()
[]
string
{
func
(
s
StrSet
)
Itemv
()
[]
string
{
itemv
:=
make
([]
string
,
0
,
len
(
s
))
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