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
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.
...
@@ -27,6 +27,17 @@ Must be used with pyruntraced.
from neo.lib.connection import Connection
from neo.lib.connection import Connection
import socket
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
# sk_addr converts socket address tuple for family to string
def sk_addr(addr, family):
def sk_addr(addr, family):
if family == socket.AF_INET:
if family == socket.AF_INET:
...
@@ -41,14 +52,3 @@ def sk_localaddr(sk):
...
@@ -41,14 +52,3 @@ def sk_localaddr(sk):
def sk_remoteaddr(sk):
def sk_remoteaddr(sk):
return sk_addr( sk.getpeername(), sk.family )
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(*).
...
@@ -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
Tracepoints and probes definitions are provided in separate files that are
passed as <trace>* command line arguments.
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
(*) fork could be supported by making every new process to reattach to the
driver via new file descriptor - e.g. connecting via socket.
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