Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: Fix kmsg f-strings #1502

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions volatility3/framework/plugins/linux/kmsg.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def nsec_to_sec_str(self, nsec: int) -> str:
# This might seem insignificant but it could cause some issues
# when compared with userland tool results or when used in
# timelines.
return f"{nsec / 1000000000:lu}.{(nsec % 1000000000) / 1000:06lu}"
return f"{nsec / 1000000000}.{(nsec % 1000000000) / 1000:06}"

def get_timestamp_in_sec_str(self, obj) -> str:
# obj could be log, printk_log or printk_info
Expand All @@ -166,7 +166,7 @@ def get_caller(self, obj):

def get_caller_text(self, caller_id):
caller_name = "CPU" if caller_id & 0x80000000 else "Task"
caller = f"{caller_name}({caller_id & ~0x80000000:u})"
caller = f"{caller_name}({caller_id & ~0x80000000})"
return caller

def get_prefix(self, obj) -> Tuple[int, int, str, str]:
Expand Down
Loading