Skip to content

Conversation

@BenReed161
Copy link
Collaborator

command added: log dump using MRPC FTDC command to collect the FTDC from the switch and dump to binary file.

cli/main.c Outdated
} cfg = {
.type = SWITCHTEC_LOG_RAM,
.out_fd = 0,
.format = LOG_FMT_BIN
Copy link
Collaborator

Choose a reason for hiding this comment

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

As we support parsing of the FTDC log, we should also support decoded TXT dump. Please refer to the 'log-dump' command, and see if adding FTDC there is appropriate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to review existing FTDC log dump output headers and see if this can be adapted to what is currently present in the code

Copy link
Collaborator

@lsgunth lsgunth left a comment

Choose a reason for hiding this comment

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

I had a couple very minor nits I had saw. Forgot to submit the review.

Other than that it looks good to me.

lib/switchtec.c Outdated
MRPC_FWLOGRD_FLASH,
fd, log_def_file, info);
case SWITCHTEC_LOG_FTDC:
return switchtec_log_to_ftdc_file(dev, MRPC_FWLOGRD_RAM, fd);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use log_d_to_file() would make more sense.

int switchtec_log_to_file(struct switchtec_dev *dev,
enum switchtec_log_type type, int fd, FILE *log_def_file,
struct switchtec_log_file_info *info);
int switchtec_log_to_ftdc_file(struct switchtec_dev *dev,
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems switchtec_log_to_file can do the same thing, is exposing this API necessary?

Adds new a new command option to call the FTDC MRPC
collect the data and output to a binary file format.
Uses existing log_dump command with -t to denote new FTDC log type.
@BenReed161 BenReed161 force-pushed the support-ftdc-log-dump-cmd branch from 3a64b1d to 5c696f1 Compare March 20, 2025 17:53
@kelvin-cao kelvin-cao merged commit 0365f85 into Microsemi:master Mar 20, 2025
5 checks passed
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