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
803ca3cd
Commit
803ca3cd
authored
Apr 20, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
29017aa3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
go/neo/py/neo.pytrace
go/neo/py/neo.pytrace
+11
-11
go/neo/py/pyruntraced
go/neo/py/pyruntraced
+2
-0
No files found.
go/neo/py/neo.pytrace
View file @
803ca3cd
...
...
@@ -27,6 +27,17 @@ Must be used with pyruntraced.
from neo.lib.connection import Connection
import socket
@trace_entry(Connection._addPacket, 'MsgSendPre')
def _(self, packet):
sk = self.connector.socket
pkth, data = packet.encode()
return {'src': sk_localaddr(sk),
'dst': sk_remoteaddr(sk),
# XXX pkt goes as quoted to avoid UTF-8 decode problem on json.dump
'pktq': `pkth+data`}
#'pktq': (pkth+data).encode('hex')}
# sk_addr converts socket address tuple for family to string
def sk_addr(addr, family):
if family == socket.AF_INET:
...
...
@@ -41,14 +52,3 @@ def sk_localaddr(sk):
def sk_remoteaddr(sk):
return sk_addr( sk.getpeername(), sk.family )
@trace_entry(Connection._addPacket, 'MsgSendPre')
def _(self, packet):
sk = self.connector.socket
pkth, data = packet.encode()
return {'src': sk_localaddr(sk),
'dst': sk_remoteaddr(sk),
# XXX pkt goes as quoted to avoid UTF-8 decode problem on json.dump
'pktq': `pkth+data`}
#'pktq': (pkth+data).encode('hex')}
go/neo/py/pyruntraced
View file @
803ca3cd
...
...
@@ -61,6 +61,8 @@ Fork is not allowed in order not to confuse the driver(*).
Tracepoints and probes definitions are provided in separate files that are
passed as <trace>* command line arguments.
See trace_entry() for documentation on how to define probes.
(*) fork could be supported by making every new process to reattach to the
driver via new file descriptor - e.g. connecting via socket.
...
...
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