Skip to content

Commit

Permalink
Improve docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
gcmoreira committed Jan 2, 2024
1 parent e4c4469 commit 02a389a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions volatility3/framework/plugins/linux/kmsg.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def run_all(
config: Core configuration
Yields:
kmsg records
The kmsg records. Same as run()
"""
vmlinux = context.modules[config["kernel"]]

Expand All @@ -102,7 +102,7 @@ def run_all(
)
kmsg_inst = subclass(context=context, config=config)
yield from kmsg_inst.run()
# So far, it allows only one implementation to be executed for each
# So far, it only allows a single implementation to be executed for each
# specific kernel.
break

Expand All @@ -111,7 +111,16 @@ def run_all(

@abstractmethod
def run(self) -> Iterator[Tuple[str, str, str, str, str]]:
"""Walks through the specific kernel implementation."""
"""Walks through the specific kernel implementation.
Returns:
tuple:
facility [str]: The log facility: kern, user, etc. see FACILITIES
level [str]: The log level: info, debug, etc. see LEVELS
timestamp [str]: The message timestamp. See nsec_to_sec_str()
caller [str]: The Caller ID: CPU(1) or Task(1234). See get_caller()
line [str]: The log message.
"""

@classmethod
@abstractmethod
Expand All @@ -121,7 +130,8 @@ def symtab_checks(cls, vmlinux: interfaces.context.ModuleInterface) -> bool:
The first class returning True will be instantiated and called via the
run() method.
:return: True is the kernel being analysed fulfill the class requirements.
Returns:
bool: True if the kernel being analysed fulfill the class requirements.
"""

def get_string(self, addr: int, length: int) -> str:
Expand Down

0 comments on commit 02a389a

Please sign in to comment.