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

[DO NOT MERGE] Add debug logs to write_eeprom #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tshalvi
Copy link
Owner

@tshalvi tshalvi commented Dec 17, 2024

Why I did it

To debug the 'err:-5' issue. Need to understand whether this error log appears as a result of a read eeprom operation (which in that case, can be ignored), or due to a write operation (needs to be handled).

Work item tracking
  • Microsoft ADO (number only):

How I did it

Added logs.

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@@ -528,12 +529,31 @@ def write_eeprom(self, offset, num_bytes, write_buffer):
Example:
mlxreg -d /dev/mst/mt52100_pciconf0 --reg_name MCIA --indexes slot_index=0,module=1,device_address=154,page_number=5,i2c_device_address=0x50,size=1,bank_number=0 --set dword[0]=0x01000000 -y
"""

logger.log_error(f'--- err:-5_debug --- Entered write_eeprom()')
Copy link

Choose a reason for hiding this comment

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

having LOG ERR add ERR message to LOG. You should change it to NOTICE\INFO

else:
stack_trace.append(f"{func_name}()")
execution_flow = " --> ".join(reversed(stack_trace))
logger.log_error(f'--- err:-5_debug --- Call Stack: {execution_flow}')
Copy link

Choose a reason for hiding this comment

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

having LOG ERR add ERR message to LOG. You should change it to NOTICE\INFO

if num_bytes != len(write_buffer):
logger.log_error("Error mismatch between buffer length and number of bytes to be written")
return False

while num_bytes > 0:
page_num, page, page_offset = self._get_page_and_page_offset(offset)
logger.log_error(f'--- err:-5_debug --- Attempt to write to: page={page}, offset={page_offset}')
Copy link

Choose a reason for hiding this comment

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

having LOG ERR add ERR message to LOG. You should change it to NOTICE\INFO

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.

2 participants