Skip to content

Refactoring the TRAP logParser#7263

Open
varghese-bibin wants to merge 3 commits intoSamsung:masterfrom
varghese-bibin:master
Open

Refactoring the TRAP logParser#7263
varghese-bibin wants to merge 3 commits intoSamsung:masterfrom
varghese-bibin:master

Conversation

@varghese-bibin
Copy link
Copy Markdown

Restructure log analysis into logAnalyser package with:

  • logPreprocessor.py: log formatting and binary discovery
  • logUtils.py: shared utility functions
  • log_parser/: specialized parsing modules (crashPoint, assertInfo, tcbInfo, heapNode)

#!/usr/bin/env python
###########################################################################
#
# Copyright 2024 Samsung Electronics All Rights Reserved.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2024 -> 2026

assertInfo.parse_assert_info(self)

# It displays the debug symbols corresponding to all the addresses in the kernel and application text address range
self.parse_call_stack()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason why parse_call_stack() and parse_heap_info are in Class, but parse_tcb_info and find_crash_point are outside this Class?

format_log_file(lparser.log_file)

# Get the number of application binaries, names, text address and sizes
find_number_of_binaries(lparser) No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a extra new line.

@seokhun-eom24
Copy link
Copy Markdown
Contributor

Could you also share the test result of this refactoring in commit message and PR message.

Comment on lines +26 to +28
stack_details = "Asserted task's stack details\n"

partition_string = "==========================================================="
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we manage the strings separately?
When we change some log format in assert, then we must modify here together.
But now, each file includes necessary string for each. It's much difficult to maintain.
I want a new file which has all necessary strings (which can be changed by assert) for TRAP.

@varghese-bibin
Copy link
Copy Markdown
Author

I will check and modify.

a. Separated the preprocessing functions from logParser.py and kept them in a separate preProcessor.py file
b. moved logParser.py and logPreprocesser.py to logAnalyser folder, to keep the similar types of file together
c. preProcessing includes format_log_file() and find_number_of_binaries()
d. instead of calling these function trap.py call preprocessLogFile
…s module

a. created cli/logAnalyser/logUtils.py
b. moved all the independent helper functions from logParser.py to it
c. format output, print crash type, is text addr, is app adrr, convert state no
a. split up the major/lengthy functions in logParser.py and kept them in separate files
b. parse assert info -> assertInfo.py
c. find crash point -> crashPoint.py
d. parse tcb info -> tcbinfo.py
e. cli/logAnalyser/log_parser : kept all these related files in this folder
f. also moved heapNode.py to this folder, as its only called from logParser.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants