Commit 547a6fa9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent bca096a5
......@@ -736,11 +736,9 @@ func (c *Conn) err(op string, e error) error {
// ---- exchange of messages ----
//trace:event traceConnRecv(c *Conn /*aaa*/, msg Msg)
//trace:event traceConnSend(c *Conn, msg Msg) // XXX -> traceConnSendPre ?
//XXX temp
//trace:import "lab.nexedi.com/kirr/neo/go/xcommon/xnet/pipenet"
//trace:event traceConnRecv(c *Conn, msg Msg)
//trace:event traceConnSendPre(c *Conn, msg Msg)
// XXX do we also need traceConnSend?
// Recv receives message
// it receives packet and decodes message from it
......@@ -775,7 +773,7 @@ func (c *Conn) Recv() (Msg, error) {
// Send sends message
// it encodes message into packet and sends it
func (c *Conn) Send(msg Msg) error {
traceConnSend(c, msg)
traceConnSendPre(c, msg)
l := msg.NEOMsgEncodedLen()
buf := PktBuf{make([]byte, PktHeadLen + l)} // TODO -> freelist
......
......@@ -14,7 +14,7 @@ import (
// 0. Address
func (_ *Address) NEOMsgCode() uint16 {
func (*Address) NEOMsgCode() uint16 {
return 0
}
......@@ -57,7 +57,7 @@ overflow:
// 1. NodeInfo
func (_ *NodeInfo) NEOMsgCode() uint16 {
func (*NodeInfo) NEOMsgCode() uint16 {
return 1
}
......@@ -108,7 +108,7 @@ overflow:
// 2. CellInfo
func (_ *CellInfo) NEOMsgCode() uint16 {
func (*CellInfo) NEOMsgCode() uint16 {
return 2
}
......@@ -135,7 +135,7 @@ overflow:
// 3. RowInfo
func (_ *RowInfo) NEOMsgCode() uint16 {
func (*RowInfo) NEOMsgCode() uint16 {
return 3
}
......@@ -187,7 +187,7 @@ overflow:
// 4. Error
func (_ *Error) NEOMsgCode() uint16 {
func (*Error) NEOMsgCode() uint16 {
return 4
}
......@@ -230,7 +230,7 @@ overflow:
// 5. Ping
func (_ *Ping) NEOMsgCode() uint16 {
func (*Ping) NEOMsgCode() uint16 {
return 5
}
......@@ -247,7 +247,7 @@ func (p *Ping) NEOMsgDecode(data []byte) (int, error) {
// 6. CloseClient
func (_ *CloseClient) NEOMsgCode() uint16 {
func (*CloseClient) NEOMsgCode() uint16 {
return 6
}
......@@ -264,7 +264,7 @@ func (p *CloseClient) NEOMsgDecode(data []byte) (int, error) {
// 7. RequestIdentification
func (_ *RequestIdentification) NEOMsgCode() uint16 {
func (*RequestIdentification) NEOMsgCode() uint16 {
return 7
}
......@@ -330,7 +330,7 @@ overflow:
// 8. AcceptIdentification
func (_ *AcceptIdentification) NEOMsgCode() uint16 {
func (*AcceptIdentification) NEOMsgCode() uint16 {
return 8
}
......@@ -363,7 +363,7 @@ overflow:
// 9. PrimaryMaster
func (_ *PrimaryMaster) NEOMsgCode() uint16 {
func (*PrimaryMaster) NEOMsgCode() uint16 {
return 9
}
......@@ -380,7 +380,7 @@ func (p *PrimaryMaster) NEOMsgDecode(data []byte) (int, error) {
// 10. AnswerPrimary
func (_ *AnswerPrimary) NEOMsgCode() uint16 {
func (*AnswerPrimary) NEOMsgCode() uint16 {
return 10
}
......@@ -405,7 +405,7 @@ overflow:
// 11. NotPrimaryMaster
func (_ *NotPrimaryMaster) NEOMsgCode() uint16 {
func (*NotPrimaryMaster) NEOMsgCode() uint16 {
return 11
}
......@@ -477,7 +477,7 @@ overflow:
// 12. Recovery
func (_ *Recovery) NEOMsgCode() uint16 {
func (*Recovery) NEOMsgCode() uint16 {
return 12
}
......@@ -494,7 +494,7 @@ func (p *Recovery) NEOMsgDecode(data []byte) (int, error) {
// 13. AnswerRecovery
func (_ *AnswerRecovery) NEOMsgCode() uint16 {
func (*AnswerRecovery) NEOMsgCode() uint16 {
return 13
}
......@@ -523,7 +523,7 @@ overflow:
// 14. LastIDs
func (_ *LastIDs) NEOMsgCode() uint16 {
func (*LastIDs) NEOMsgCode() uint16 {
return 14
}
......@@ -540,7 +540,7 @@ func (p *LastIDs) NEOMsgDecode(data []byte) (int, error) {
// 15. AnswerLastIDs
func (_ *AnswerLastIDs) NEOMsgCode() uint16 {
func (*AnswerLastIDs) NEOMsgCode() uint16 {
return 15
}
......@@ -567,7 +567,7 @@ overflow:
// 16. AskPartitionTable
func (_ *AskPartitionTable) NEOMsgCode() uint16 {
func (*AskPartitionTable) NEOMsgCode() uint16 {
return 16
}
......@@ -584,7 +584,7 @@ func (p *AskPartitionTable) NEOMsgDecode(data []byte) (int, error) {
// 17. AnswerPartitionTable
func (_ *AnswerPartitionTable) NEOMsgCode() uint16 {
func (*AnswerPartitionTable) NEOMsgCode() uint16 {
return 17
}
......@@ -664,7 +664,7 @@ overflow:
// 18. NotifyPartitionTable
func (_ *NotifyPartitionTable) NEOMsgCode() uint16 {
func (*NotifyPartitionTable) NEOMsgCode() uint16 {
return 18
}
......@@ -744,7 +744,7 @@ overflow:
// 19. NotifyPartitionChanges
func (_ *NotifyPartitionChanges) NEOMsgCode() uint16 {
func (*NotifyPartitionChanges) NEOMsgCode() uint16 {
return 19
}
......@@ -801,7 +801,7 @@ overflow:
// 20. StartOperation
func (_ *StartOperation) NEOMsgCode() uint16 {
func (*StartOperation) NEOMsgCode() uint16 {
return 20
}
......@@ -826,7 +826,7 @@ overflow:
// 21. StopOperation
func (_ *StopOperation) NEOMsgCode() uint16 {
func (*StopOperation) NEOMsgCode() uint16 {
return 21
}
......@@ -843,7 +843,7 @@ func (p *StopOperation) NEOMsgDecode(data []byte) (int, error) {
// 22. UnfinishedTransactions
func (_ *UnfinishedTransactions) NEOMsgCode() uint16 {
func (*UnfinishedTransactions) NEOMsgCode() uint16 {
return 22
}
......@@ -891,7 +891,7 @@ overflow:
// 23. AnswerUnfinishedTransactions
func (_ *AnswerUnfinishedTransactions) NEOMsgCode() uint16 {
func (*AnswerUnfinishedTransactions) NEOMsgCode() uint16 {
return 23
}
......@@ -941,7 +941,7 @@ overflow:
// 24. LockedTransactions
func (_ *LockedTransactions) NEOMsgCode() uint16 {
func (*LockedTransactions) NEOMsgCode() uint16 {
return 24
}
......@@ -958,7 +958,7 @@ func (p *LockedTransactions) NEOMsgDecode(data []byte) (int, error) {
// 25. AnswerLockedTransactions
func (_ *AnswerLockedTransactions) NEOMsgCode() uint16 {
func (*AnswerLockedTransactions) NEOMsgCode() uint16 {
return 25
}
......@@ -1012,7 +1012,7 @@ overflow:
// 26. FinalTID
func (_ *FinalTID) NEOMsgCode() uint16 {
func (*FinalTID) NEOMsgCode() uint16 {
return 26
}
......@@ -1037,7 +1037,7 @@ overflow:
// 27. AnswerFinalTID
func (_ *AnswerFinalTID) NEOMsgCode() uint16 {
func (*AnswerFinalTID) NEOMsgCode() uint16 {
return 27
}
......@@ -1062,7 +1062,7 @@ overflow:
// 28. ValidateTransaction
func (_ *ValidateTransaction) NEOMsgCode() uint16 {
func (*ValidateTransaction) NEOMsgCode() uint16 {
return 28
}
......@@ -1089,7 +1089,7 @@ overflow:
// 29. BeginTransaction
func (_ *BeginTransaction) NEOMsgCode() uint16 {
func (*BeginTransaction) NEOMsgCode() uint16 {
return 29
}
......@@ -1114,7 +1114,7 @@ overflow:
// 30. AnswerBeginTransaction
func (_ *AnswerBeginTransaction) NEOMsgCode() uint16 {
func (*AnswerBeginTransaction) NEOMsgCode() uint16 {
return 30
}
......@@ -1139,7 +1139,7 @@ overflow:
// 31. FailedVote
func (_ *FailedVote) NEOMsgCode() uint16 {
func (*FailedVote) NEOMsgCode() uint16 {
return 31
}
......@@ -1189,7 +1189,7 @@ overflow:
// 32. FinishTransaction
func (_ *FinishTransaction) NEOMsgCode() uint16 {
func (*FinishTransaction) NEOMsgCode() uint16 {
return 32
}
......@@ -1263,7 +1263,7 @@ overflow:
// 33. AnswerFinishTransaction
func (_ *AnswerFinishTransaction) NEOMsgCode() uint16 {
func (*AnswerFinishTransaction) NEOMsgCode() uint16 {
return 33
}
......@@ -1290,7 +1290,7 @@ overflow:
// 34. NotifyTransactionFinished
func (_ *NotifyTransactionFinished) NEOMsgCode() uint16 {
func (*NotifyTransactionFinished) NEOMsgCode() uint16 {
return 34
}
......@@ -1317,7 +1317,7 @@ overflow:
// 35. LockInformation
func (_ *LockInformation) NEOMsgCode() uint16 {
func (*LockInformation) NEOMsgCode() uint16 {
return 35
}
......@@ -1344,7 +1344,7 @@ overflow:
// 36. AnswerLockInformation
func (_ *AnswerLockInformation) NEOMsgCode() uint16 {
func (*AnswerLockInformation) NEOMsgCode() uint16 {
return 36
}
......@@ -1369,7 +1369,7 @@ overflow:
// 37. InvalidateObjects
func (_ *InvalidateObjects) NEOMsgCode() uint16 {
func (*InvalidateObjects) NEOMsgCode() uint16 {
return 37
}
......@@ -1419,7 +1419,7 @@ overflow:
// 38. UnlockInformation
func (_ *UnlockInformation) NEOMsgCode() uint16 {
func (*UnlockInformation) NEOMsgCode() uint16 {
return 38
}
......@@ -1444,7 +1444,7 @@ overflow:
// 39. GenerateOIDs
func (_ *GenerateOIDs) NEOMsgCode() uint16 {
func (*GenerateOIDs) NEOMsgCode() uint16 {
return 39
}
......@@ -1469,7 +1469,7 @@ overflow:
// 40. AnswerGenerateOIDs
func (_ *AnswerGenerateOIDs) NEOMsgCode() uint16 {
func (*AnswerGenerateOIDs) NEOMsgCode() uint16 {
return 40
}
......@@ -1517,7 +1517,7 @@ overflow:
// 41. Deadlock
func (_ *Deadlock) NEOMsgCode() uint16 {
func (*Deadlock) NEOMsgCode() uint16 {
return 41
}
......@@ -1544,7 +1544,7 @@ overflow:
// 42. RebaseTransaction
func (_ *RebaseTransaction) NEOMsgCode() uint16 {
func (*RebaseTransaction) NEOMsgCode() uint16 {
return 42
}
......@@ -1571,7 +1571,7 @@ overflow:
// 43. AnswerRebaseTransaction
func (_ *AnswerRebaseTransaction) NEOMsgCode() uint16 {
func (*AnswerRebaseTransaction) NEOMsgCode() uint16 {
return 43
}
......@@ -1619,7 +1619,7 @@ overflow:
// 44. RebaseObject
func (_ *RebaseObject) NEOMsgCode() uint16 {
func (*RebaseObject) NEOMsgCode() uint16 {
return 44
}
......@@ -1646,7 +1646,7 @@ overflow:
// 45. AnswerRebaseObject
func (_ *AnswerRebaseObject) NEOMsgCode() uint16 {
func (*AnswerRebaseObject) NEOMsgCode() uint16 {
return 45
}
......@@ -1696,7 +1696,7 @@ overflow:
// 46. StoreObject
func (_ *StoreObject) NEOMsgCode() uint16 {
func (*StoreObject) NEOMsgCode() uint16 {
return 46
}
......@@ -1750,7 +1750,7 @@ overflow:
// 47. AnswerStoreObject
func (_ *AnswerStoreObject) NEOMsgCode() uint16 {
func (*AnswerStoreObject) NEOMsgCode() uint16 {
return 47
}
......@@ -1775,7 +1775,7 @@ overflow:
// 48. AbortTransaction
func (_ *AbortTransaction) NEOMsgCode() uint16 {
func (*AbortTransaction) NEOMsgCode() uint16 {
return 48
}
......@@ -1825,7 +1825,7 @@ overflow:
// 49. StoreTransaction
func (_ *StoreTransaction) NEOMsgCode() uint16 {
func (*StoreTransaction) NEOMsgCode() uint16 {
return 49
}
......@@ -1926,7 +1926,7 @@ overflow:
// 50. VoteTransaction
func (_ *VoteTransaction) NEOMsgCode() uint16 {
func (*VoteTransaction) NEOMsgCode() uint16 {
return 50
}
......@@ -1951,7 +1951,7 @@ overflow:
// 51. GetObject
func (_ *GetObject) NEOMsgCode() uint16 {
func (*GetObject) NEOMsgCode() uint16 {
return 51
}
......@@ -1980,7 +1980,7 @@ overflow:
// 52. AnswerGetObject
func (_ *AnswerGetObject) NEOMsgCode() uint16 {
func (*AnswerGetObject) NEOMsgCode() uint16 {
return 52
}
......@@ -2034,7 +2034,7 @@ overflow:
// 53. TIDList
func (_ *TIDList) NEOMsgCode() uint16 {
func (*TIDList) NEOMsgCode() uint16 {
return 53
}
......@@ -2063,7 +2063,7 @@ overflow:
// 54. AnswerTIDList
func (_ *AnswerTIDList) NEOMsgCode() uint16 {
func (*AnswerTIDList) NEOMsgCode() uint16 {
return 54
}
......@@ -2111,7 +2111,7 @@ overflow:
// 55. TIDListFrom
func (_ *TIDListFrom) NEOMsgCode() uint16 {
func (*TIDListFrom) NEOMsgCode() uint16 {
return 55
}
......@@ -2142,7 +2142,7 @@ overflow:
// 56. AnswerTIDListFrom
func (_ *AnswerTIDListFrom) NEOMsgCode() uint16 {
func (*AnswerTIDListFrom) NEOMsgCode() uint16 {
return 56
}
......@@ -2190,7 +2190,7 @@ overflow:
// 57. TransactionInformation
func (_ *TransactionInformation) NEOMsgCode() uint16 {
func (*TransactionInformation) NEOMsgCode() uint16 {
return 57
}
......@@ -2215,7 +2215,7 @@ overflow:
// 58. AnswerTransactionInformation
func (_ *AnswerTransactionInformation) NEOMsgCode() uint16 {
func (*AnswerTransactionInformation) NEOMsgCode() uint16 {
return 58
}
......@@ -2318,7 +2318,7 @@ overflow:
// 59. ObjectHistory
func (_ *ObjectHistory) NEOMsgCode() uint16 {
func (*ObjectHistory) NEOMsgCode() uint16 {
return 59
}
......@@ -2347,7 +2347,7 @@ overflow:
// 60. AnswerObjectHistory
func (_ *AnswerObjectHistory) NEOMsgCode() uint16 {
func (*AnswerObjectHistory) NEOMsgCode() uint16 {
return 60
}
......@@ -2402,7 +2402,7 @@ overflow:
// 61. PartitionList
func (_ *PartitionList) NEOMsgCode() uint16 {
func (*PartitionList) NEOMsgCode() uint16 {
return 61
}
......@@ -2431,7 +2431,7 @@ overflow:
// 62. AnswerPartitionList
func (_ *AnswerPartitionList) NEOMsgCode() uint16 {
func (*AnswerPartitionList) NEOMsgCode() uint16 {
return 62
}
......@@ -2511,7 +2511,7 @@ overflow:
// 63. NodeList
func (_ *NodeList) NEOMsgCode() uint16 {
func (*NodeList) NEOMsgCode() uint16 {
return 63
}
......@@ -2536,7 +2536,7 @@ overflow:
// 64. AnswerNodeList
func (_ *AnswerNodeList) NEOMsgCode() uint16 {
func (*AnswerNodeList) NEOMsgCode() uint16 {
return 64
}
......@@ -2614,7 +2614,7 @@ overflow:
// 65. SetNodeState
func (_ *SetNodeState) NEOMsgCode() uint16 {
func (*SetNodeState) NEOMsgCode() uint16 {
return 65
}
......@@ -2641,7 +2641,7 @@ overflow:
// 66. AddPendingNodes
func (_ *AddPendingNodes) NEOMsgCode() uint16 {
func (*AddPendingNodes) NEOMsgCode() uint16 {
return 66
}
......@@ -2689,7 +2689,7 @@ overflow:
// 67. TweakPartitionTable
func (_ *TweakPartitionTable) NEOMsgCode() uint16 {
func (*TweakPartitionTable) NEOMsgCode() uint16 {
return 67
}
......@@ -2737,7 +2737,7 @@ overflow:
// 68. NotifyNodeInformation
func (_ *NotifyNodeInformation) NEOMsgCode() uint16 {
func (*NotifyNodeInformation) NEOMsgCode() uint16 {
return 68
}
......@@ -2817,7 +2817,7 @@ overflow:
// 69. NodeInformation
func (_ *NodeInformation) NEOMsgCode() uint16 {
func (*NodeInformation) NEOMsgCode() uint16 {
return 69
}
......@@ -2834,7 +2834,7 @@ func (p *NodeInformation) NEOMsgDecode(data []byte) (int, error) {
// 70. SetClusterState
func (_ *SetClusterState) NEOMsgCode() uint16 {
func (*SetClusterState) NEOMsgCode() uint16 {
return 70
}
......@@ -2859,7 +2859,7 @@ overflow:
// 71. repairFlags
func (_ *repairFlags) NEOMsgCode() uint16 {
func (*repairFlags) NEOMsgCode() uint16 {
return 71
}
......@@ -2884,7 +2884,7 @@ overflow:
// 72. Repair
func (_ *Repair) NEOMsgCode() uint16 {
func (*Repair) NEOMsgCode() uint16 {
return 72
}
......@@ -2934,7 +2934,7 @@ overflow:
// 73. RepairOne
func (_ *RepairOne) NEOMsgCode() uint16 {
func (*RepairOne) NEOMsgCode() uint16 {
return 73
}
......@@ -2959,7 +2959,7 @@ overflow:
// 74. NotifyClusterState
func (_ *NotifyClusterState) NEOMsgCode() uint16 {
func (*NotifyClusterState) NEOMsgCode() uint16 {
return 74
}
......@@ -2984,7 +2984,7 @@ overflow:
// 75. AskClusterState
func (_ *AskClusterState) NEOMsgCode() uint16 {
func (*AskClusterState) NEOMsgCode() uint16 {
return 75
}
......@@ -3001,7 +3001,7 @@ func (p *AskClusterState) NEOMsgDecode(data []byte) (int, error) {
// 76. AnswerClusterState
func (_ *AnswerClusterState) NEOMsgCode() uint16 {
func (*AnswerClusterState) NEOMsgCode() uint16 {
return 76
}
......@@ -3026,7 +3026,7 @@ overflow:
// 77. ObjectUndoSerial
func (_ *ObjectUndoSerial) NEOMsgCode() uint16 {
func (*ObjectUndoSerial) NEOMsgCode() uint16 {
return 77
}
......@@ -3080,7 +3080,7 @@ overflow:
// 78. AnswerObjectUndoSerial
func (_ *AnswerObjectUndoSerial) NEOMsgCode() uint16 {
func (*AnswerObjectUndoSerial) NEOMsgCode() uint16 {
return 78
}
......@@ -3148,7 +3148,7 @@ overflow:
// 79. CheckCurrentSerial
func (_ *CheckCurrentSerial) NEOMsgCode() uint16 {
func (*CheckCurrentSerial) NEOMsgCode() uint16 {
return 79
}
......@@ -3177,7 +3177,7 @@ overflow:
// 80. Pack
func (_ *Pack) NEOMsgCode() uint16 {
func (*Pack) NEOMsgCode() uint16 {
return 80
}
......@@ -3202,7 +3202,7 @@ overflow:
// 81. AnswerPack
func (_ *AnswerPack) NEOMsgCode() uint16 {
func (*AnswerPack) NEOMsgCode() uint16 {
return 81
}
......@@ -3227,7 +3227,7 @@ overflow:
// 82. CheckReplicas
func (_ *CheckReplicas) NEOMsgCode() uint16 {
func (*CheckReplicas) NEOMsgCode() uint16 {
return 82
}
......@@ -3285,7 +3285,7 @@ overflow:
// 83. CheckPartition
func (_ *CheckPartition) NEOMsgCode() uint16 {
func (*CheckPartition) NEOMsgCode() uint16 {
return 83
}
......@@ -3351,7 +3351,7 @@ overflow:
// 84. CheckTIDRange
func (_ *CheckTIDRange) NEOMsgCode() uint16 {
func (*CheckTIDRange) NEOMsgCode() uint16 {
return 84
}
......@@ -3382,7 +3382,7 @@ overflow:
// 85. AnswerCheckTIDRange
func (_ *AnswerCheckTIDRange) NEOMsgCode() uint16 {
func (*AnswerCheckTIDRange) NEOMsgCode() uint16 {
return 85
}
......@@ -3411,7 +3411,7 @@ overflow:
// 86. CheckSerialRange
func (_ *CheckSerialRange) NEOMsgCode() uint16 {
func (*CheckSerialRange) NEOMsgCode() uint16 {
return 86
}
......@@ -3444,7 +3444,7 @@ overflow:
// 87. AnswerCheckSerialRange
func (_ *AnswerCheckSerialRange) NEOMsgCode() uint16 {
func (*AnswerCheckSerialRange) NEOMsgCode() uint16 {
return 87
}
......@@ -3477,7 +3477,7 @@ overflow:
// 88. PartitionCorrupted
func (_ *PartitionCorrupted) NEOMsgCode() uint16 {
func (*PartitionCorrupted) NEOMsgCode() uint16 {
return 88
}
......@@ -3527,7 +3527,7 @@ overflow:
// 89. LastTransaction
func (_ *LastTransaction) NEOMsgCode() uint16 {
func (*LastTransaction) NEOMsgCode() uint16 {
return 89
}
......@@ -3544,7 +3544,7 @@ func (p *LastTransaction) NEOMsgDecode(data []byte) (int, error) {
// 90. AnswerLastTransaction
func (_ *AnswerLastTransaction) NEOMsgCode() uint16 {
func (*AnswerLastTransaction) NEOMsgCode() uint16 {
return 90
}
......@@ -3569,7 +3569,7 @@ overflow:
// 91. NotifyReady
func (_ *NotifyReady) NEOMsgCode() uint16 {
func (*NotifyReady) NEOMsgCode() uint16 {
return 91
}
......
......@@ -216,7 +216,7 @@ import (
case *ast.StructType:
fmt.Fprintf(&buf, "// %d. %s\n\n", msgCode, typename)
buf.emit("func (_ *%s) NEOMsgCode() uint16 {", typename)
buf.emit("func (*%s) NEOMsgCode() uint16 {", typename)
buf.emit("return %d", msgCode)
buf.emit("}\n")
......
......@@ -47,8 +47,6 @@ import (
"fmt"
)
var _ = fmt.Print
// XXX dup from connection_test
func xwait(w interface { Wait() error }) {
err := w.Wait()
......@@ -75,7 +73,11 @@ func (t *MyTracer) TraceNetTx(ev *xnet.TraceTx) {} // { t.Trace1(ev) }
type traceNeoRecv struct {conn *neo.Conn; msg neo.Msg}
func (t *MyTracer) traceNeoConnRecv(c *neo.Conn, msg neo.Msg) { t.Trace1(&traceNeoRecv{c, msg}) }
type traceNeoSend struct {conn *neo.Conn; msg neo.Msg}
type traceNeoSend struct {
Src, Dst net.Addr
ConnID uint32
Msg neo.Msg
}
func (t *MyTracer) traceNeoConnSend(c *neo.Conn, msg neo.Msg) { t.Trace1(&traceNeoSend{c, msg}) }
......@@ -140,7 +142,7 @@ func TestMasterStorage(t *testing.T) {
tracing.Lock()
neo_traceConnRecv_Attach(pg, tracer.traceNeoConnRecv)
neo_traceConnSend_Attach(pg, tracer.traceNeoConnSend)
neo_traceConnSendPre_Attach(pg, tracer.traceNeoConnSendPre)
tracing.Unlock()
......@@ -177,7 +179,7 @@ func TestMasterStorage(t *testing.T) {
Mctx, Mcancel := context.WithCancel(context.Background())
wg.Gox(func() {
err := M.Run(Mctx)
fmt.Println("err: ", err)
fmt.Println("M err: ", err)
_ = err // XXX
})
......@@ -193,6 +195,7 @@ func TestMasterStorage(t *testing.T) {
Sctx, Scancel := context.WithCancel(context.Background())
wg.Gox(func() {
err := S.Run(Sctx)
fmt.Println("S err: ", err)
_ = err // XXX
})
......@@ -206,15 +209,20 @@ func TestMasterStorage(t *testing.T) {
//)
_ = nettx
tc.Expect(
conntx("s:1", "m:1", 1, RequestIdentification{...})
// ... M adjust nodetab...
conntx("m:1", "s:1", 1, AcceptIdentification{...})
)
// XXX temp
//return
// M <- S .? RequestIdentification{...} + TODO test ID rejects
println("111")
tc.Expect(netlisten("s:0")) // XXX no -> temp only to get complate
println("222")
// XXX temp
return
// M.nodeTab <- Node(S) XXX order can be racy?
......
......@@ -6,9 +6,6 @@ package neo
import (
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"unsafe"
"lab.nexedi.com/kirr/neo/go/xcommon/xnet/pipenet"
"net"
)
// traceevent: traceConnRecv(c *Conn, msg Msg)
......@@ -38,55 +35,32 @@ func traceConnRecv_Attach(pg *tracing.ProbeGroup, probe func(c *Conn, msg Msg))
return &p.Probe
}
// traceevent: traceConnSend(c *Conn, msg Msg)
// traceevent: traceConnSendPre(c *Conn, msg Msg)
type _t_traceConnSend struct {
type _t_traceConnSendPre struct {
tracing.Probe
probefunc func(c *Conn, msg Msg)
}
var _traceConnSend *_t_traceConnSend
var _traceConnSendPre *_t_traceConnSendPre
func traceConnSend(c *Conn, msg Msg) {
if _traceConnSend != nil {
_traceConnSend_run(c, msg)
func traceConnSendPre(c *Conn, msg Msg) {
if _traceConnSendPre != nil {
_traceConnSendPre_run(c, msg)
}
}
func _traceConnSend_run(c *Conn, msg Msg) {
for p := _traceConnSend; p != nil; p = (*_t_traceConnSend)(unsafe.Pointer(p.Next())) {
func _traceConnSendPre_run(c *Conn, msg Msg) {
for p := _traceConnSendPre; p != nil; p = (*_t_traceConnSendPre)(unsafe.Pointer(p.Next())) {
p.probefunc(c, msg)
}
}
func traceConnSend_Attach(pg *tracing.ProbeGroup, probe func(c *Conn, msg Msg)) *tracing.Probe {
p := _t_traceConnSend{probefunc: probe}
tracing.AttachProbe(pg, (**tracing.Probe)(unsafe.Pointer(&_traceConnSend)), &p.Probe)
func traceConnSendPre_Attach(pg *tracing.ProbeGroup, probe func(c *Conn, msg Msg)) *tracing.Probe {
p := _t_traceConnSendPre{probefunc: probe}
tracing.AttachProbe(pg, (**tracing.Probe)(unsafe.Pointer(&_traceConnSendPre)), &p.Probe)
return &p.Probe
}
// trace export signature
func _trace_exporthash_bc56cd7a9caf82c14d9586243f763e65afb91ea0() {}
// traceimport: "lab.nexedi.com/kirr/neo/go/xcommon/xnet/pipenet"
// rerun "gotrace gen" if you see link failure ↓↓↓
//go:linkname pipenet_trace_exporthash lab.nexedi.com/kirr/neo/go/xcommon/xnet/pipenet._trace_exporthash_e77a134646e20f099af466ab3192282237d2e547
func pipenet_trace_exporthash()
func init() { pipenet_trace_exporthash() }
//go:linkname pipenet_traceAccept_Attach lab.nexedi.com/kirr/neo/go/xcommon/xnet/pipenet.traceAccept_Attach
func pipenet_traceAccept_Attach(*tracing.ProbeGroup, func(conn net.Conn)) *tracing.Probe
//go:linkname pipenet_traceDial_Attach lab.nexedi.com/kirr/neo/go/xcommon/xnet/pipenet.traceDial_Attach
func pipenet_traceDial_Attach(*tracing.ProbeGroup, func(addr string)) *tracing.Probe
//go:linkname pipenet_traceListen_Attach lab.nexedi.com/kirr/neo/go/xcommon/xnet/pipenet.traceListen_Attach
func pipenet_traceListen_Attach(*tracing.ProbeGroup, func(laddr string)) *tracing.Probe
//go:linkname pipenet_traceNew_Attach lab.nexedi.com/kirr/neo/go/xcommon/xnet/pipenet.traceNew_Attach
func pipenet_traceNew_Attach(*tracing.ProbeGroup, func(name string)) *tracing.Probe
//go:linkname pipenet_traceNewHost_Attach lab.nexedi.com/kirr/neo/go/xcommon/xnet/pipenet.traceNewHost_Attach
func pipenet_traceNewHost_Attach(*tracing.ProbeGroup, func(host *pipenet.Host)) *tracing.Probe
func _trace_exporthash_d2fa0ebb37c3e2bf54309859a1eeb0e831edd435() {}
// Code generated by lab.nexedi.com/kirr/go123/tracing/cmd/gotrace; DO NOT EDIT.
// empty .s so `go build` does not use -complete for go:linkname to work
......@@ -63,10 +63,9 @@ func (st *SyncTracer) Trace1(event interface{}) {
// Get1 receives message with 1 tracing event from a producer
// The consumer, after dealing with the message, must send back an ack.
func (st *SyncTracer) Get1() *SyncTraceMsg {
return <-st.tracech
//msg := <-st.tracech
//fmt.Printf("trace: get1: %T %v\n", msg.Event, msg.Event)
//return msg
msg := <-st.tracech
fmt.Printf("trace: get1: %T %v\n", msg.Event, msg.Event)
return msg
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment