• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eronnen / procmon-parser / 4254216091

pending completion
4254216091

Pull #23

github

GitHub
<a href="https://github.com/eronnen/procmon-parser/commit/<a class=hub.com/eronnen/procmon-parser/commit/8985c814dc8a073b02a5000850073c01e9c1e239">8985c814d<a href="https://github.com/eronnen/procmon-parser/commit/8985c814dc8a073b02a5000850073c01e9c1e239">">Merge </a><a class="double-link" href="https://github.com/eronnen/procmon-parser/commit/<a class="double-link" href="https://github.com/eronnen/procmon-parser/commit/161de347cbd088a0691944b2ddc1951967a4d8eb">161de347c</a>">161de347c</a><a href="https://github.com/eronnen/procmon-parser/commit/8985c814dc8a073b02a5000850073c01e9c1e239"> into 7f10903d2">7f10903d2</a>
Pull Request #23: [WIP] Symbolic stack traces

484 of 484 new or added lines in 8 files covered. (100.0%)

1509 of 2079 relevant lines covered (72.58%)

0.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.74
/procmon_parser/__init__.py
1
import sys
1✔
2

3
from six import PY2
1✔
4

5
from procmon_parser.configuration import *
1✔
6
from procmon_parser.configuration_format import load_configuration, loads_configuration, dump_configuration, \
1✔
7
    dumps_configuration
8
from procmon_parser.logs import *
1✔
9
from procmon_parser.stream_logs_format import PMLStreamReader
1✔
10

11
__all__ = [
1✔
12
    'ProcmonLogsReader', 'load_configuration', 'loads_configuration', 'dump_configuration', 'dumps_configuration',
13
    'Rule', 'Column', 'RuleAction', 'RuleRelation', 'PMLError'
14
]
15

16
if sys.platform == "win32" and sys.version_info >= (3, 5, 0):
1✔
17
    from procmon_parser.symbol_resolver.symbol_resolver import (
×
18
        SymbolResolver, StackTraceFrameInformation, StackTraceInformation, CBA)
19

20
    __all__.extend(['SymbolResolver', 'StackTraceFrameInformation', 'StackTraceInformation', 'CBA'])
×
21

22

23
class ProcmonLogsReader(object):
1✔
24
    """Reads procmon logs from a stream which in the PML format
1✔
25
    """
26

27
    def __init__(self, f, should_get_stacktrace=True, should_get_details=True):
1✔
28
        """Build a ProcmonLogsReader object from ``f`` (a `.read()``-supporting file-like object).
29
        :param f: ``read`` supporting file-like object
30
        :param should_get_stacktrace: True if the parser should parse the stack traces
31
        :param should_get_details: True if the parser should parse the Detail column information of the event.
32
        """
33
        self._struct_readear = PMLStreamReader(f, should_get_stacktrace, should_get_details)
1✔
34
        self._current_event_index = 0
1✔
35

36
    def __iter__(self):
1✔
37
        return self
1✔
38

39
    def __next__(self):
1✔
40
        if self._current_event_index >= self.__len__():
1✔
41
            raise StopIteration
1✔
42
        current_index = self._current_event_index
1✔
43
        self._current_event_index += 1
1✔
44
        return self[current_index]
1✔
45

46
    if PY2:
1✔
47
        next = __next__
×
48

49
    def __getitem__(self, index):
1✔
50
        return self._struct_readear[index]
1✔
51

52
    def __len__(self):
1✔
53
        return self._struct_readear.number_of_events
1✔
54

55
    @property
1✔
56
    def maximum_application_address(self):
1✔
57
        """Return the highest possible user land address.
58
        """
59
        return self._struct_readear.maximum_application_address
×
60

61
    def processes(self):
1✔
62
        """Return a list of all the known processes in the log file
63
        """
64
        return self._struct_readear.processes()
1✔
65

66
    def system_details(self):
1✔
67
        """Return the system details of the computer which captured the logs (like Tools -> System Details in Procmon)
68
        """
69
        return self._struct_readear.system_details()
1✔
70

71

72
def read_all_events_from_pml(file):
1✔
73
    """
74
    Helper function that reads all the events from a PML file.
75
    :param file: the path to the PML file or an open file object.
76
    :return: a list of Event objects from the file.
77
    """
78
    if not hasattr(file, 'read'):
×
79
        with open(file, "rb") as f:
×
80
            pml_reader = PMLStreamReader(f)
×
81
            return list(pml_reader)
×
82
    else:
83
        pml_reader = PMLStreamReader(file)
×
84
        return list(pml_reader)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc