Documentation
¶
Index ¶
- func Init(maxTime int)
- func PostDefault()
- func PreSelect(def bool, channels ...PreObj)
- func PrintTrace()
- func RunAnalyzer()
- func SpawnPost(numRut uint32)
- func SpawnPre() uint32
- type Chan
- func (ch Chan[T]) Close()
- func (ch Chan[T]) GetChan() chan Message[T]
- func (ch Chan[T]) GetId() uint32
- func (ch Chan[T]) GetIdPre(receive bool) PreObj
- func (ch Chan[T]) Post(receive bool, message Message[T])
- func (ch Chan[T]) Receive() T
- func (ch Chan[T]) ReceiveOk() (T, bool)
- func (ch Chan[T]) Send(val T)
- type Message
- type Mutex
- type PreObj
- type RWMutex
- type TraceClose
- type TraceDefault
- type TraceElement
- type TraceLock
- type TracePost
- type TracePre
- type TracePreSelect
- type TraceSignal
- type TraceUnlock
- type TraceWait
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PreSelect ¶
Function to add before a select statement. @param def bool: true if the select has a default statement, false otherwise @param channels ...PreObj: list of PreObj to store the cases
func RunAnalyzer ¶
func RunAnalyzer()
Main function to run the analyzer. The running of the analyzer locks tracesLock for the total duration of its runtime, to prevent go-routines, that are still running when the main function terminated (and therefore would normally also be terminated) to alter the trace.
Types ¶
type Chan ¶
type Chan[T any] struct { // contains filtered or unexported fields }
Struct to implement a drop in replacement for a channel @field c chan Message[T]: channel to send a message @field id uint32: id for the channel @field capacity: max size of the channel
func NewChan ¶
Function to create a new channel object. This object can be used as a drop in replacement for a chan T. @param size int: size of the channel, 0 for un-buffered channel @return Chan[T]: channel object
func (Chan[T]) Close ¶
func (ch Chan[T]) Close()
Function as drop-in replacement for closing a channel.
func (Chan[T]) GetChan ¶
Getter for the chan field of a Chan object. @receiver *Chan[T] @return chan Message[T]: chan field of channel
func (Chan[T]) GetId ¶
Getter fir the id field of a Chan object @receiver *Chan[T] @return uint32: id of the Chan
func (Chan[T]) GetIdPre ¶
Function to create a PreObj object from a Chan used with select. @param receive bool: true, if the select case is a channel receive, false if it is a send @return PreObj: the created preObj object
func (Chan[T]) Post ¶
Function to add at the beginning of a select case body. ¶m receive bool: true, if the case was started with a receive false if with a send @param message Message[T]: message wich was send over the channel
func (Chan[T]) Receive ¶
func (ch Chan[T]) Receive() T
Function as drop-in replacement for <-ch.c. @receiver: *Chan[T] @return T: received value
type Message ¶
type Message[T any] struct { // contains filtered or unexported fields }
Struct for message to send by Chan object @field info T: actual message to send @field sender uint32: id of the sender @field senderTimestamp: timestamp when the message was send
func BuildMessage ¶
Funktion to create a message. This function is mainly used, when sending a message in a select statement @param info T: info to send @return Message[T]: message object wich can be send
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
Struct to implement a mutex. Is used as drop-in replacement for sync.Mutex @field mu *sync.Mutex: actual mutex to perform lock and unlock operations @field id uint32: id of the mutex
type PreObj ¶
type PreObj struct {
// contains filtered or unexported fields
}
Struct to save a Chan with id. Used to store channel cases in select. @field id uint32: id of the Chan @field chanCreation string: pos of the creation of the chan @field receive bool: true, if the select case is a channel receive, false if it is a send
type RWMutex ¶
type RWMutex struct {
// contains filtered or unexported fields
}
Struct to implement a rw-mutex. Is used as drop-in replacement for sync.RWMutex @field mu *sync.RWMutex: actual rw-mutex to perform lock and unlock operations @field id uint32: id of the mutex
func NewRWMutex ¶
func NewRWMutex() RWMutex
Function to create and initialize a new RWMutex @return RWMutex: new RWMutex object
func (*RWMutex) RUnlock ¶
func (m *RWMutex) RUnlock()
Function to r-unlock a RWMutex. @receiver *RWMutex
func (*RWMutex) TryLock ¶
Function to try-lock a Mutex. @receiver *RWMutex @return bool: true if lock was successful, false otherwise
type TraceClose ¶
type TraceClose struct {
// contains filtered or unexported fields
}
Struct for a close in the trace. @field postion string: string describing the position of the creation in code @field timestamp uint32: timestamp of the creation of the trace object @field chanId uint32: id of the Chan @field chanCreation string: pos of the creation of the chan
func (*TraceClose) GetTimestamp ¶
func (tc *TraceClose) GetTimestamp() uint32
Function to return the timestamp @return uint32: timestamp
func (*TraceClose) PrintElement ¶
func (tc *TraceClose) PrintElement()
Function to print the close trace element @receiver *TraceClose
type TraceDefault ¶
type TraceDefault struct {
// contains filtered or unexported fields
}
Struct for a default in the trace. @field postion string: string describing the position of the creation in code @field timestamp uint32: timestamp of the creation of the trace object
func (*TraceDefault) GetTimestamp ¶
func (td *TraceDefault) GetTimestamp() uint32
Function to return the timestamp @return uint32: timestamp
func (*TraceDefault) PrintElement ¶
func (td *TraceDefault) PrintElement()
Function to print the default trace element @receiver *TraceDefault
type TraceElement ¶
type TraceElement interface { GetTimestamp() uint32 PrintElement() }
Interface for a trace element. @signature PrintElement(): function to print the element
type TraceLock ¶
type TraceLock struct {
// contains filtered or unexported fields
}
Struct for a lock in the trace. @field postion string: string describing the position of the creation in code @field timestamp uint32: timestamp of the creation of the trace object @field lockId uint32: id of the Mutex @field mutexCreation string: position of the creation of the mutex @field try bool: true if it is a try-lock, false otherwise @field read bool: true if it is a r-lock, false otherwise @field suc bool: true if the operation was successful, false otherwise (only try)
func (*TraceLock) GetTimestamp ¶
Function to return the timestamp @return uint32: timestamp
func (*TraceLock) PrintElement ¶
func (tl *TraceLock) PrintElement()
Function to print the lock trace element @receiver *TraceLock
type TracePost ¶
type TracePost struct {
// contains filtered or unexported fields
}
Struct for a post in the trace. @field postion string: string describing the position of the creation in code @field timestamp uint32: timestamp of the creation of the trace object @field chanId uint32: id of the Chan @field chanCreation string: pos of the creation of the chan @field send bool: true if it is a preSend, false otherwise @field senderId: id of the sender of the message @field senderTimestamp: timestamp of the sender at send @field noComs: if send, number of send on the channel, if read number of read (after the post)
func (*TracePost) GetTimestamp ¶
Function to return the timestamp @return uint32: timestamp
func (*TracePost) PrintElement ¶
func (tp *TracePost) PrintElement()
Function to print the post trace element @receiver *TracePost
type TracePre ¶
type TracePre struct {
// contains filtered or unexported fields
}
Struct for a pre in the trace. @field postion string: string describing the position of the creation in code @field timestamp uint32: timestamp of the creation of the trace object @field chanId uint32: id of the Chan @field chanCreation string: pos of the creation of the chan @field send bool: true if it is a preSend, false otherwise
func (*TracePre) GetTimestamp ¶
Function to return the timestamp @return uint32: timestamp
func (*TracePre) PrintElement ¶
func (tp *TracePre) PrintElement()
Function to print the pre trace element @receiver *TracePre
type TracePreSelect ¶
type TracePreSelect struct {
// contains filtered or unexported fields
}
Struct for a preSelect in the trace. @field postion string: string describing the position of the creation in code @field timestamp uint32: timestamp of the creation of the trace object @field chanIds []PreObj: list of channels in cases @field def bool: true if the select has a default case, false otherwise
func (*TracePreSelect) GetTimestamp ¶
func (tps *TracePreSelect) GetTimestamp() uint32
Function to return the timestamp @return uint32: timestamp
func (*TracePreSelect) PrintElement ¶
func (tps *TracePreSelect) PrintElement()
Function to print the preSelect trace element @receiver *TracePreSelect
type TraceSignal ¶
type TraceSignal struct {
// contains filtered or unexported fields
}
Struct for a signal in the trace. @field postion string: string describing the position of the creation in code @field timestamp uint32: timestamp of the creation of the trace object @field routine uint32: id of the new routine
func (*TraceSignal) GetTimestamp ¶
func (ts *TraceSignal) GetTimestamp() uint32
Function to return the timestamp @return uint32: timestamp
func (*TraceSignal) PrintElement ¶
func (ts *TraceSignal) PrintElement()
Function to print the signal trace element @receiver *TraceSignal
type TraceUnlock ¶
type TraceUnlock struct {
// contains filtered or unexported fields
}
Struct for a unlock in the trace. @field postion string: string describing the position of the creation in code @field timestamp uint32: timestamp of the creation of the trace object @field lockId uint32: id of the Mutex @field mutexCreation string: position of the creation of the mutex
func (*TraceUnlock) GetTimestamp ¶
func (tu *TraceUnlock) GetTimestamp() uint32
Function to return the timestamp @return uint32: timestamp
func (*TraceUnlock) PrintElement ¶
func (tu *TraceUnlock) PrintElement()
Function to print the unlock trace element @receiver *TraceUnlock
type TraceWait ¶
type TraceWait struct {
// contains filtered or unexported fields
}
Struct for a wait in the trace. @field postion string: string describing the position of the creation in code @field timestamp uint32: timestamp of the creation of the trace object @field routine uint32: id of the routine
func (*TraceWait) GetTimestamp ¶
Function to return the timestamp @return uint32: timestamp
func (*TraceWait) PrintElement ¶
func (tw *TraceWait) PrintElement()
Function to print the wait trace element @receiver *TraceWait