blob: 8e22fa631fdc4302ee0653414e9554e89d891208 [file] [log] [blame]
Jayanth Othayoth15de8882022-02-17 05:41:19 -06001#!/bin/bash
2#
3# config: 2 20
4# @brief: Get the pldm flight recorder
5#
6
7. $DREPORT_INCLUDE/functions
8
9desc="pldm flight recorder"
10
11# collect data only if pldmd is enabled
12if [ -e "/usr/bin/pldmd" ]; then
Patrick Williams9d26e4f2022-12-08 06:46:44 -060013 command="rm -rf /tmp/pldm_flight_recorder; killall -s SIGUSR1 pldmd; \
Jayanth Othayoth15de8882022-02-17 05:41:19 -060014 sleep 5; cat /tmp/pldm_flight_recorder"
15
Patrick Williams9d26e4f2022-12-08 06:46:44 -060016 file_name="pldmflightrecorder.log"
Jayanth Othayoth15de8882022-02-17 05:41:19 -060017
Patrick Williams9d26e4f2022-12-08 06:46:44 -060018 add_cmd_output "$command" "$file_name" "$desc"
Jayanth Othayoth15de8882022-02-17 05:41:19 -060019
Patrick Williams9d26e4f2022-12-08 06:46:44 -060020 rm -rf /tmp/pldm_flight_recorder
Jayanth Othayoth15de8882022-02-17 05:41:19 -060021else
Patrick Williams9d26e4f2022-12-08 06:46:44 -060022 log_warning "skipping pldm flight recorder: pldmd is not enabled"
Jayanth Othayoth15de8882022-02-17 05:41:19 -060023fi