Commit eef047e0 authored by unknown's avatar unknown

final

parent e4e29e67
Pipeline #3349 failed with stage
in 28 seconds
......@@ -19,6 +19,7 @@ class HelgrindParser(GenericParser):
general_info = r'((?P<message>.*#(?P<thread>[\d])\n))'
concrete_traceback = r'(at|by).*:\s(?P<function>.*)\s\((?P<file>.*):(?P<lino>[\d]*)'
second_trace_message = r'((?P<second_message>Location.*\n.*))'
function = r'at\s(.*):\s(?P<function>(.*))\s\('
file = r'\s\((?P<file>.*:)'
......@@ -48,12 +49,18 @@ class HelgrindParser(GenericParser):
for report in final_iter:
general = re.search(self.general_info, report)
second = re.search(self.second_trace_message, report)
found_expression = re.finditer(self.concrete_traceback, report)
number_of_matches = len(re.findall(
self.concrete_traceback, report))
new_report, nested_level = self.init_backtrace(self.internal_structure.create_new_report(),
number_of_matches - 1)
message = general.group('message')
if not second:
message = general.group('message')
else:
message = second.group('second_message')
# message = general.group('message')
thread = general.group('thread')
for match, traceback in zip(found_expression, nested_level):
......
......@@ -9,7 +9,7 @@ services:
ports:
- "3001:3001"
volumes:
- data-volume:/backend/uploaded_files
# - data-volume:/backend/uploaded_files
- ./backend:/backend
environment:
- VERSION=${VERSION}
......@@ -27,5 +27,5 @@ services:
volumes:
- ./frontend:/frontend
- /frontend/node_modules
volumes:
data-volume:
\ No newline at end of file
#volumes:
# data-volume:
\ No newline at end of file
class BaseEvent:
def action(self, arg=True):
if not arg:
raise Exception('./')
\ No newline at end of file
from base_event import BaseEvent
class Event(BaseEvent):
def __init__(self, name):
self.name = name
def __str__(self):
return self.name
import random
from temp_data import TempData
from a import Arbitrar
from process import Process
from event import Event
def ValidTime():
return timeStart < timeEnd
def SimulationContinue():
calendar.sort(key=lambda x: x.atime, reverse=True)
return len(calendar) and ValidTime()
def Init():
global calendar, TimeStart, TimeEnd
calendar = [Process(4, 1, Event('event2')), Process(1, 1, Event('event1')), Process(10, 1, Event('event3'), False)]
calendar.sort(key=lambda x: x.atime, reverse=True)
if __name__ == '__main__':
Init()
timeStart = 1
timeEnd = 16
print('Start of simulation')
while SimulationContinue():
element = calendar.pop()
if element.atime > timeEnd:
break
timeStart += element.atime
element.Behavior()
print('End of Simulation')
#
a = Arbitrar()
import importlib
import pkgutil
class Process:
def __init__(self, atime, priority, event, f=True):
self.atime = atime
self._priority = priority
self._event = event
self.f = f
def __next__(self):
pass
def Behavior(self):
print('Process ', self._event, ' Behavior at time ', self.atime, ' ------> ', self._event.action(self.f))
def LoadModules(self, package):
modules = []
try:
for (_, name, _) in pkgutil.iter_modules([package]):
module = '.' + name, package
modules.append(module)
importlib.import_module('.' + name, package)
except TypeError as e:
print(e) # handle exception
return modules
Traceback (most recent call last):
File "C:/Users/Jakub/Documents/test/main.py", line 38, in <module> element.Behavior()
File "C:/Users/Jakub/Documents/test/process.py", line 17, in Behavior
print('Process ', self._event, ' Behavior at time ', self.atime, ' ------> ', self._event.action(self.f))
File "C:/Users/Jakub/Documents/test/base_event.py", line 7, in action
raise Exception('./')
Exception: ./
\ No newline at end of file
class TempData:
__temp_list = list()
def __init__(self, temperature=None):
""" Initialize object"""
if temperature is not None:
self.__temperature = temperature
self.__temp_list.append(temperature)
@property
def temperature(self):
"""Return actual temperature"""
return self.__temperature
@temperature.setter
def temperature(self, temp):
"""Set actual temperature"""
if temp < -273:
raise ValueError('Invalid temperature')
self.__temperature = temp
self.__temp_list.append(temp)
def __iter__(self):
"""Return iterator"""
self.__n = 0
return self
def __next__(self):
"""Return next element in iterator object"""
try:
return self.__temp_list[self.__n]
except IndexError:
raise StopIteration
finally:
self.__n += 1
[
{
"meaning": "main",
"file": "simple_race.c",
"line": "13",
"meaning": "main",
"message": "Possible data race during read of size 4 at 0x601038 by thread #1\n",
"thread": "1"
},
{
"backtrace": {
"meaning": "mythread_wrapper",
"file": "hg_intercepts.c",
"line": "194",
"meaning": "mythread_wrapper",
"message": "This conflicts with a previous write of size 4 by thread #2\n",
"message": "Location 0x601038 is 0 bytes inside global var \"var\"\ndeclared at simple_race.c:3",
"thread": "2"
},
"meaning": "child_fn",
"file": "simple_race.c",
"line": "6",
"meaning": "child_fn",
"message": "This conflicts with a previous write of size 4 by thread #2\n",
"message": "Location 0x601038 is 0 bytes inside global var \"var\"\ndeclared at simple_race.c:3",
"thread": "2"
}
]
\ No newline at end of file
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