Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jacobsa-fuse
Commits
2948c349
Commit
2948c349
authored
May 01, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a flag for per-PID tracing.
parent
cecf2277
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
fuseops/common_op.go
fuseops/common_op.go
+23
-0
No files found.
fuseops/common_op.go
View file @
2948c349
...
...
@@ -15,6 +15,7 @@
package
fuseops
import
(
"flag"
"reflect"
"strings"
"sync"
...
...
@@ -24,6 +25,13 @@ import (
"golang.org/x/net/context"
)
var
fPerPIDTracing
=
flag
.
Bool
(
"fuse.per_pid_tracing"
,
false
,
"Enable a hacky mode that uses reqtrace to group all ops from each "
+
"individual PID. Not a good idea to use in production; races, bugs, and "
+
"resource leaks likely lurk."
)
// A helper for embedding common behavior.
type
commonOp
struct
{
opType
string
...
...
@@ -52,12 +60,27 @@ func describeOpType(t reflect.Type) (desc string) {
return
}
func
(
o
*
commonOp
)
maybeTraceByPID
(
in
context
.
Context
)
(
out
context
.
Context
)
{
// Is there anything to do?
if
!*
fPerPIDTracing
{
out
=
in
return
}
// TODO(jacobsa): Do something interesting.
out
=
in
return
}
func
(
o
*
commonOp
)
init
(
ctx
context
.
Context
,
opType
reflect
.
Type
,
r
bazilfuse
.
Request
,
log
func
(
int
,
string
,
...
interface
{}),
opsInFlight
*
sync
.
WaitGroup
)
{
// Set up a context that reflects per-PID tracing if appropriate.
ctx
=
o
.
maybeTraceByPID
(
ctx
)
// Initialize basic fields.
o
.
opType
=
describeOpType
(
opType
)
o
.
r
=
r
...
...
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