blob: 2d56cef98f7f946e1cef247c2cfd5e7c047a1b37 [file] [log] [blame]
/**
* Copyright © 2022 IBM Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "extensions/phal/create_pel.hpp"
#include <fmt/format.h>
#include <sdeventplus/utility/timer.hpp>
#include <chrono>
namespace openpower::phal::clock
{
/* Dbus event timer */
using Timer = sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic>;
/**
* @class Manager - Represents the clock daily management functions
*
*/
class Manager
{
public:
Manager() = delete;
Manager(const Manager&) = delete;
Manager(Manager&&) = delete;
Manager& operator=(const Manager&) = delete;
Manager& operator=(Manager&&) = delete;
~Manager() = default;
/**
* Constructor
* Starts the functions required to capture clock daily logger data.
*
* @param[in] event - sdeventplus event loop
*/
Manager(const sdeventplus::Event& event);
/**
* @brief Add a dbus timer
*/
void addTimer();
/**
* @brief Callback when a timer expires
*/
void timerExpired();
/**
* @brief utility function to create clock data log
*/
void createClockDataLog();
/**
* @brief Add processor specific CFAM data to daily logger.
*
* @param[in] proc - pdbg processor target
* @param[out] ffdcData - reference to clock data log
*/
void addCFAMData(struct pdbg_target* proc,
openpower::pel::FFDCData& clockDataLog);
private:
/* The sdeventplus even loop to use */
sdeventplus::Event _event;
/** @brief Timer used for LEDs lamp test period */
sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic> timer;
};
} // namespace openpower::phal::clock