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
94e31a27
Commit
94e31a27
authored
Jul 29, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the fuse ID in debug logs.
It's too confusing with a distinct set of IDs for logging.
parent
c80811a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
14 deletions
+7
-14
connection.go
connection.go
+7
-14
No files found.
connection.go
View file @
94e31a27
...
...
@@ -67,9 +67,6 @@ type Connection struct {
// The context from which all op contexts inherit.
parentCtx
context
.
Context
// For logging purposes only.
nextOpID
uint32
mu
sync
.
Mutex
// A map from fuse "unique" request ID (*not* the op ID for logging used
...
...
@@ -89,7 +86,6 @@ type opState struct {
inMsg
*
buffer
.
InMessage
outMsg
*
buffer
.
OutMessage
op
interface
{}
opID
uint32
// For logging
}
// Create a connection wrapping the supplied file descriptor connected to the
...
...
@@ -171,7 +167,7 @@ func (c *Connection) Init() (err error) {
// Log information for an operation with the given ID. calldepth is the depth
// to use when recovering file:line information with runtime.Caller.
func
(
c
*
Connection
)
debugLog
(
opID
uint32
,
fuseID
uint64
,
calldepth
int
,
format
string
,
v
...
interface
{})
{
...
...
@@ -194,7 +190,7 @@ func (c *Connection) debugLog(
// Format the actual message to be printed.
msg
:=
fmt
.
Sprintf
(
"Op 0x%08x %24s] %v"
,
op
ID
,
fuse
ID
,
fileLine
,
fmt
.
Sprintf
(
format
,
v
...
))
...
...
@@ -387,10 +383,7 @@ func (c *Connection) ReadOp() (ctx context.Context, op interface{}, err error) {
}
// Choose an ID for this operation for the purposes of logging, and log it.
opID
:=
c
.
nextOpID
c
.
nextOpID
++
c
.
debugLog
(
opID
,
1
,
"<- %s"
,
describeRequest
(
op
))
c
.
debugLog
(
inMsg
.
Header
()
.
Unique
,
1
,
"<- %s"
,
describeRequest
(
op
))
// Special case: handle interrupt requests inline.
if
interruptOp
,
ok
:=
op
.
(
*
interruptOp
);
ok
{
...
...
@@ -400,7 +393,7 @@ func (c *Connection) ReadOp() (ctx context.Context, op interface{}, err error) {
// Set up a context that remembers information about this op.
ctx
=
c
.
beginOp
(
inMsg
.
Header
()
.
Opcode
,
inMsg
.
Header
()
.
Unique
)
ctx
=
context
.
WithValue
(
ctx
,
contextKey
,
opState
{
inMsg
,
outMsg
,
op
,
opID
})
ctx
=
context
.
WithValue
(
ctx
,
contextKey
,
opState
{
inMsg
,
outMsg
,
op
})
// Special case: responding to statfs is required to make mounting work on
// OS X. We don't currently expose the capability for the file system to
...
...
@@ -431,7 +424,7 @@ func (c *Connection) Reply(ctx context.Context, opErr error) {
op
:=
state
.
op
inMsg
:=
state
.
inMsg
outMsg
:=
state
.
outMsg
opID
:=
state
.
opID
fuseID
:=
inMsg
.
Header
()
.
Unique
// Make sure we destroy the messages when we're done.
defer
c
.
putInMessage
(
inMsg
)
...
...
@@ -443,9 +436,9 @@ func (c *Connection) Reply(ctx context.Context, opErr error) {
// Debug logging
if
c
.
debugLogger
!=
nil
{
if
opErr
==
nil
{
c
.
debugLog
(
op
ID
,
1
,
"-> OK: %s"
,
describeResponse
(
op
))
c
.
debugLog
(
fuse
ID
,
1
,
"-> OK: %s"
,
describeResponse
(
op
))
}
else
{
c
.
debugLog
(
op
ID
,
1
,
"-> error: %v"
,
opErr
)
c
.
debugLog
(
fuse
ID
,
1
,
"-> error: %v"
,
opErr
)
}
}
...
...
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