Jayanth Othayoth | 15de888 | 2022-02-17 05:41:19 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # config: 2 20 |
| 4 | # @brief: Get the pldm flight recorder |
| 5 | # |
| 6 | |
| 7 | . $DREPORT_INCLUDE/functions |
| 8 | |
| 9 | desc="pldm flight recorder" |
| 10 | |
| 11 | # collect data only if pldmd is enabled |
| 12 | if [ -e "/usr/bin/pldmd" ]; then |
Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 13 | command="rm -rf /tmp/pldm_flight_recorder; killall -s SIGUSR1 pldmd; \ |
Jayanth Othayoth | 15de888 | 2022-02-17 05:41:19 -0600 | [diff] [blame] | 14 | sleep 5; cat /tmp/pldm_flight_recorder" |
| 15 | |
Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 16 | file_name="pldmflightrecorder.log" |
Jayanth Othayoth | 15de888 | 2022-02-17 05:41:19 -0600 | [diff] [blame] | 17 | |
Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 18 | add_cmd_output "$command" "$file_name" "$desc" |
Jayanth Othayoth | 15de888 | 2022-02-17 05:41:19 -0600 | [diff] [blame] | 19 | |
Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 20 | rm -rf /tmp/pldm_flight_recorder |
Jayanth Othayoth | 15de888 | 2022-02-17 05:41:19 -0600 | [diff] [blame] | 21 | else |
Patrick Williams | 9d26e4f | 2022-12-08 06:46:44 -0600 | [diff] [blame] | 22 | log_warning "skipping pldm flight recorder: pldmd is not enabled" |
Jayanth Othayoth | 15de888 | 2022-02-17 05:41:19 -0600 | [diff] [blame] | 23 | fi |