-
Notifications
You must be signed in to change notification settings - Fork 55
Add support for FTDC MRPC command log collection #340
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
Add support for FTDC MRPC command log collection #340
Conversation
cli/main.c
Outdated
| } cfg = { | ||
| .type = SWITCHTEC_LOG_RAM, | ||
| .out_fd = 0, | ||
| .format = LOG_FMT_BIN |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
lsgunth
left a comment
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
inc/switchtec/switchtec.h
Outdated
| 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, |
There was a problem hiding this comment.
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.
3a64b1d to
5c696f1
Compare
command added: log dump using MRPC FTDC command to collect the FTDC from the switch and dump to binary file.