blob: 22b5630339e29172190e69f7394c534708847511 [file] [log] [blame]
Matthew Bartha227a162020-08-05 10:51:45 -05001/**
2 * Copyright © 2020 IBM Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
Matthew Barthd9cb63b2021-03-24 14:36:49 -050018#include "action.hpp"
Matthew Barth44ab7692021-03-26 11:40:10 -050019#include "config_base.hpp"
20#include "event.hpp"
Matthew Barthd9cb63b2021-03-24 14:36:49 -050021#include "group.hpp"
Matthew Barthacd737c2021-03-04 11:04:01 -060022#include "json_config.hpp"
Matthew Barth48f44da2021-05-27 15:43:34 -050023#include "power_state.hpp"
Matthew Barth06764942021-03-04 09:28:40 -060024#include "profile.hpp"
Matthew Barth9403a212021-05-17 09:31:50 -050025#include "sdbusplus.hpp"
Matthew Barthacd737c2021-03-04 11:04:01 -060026#include "zone.hpp"
Matthew Barth06764942021-03-04 09:28:40 -060027
Matthew Barth68ac0042021-06-01 15:38:36 -050028#include <fmt/format.h>
29
Matthew Bartha227a162020-08-05 10:51:45 -050030#include <nlohmann/json.hpp>
Matthew Barth68ac0042021-06-01 15:38:36 -050031#include <phosphor-logging/log.hpp>
Matthew Bartha227a162020-08-05 10:51:45 -050032#include <sdbusplus/bus.hpp>
Matthew Barth1542fb52021-06-10 14:09:09 -050033#include <sdbusplus/server/manager.hpp>
Matthew Barth06764942021-03-04 09:28:40 -060034#include <sdeventplus/event.hpp>
Matt Spinler2fc0a352021-10-04 15:10:57 -050035#include <sdeventplus/source/event.hpp>
Matthew Barthd9cb63b2021-03-24 14:36:49 -050036#include <sdeventplus/utility/timer.hpp>
37
38#include <chrono>
39#include <map>
40#include <memory>
41#include <optional>
42#include <tuple>
43#include <utility>
44#include <vector>
Matthew Bartha227a162020-08-05 10:51:45 -050045
46namespace phosphor::fan::control::json
47{
48
49using json = nlohmann::json;
Matthew Barth68ac0042021-06-01 15:38:36 -050050using namespace phosphor::logging;
Matthew Bartha227a162020-08-05 10:51:45 -050051
Matthew Barthacd737c2021-03-04 11:04:01 -060052/* Application name to be appended to the path for loading a JSON config file */
53constexpr auto confAppName = "control";
54
Matthew Barthd9cb63b2021-03-24 14:36:49 -050055/* Type of timers supported */
56enum class TimerType
57{
58 oneshot,
59 repeating,
60};
61/**
62 * Package of data required when a timer expires
63 * Tuple constructed of:
64 * std::string = Timer package unique identifier
Matthew Barthd9cb63b2021-03-24 14:36:49 -050065 * std::vector<std::unique_ptr<ActionBase>> = List of pointers to actions
66 * that run when the timer expires
67 */
Matthew Barth00f6aa02021-04-09 10:49:47 -050068using TimerPkg =
69 std::tuple<std::string, std::vector<std::unique_ptr<ActionBase>>&>;
Matthew Barthd9cb63b2021-03-24 14:36:49 -050070/**
71 * Data associated with a running timer that's used when it expires
72 * Pair constructed of:
73 * TimerType = Type of timer to manage expired timer instances
74 * TimerPkg = Package of data required when the timer expires
75 */
76using TimerData = std::pair<TimerType, TimerPkg>;
77/* Dbus event timer */
78using Timer = sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic>;
79
Matthew Barthebabc042021-05-13 15:38:58 -050080/* Dbus signal object */
81constexpr auto Path = 0;
82constexpr auto Intf = 1;
83constexpr auto Prop = 2;
84using SignalObject = std::tuple<std::string, std::string, std::string>;
85/* Dbus signal actions */
Matthew Barth039f91e2021-10-04 15:18:07 -050086using SignalActions = std::vector<std::unique_ptr<ActionBase>>&;
Matthew Barthebabc042021-05-13 15:38:58 -050087/**
88 * Signal handler function that handles parsing a signal's message for a
89 * particular signal object and stores the results in the manager
90 */
91using SignalHandler = std::function<bool(sdbusplus::message::message&,
92 const SignalObject&, Manager&)>;
93/**
94 * Package of data required when a signal is received
95 * Tuple constructed of:
96 * SignalHandler = Signal handler function
97 * SignalObject = Dbus signal object
98 * SignalActions = List of actions that are run when the signal is received
99 */
100using SignalPkg = std::tuple<SignalHandler, SignalObject, SignalActions>;
101/**
102 * Data associated to a subscribed signal
103 * Tuple constructed of:
Matthew Barthfac8a2f2021-06-10 15:50:36 -0500104 * std::vector<SignalPkg> = List of the signal's packages
Matthew Barthebabc042021-05-13 15:38:58 -0500105 * std::unique_ptr<sdbusplus::server::match::match> =
106 * Pointer to match holding the subscription to a signal
107 */
Matthew Barthfac8a2f2021-06-10 15:50:36 -0500108using SignalData = std::tuple<std::vector<SignalPkg>,
Matthew Barthebabc042021-05-13 15:38:58 -0500109 std::unique_ptr<sdbusplus::server::match::match>>;
110
Matthew Bartha227a162020-08-05 10:51:45 -0500111/**
112 * @class Manager - Represents the fan control manager's configuration
113 *
114 * A fan control manager configuration is optional, therefore the "manager.json"
115 * file is also optional. The manager configuration is used to populate
116 * fan control's manager parameters which are used in how the application
117 * operates, not in how the fans are controlled.
118 *
119 * When no manager configuration exists, the fan control application starts,
120 * processes any configured events and then begins controlling fans according
121 * to those events.
122 */
123class Manager
124{
125 public:
126 Manager() = delete;
127 Manager(const Manager&) = delete;
128 Manager(Manager&&) = delete;
129 Manager& operator=(const Manager&) = delete;
130 Manager& operator=(Manager&&) = delete;
131 ~Manager() = default;
132
133 /**
134 * Constructor
135 * Parses and populates the fan control manager attributes from a json file
136 *
Matthew Barth06764942021-03-04 09:28:40 -0600137 * @param[in] event - sdeventplus event loop
Matthew Bartha227a162020-08-05 10:51:45 -0500138 */
Matthew Barth9403a212021-05-17 09:31:50 -0500139 Manager(const sdeventplus::Event& event);
Matthew Bartha227a162020-08-05 10:51:45 -0500140
141 /**
Matthew Barthe91ac862021-05-25 16:22:17 -0500142 * @brief Callback function to handle receiving a HUP signal to reload the
143 * JSON configurations.
144 */
145 void sighupHandler(sdeventplus::source::Signal&,
146 const struct signalfd_siginfo*);
147
148 /**
Matt Spinler2fc0a352021-10-04 15:10:57 -0500149 * @brief Callback function to handle receiving a USR1 signal to dump
150 * the flight recorder.
151 */
152 void sigUsr1Handler(sdeventplus::source::Signal&,
153 const struct signalfd_siginfo*);
154
155 /**
Matthew Barthacd737c2021-03-04 11:04:01 -0600156 * @brief Get the active profiles of the system where an empty list
157 * represents that only configuration entries without a profile defined will
158 * be loaded.
159 *
160 * @return - The list of active profiles
161 */
162 static const std::vector<std::string>& getActiveProfiles();
163
164 /**
165 * @brief Load the configuration of a given JSON class object based on the
166 * active profiles
167 *
Matthew Barthacd737c2021-03-04 11:04:01 -0600168 * @param[in] isOptional - JSON configuration file is optional or not
Matthew Barth603ef162021-03-24 15:34:53 -0500169 * @param[in] args - Arguments to be forwarded to each instance of `T`
Matthew Barthe6d1f782021-05-14 12:52:20 -0500170 * (*Note that a sdbusplus bus object is required as the first argument)
Matthew Barthacd737c2021-03-04 11:04:01 -0600171 *
172 * @return Map of configuration entries
173 * Map of configuration keys to their corresponding configuration object
174 */
Matthew Barth603ef162021-03-24 15:34:53 -0500175 template <typename T, typename... Args>
Matthew Barthe6d1f782021-05-14 12:52:20 -0500176 static std::map<configKey, std::unique_ptr<T>> getConfig(bool isOptional,
177 Args&&... args)
Matthew Barthacd737c2021-03-04 11:04:01 -0600178 {
179 std::map<configKey, std::unique_ptr<T>> config;
180
Matthew Barth9403a212021-05-17 09:31:50 -0500181 auto confFile =
182 fan::JsonConfig::getConfFile(util::SDBusPlus::getBus(), confAppName,
183 T::confFileName, isOptional);
Matthew Barthacd737c2021-03-04 11:04:01 -0600184 if (!confFile.empty())
185 {
186 for (const auto& entry : fan::JsonConfig::load(confFile))
187 {
188 if (entry.contains("profiles"))
189 {
190 std::vector<std::string> profiles;
191 for (const auto& profile : entry["profiles"])
192 {
193 profiles.emplace_back(
194 profile.template get<std::string>());
195 }
196 // Do not create the object if its profiles are not in the
197 // list of active profiles
Matthew Barth42428052021-03-30 12:50:59 -0500198 if (!profiles.empty() &&
199 !std::any_of(profiles.begin(), profiles.end(),
Matthew Barthacd737c2021-03-04 11:04:01 -0600200 [](const auto& name) {
201 return std::find(
202 getActiveProfiles().begin(),
203 getActiveProfiles().end(),
204 name) !=
205 getActiveProfiles().end();
206 }))
207 {
208 continue;
209 }
210 }
Matthew Barth603ef162021-03-24 15:34:53 -0500211 auto obj =
212 std::make_unique<T>(entry, std::forward<Args>(args)...);
Matthew Barthacd737c2021-03-04 11:04:01 -0600213 config.emplace(
214 std::make_pair(obj->getName(), obj->getProfiles()),
215 std::move(obj));
216 }
Matthew Barth68ac0042021-06-01 15:38:36 -0500217 log<level::INFO>(
218 fmt::format("Configuration({}) loaded successfully",
219 T::confFileName)
220 .c_str());
Matthew Barthacd737c2021-03-04 11:04:01 -0600221 }
222 return config;
223 }
224
225 /**
Matthew Barth0206c722021-03-30 15:20:05 -0500226 * @brief Check if the given input configuration key matches with another
227 * configuration key that it's to be included in
228 *
229 * @param[in] input - Config key to be included in another config object
230 * @param[in] comp - Config key of the config object to compare with
231 *
232 * @return Whether the configuration object should be included
233 */
234 static bool inConfig(const configKey& input, const configKey& comp);
235
236 /**
Matthew Barth12cb1252021-03-08 16:47:30 -0600237 * @brief Check if the given path and inteface is owned by a dbus service
238 *
239 * @param[in] path - Dbus object path
240 * @param[in] intf - Dbus object interface
241 *
242 * @return - Whether the service has an owner for the given object path and
243 * interface
244 */
245 static bool hasOwner(const std::string& path, const std::string& intf);
246
247 /**
Matthew Barth4ca87fa2021-04-14 11:31:13 -0500248 * @brief Sets the dbus service owner state of a given object
249 *
250 * @param[in] path - Dbus object path
251 * @param[in] serv - Dbus service name
252 * @param[in] intf - Dbus object interface
253 * @param[in] isOwned - Dbus service owner state
254 */
255 void setOwner(const std::string& path, const std::string& serv,
256 const std::string& intf, bool isOwned);
257
258 /**
259 * @brief Add a set of services for a path and interface by retrieving all
260 * the path subtrees to the given depth from root for the interface
261 *
Matthew Barth4ca87fa2021-04-14 11:31:13 -0500262 * @param[in] intf - Interface to add services for
263 * @param[in] depth - Depth of tree traversal from root path
264 *
265 * @throws - DBusMethodError
266 * Throws a DBusMethodError when the `getSubTree` method call fails
267 */
Matthew Barth98f6fc12021-04-16 10:48:37 -0500268 static void addServices(const std::string& intf, int32_t depth);
Matthew Barth4ca87fa2021-04-14 11:31:13 -0500269
270 /**
271 * @brief Get the service for a given path and interface from cached
272 * dataset and attempt to add all the services for the given path/interface
273 * when it's not found
274 *
275 * @param[in] path - Path to get service for
276 * @param[in] intf - Interface to get service for
277 *
278 * @return - The now cached service name
279 *
280 * @throws - DBusMethodError
281 * Ripples up a DBusMethodError exception from calling addServices
282 */
283 static const std::string& getService(const std::string& path,
284 const std::string& intf);
285
286 /**
Matthew Barthf41e9472021-05-13 16:38:06 -0500287 * @brief Get all the object paths for a given service and interface from
288 * the cached dataset and try to add all the services for the given
289 * interface when no paths are found and then attempt to get all the object
290 * paths again
291 *
292 * @param[in] serv - Service name to get paths for
293 * @param[in] intf - Interface to get paths for
294 *
295 * @return The cached object paths
296 */
297 std::vector<std::string> getPaths(const std::string& serv,
298 const std::string& intf);
299
300 /**
301 * @brief Add objects to the cached dataset by first using
302 * `getManagedObjects` for the same service providing the given path and
303 * interface or just add the single object of the given path, interface, and
304 * property if that fails.
305 *
306 * @param[in] path - Dbus object's path
307 * @param[in] intf - Dbus object's interface
308 * @param[in] prop - Dbus object's property
309 *
310 * @throws - DBusMethodError
311 * Throws a DBusMethodError when the the service is failed to be found or
312 * when the `getManagedObjects` method call fails
313 */
314 void addObjects(const std::string& path, const std::string& intf,
315 const std::string& prop);
316
317 /**
318 * @brief Get an object's property value
319 *
320 * @param[in] path - Dbus object's path
321 * @param[in] intf - Dbus object's interface
322 * @param[in] prop - Dbus object's property
323 */
324 const std::optional<PropertyVariantType>
325 getProperty(const std::string& path, const std::string& intf,
326 const std::string& prop);
327
328 /**
Matthew Barthbaeeb8f2021-05-13 16:03:54 -0500329 * @brief Set/update an object's property value
330 *
331 * @param[in] path - Dbus object's path
332 * @param[in] intf - Dbus object's interface
333 * @param[in] prop - Dbus object's property
334 * @param[in] value - Dbus object's property value
335 */
336 void setProperty(const std::string& path, const std::string& intf,
337 const std::string& prop, PropertyVariantType value)
338 {
339 _objects[path][intf][prop] = std::move(value);
340 }
341
342 /**
Matthew Barthc2691402021-05-13 16:20:32 -0500343 * @brief Remove an object's interface
344 *
345 * @param[in] path - Dbus object's path
346 * @param[in] intf - Dbus object's interface
347 */
348 inline void removeInterface(const std::string& path,
349 const std::string& intf)
350 {
351 auto itPath = _objects.find(path);
352 if (itPath != std::end(_objects))
353 {
354 _objects[path].erase(intf);
355 }
356 }
357
358 /**
Matthew Barth07fecfc2021-01-29 09:04:43 -0600359 * @brief Get the object's property value as a variant
360 *
361 * @param[in] path - Path of the object containing the property
362 * @param[in] intf - Interface name containing the property
363 * @param[in] prop - Name of property
364 *
365 * @return - The object's property value as a variant
366 */
367 static inline auto getObjValueVariant(const std::string& path,
368 const std::string& intf,
369 const std::string& prop)
370 {
371 return _objects.at(path).at(intf).at(prop);
372 };
373
374 /**
Matthew Barthd9cb63b2021-03-24 14:36:49 -0500375 * @brief Add a dbus timer
376 *
377 * @param[in] type - Type of timer
378 * @param[in] interval - Timer interval in microseconds
379 * @param[in] pkg - Packaged data for when timer expires
380 */
381 void addTimer(const TimerType type,
382 const std::chrono::microseconds interval,
383 std::unique_ptr<TimerPkg> pkg);
384
385 /**
386 * @brief Callback when a timer expires
387 *
388 * @param[in] data - Data to be used when the timer expired
389 */
390 void timerExpired(TimerData& data);
391
392 /**
Matthew Barthebabc042021-05-13 15:38:58 -0500393 * @brief Get the signal data for a given match string
394 *
395 * @param[in] sigMatch - Signal match string
396 *
397 * @return - Reference to the signal data for the given match string
398 */
399 std::vector<SignalData>& getSignal(const std::string& sigMatch)
400 {
401 return _signals[sigMatch];
402 }
403
404 /**
405 * @brief Handle receiving signals
406 *
407 * @param[in] msg - Signal message containing the signal's data
408 * @param[in] pkgs - Signal packages associated to the signal being handled
409 */
410 void handleSignal(sdbusplus::message::message& msg,
Matthew Barthfac8a2f2021-06-10 15:50:36 -0500411 const std::vector<SignalPkg>& pkgs);
Matthew Barthebabc042021-05-13 15:38:58 -0500412
413 /**
Matthew Bartheebde062021-04-14 12:48:52 -0500414 * @brief Get the sdbusplus bus object
415 */
416 inline auto& getBus()
417 {
418 return _bus;
419 }
420
421 /**
Matthew Barth48f44da2021-05-27 15:43:34 -0500422 * @brief Is the power state on
423 *
424 * @return Current power state of the system
425 */
426 inline bool isPowerOn() const
427 {
428 return _powerState->isPowerOn();
429 }
430
Matthew Barth3770a1d2021-06-10 15:09:37 -0500431 /**
432 * @brief Load all the fan control JSON configuration files
433 *
434 * This is where all the fan control JSON configuration files are parsed and
435 * loaded into their associated objects. Anything that needs to be done when
436 * the Manager object is constructed or handling a SIGHUP to reload the
437 * configurations needs to be done here.
438 */
439 void load();
440
Matt Spinlerd76351b2021-08-05 16:23:09 -0500441 /**
442 * @brief Sets a value in the parameter map.
443 *
444 * @param[in] name - The parameter name
445 * @param[in] value - The parameter value
446 */
447 static void setParameter(const std::string& name,
448 const PropertyVariantType& value)
449 {
450 _parameters[name] = value;
451 }
452
453 /**
454 * @brief Returns a value from the parameter map
455 *
456 * @param[in] name - The parameter name
457 *
458 * @return The parameter value, or std::nullopt if not found
459 */
460 static std::optional<PropertyVariantType>
461 getParameter(const std::string& name)
462 {
463 auto it = _parameters.find(name);
464 if (it != _parameters.end())
465 {
466 return it->second;
467 }
468
469 return std::nullopt;
470 }
471
472 /**
473 * @brief Deletes a parameter from the parameter map
474 *
475 * @param[in] name - The parameter name
476 */
477 static void deleteParameter(const std::string& name)
478 {
479 _parameters.erase(name);
480 }
481
Matt Spinler7787def2021-10-14 16:33:16 -0500482 /* The name of the dump file */
483 static const std::string dumpFile;
484
Matthew Bartha227a162020-08-05 10:51:45 -0500485 private:
Matthew Barth1542fb52021-06-10 14:09:09 -0500486 /* The sdbusplus bus object to use */
Matthew Barthacd737c2021-03-04 11:04:01 -0600487 sdbusplus::bus::bus& _bus;
488
Matthew Barth1542fb52021-06-10 14:09:09 -0500489 /* The sdeventplus even loop to use */
Matthew Barthacd737c2021-03-04 11:04:01 -0600490 sdeventplus::Event _event;
491
Matthew Barth1542fb52021-06-10 14:09:09 -0500492 /* The sdbusplus manager object to set the ObjectManager interface */
493 sdbusplus::server::manager::manager _mgr;
494
Matthew Barth3770a1d2021-06-10 15:09:37 -0500495 /* Whether loading the config files is allowed or not */
496 bool _loadAllowed;
497
Matthew Barth48f44da2021-05-27 15:43:34 -0500498 /* The system's power state determination object */
499 std::unique_ptr<PowerState> _powerState;
500
Matthew Barth06764942021-03-04 09:28:40 -0600501 /* List of profiles configured */
Matthew Barthacd737c2021-03-04 11:04:01 -0600502 std::map<configKey, std::unique_ptr<Profile>> _profiles;
Matthew Barth06764942021-03-04 09:28:40 -0600503
504 /* List of active profiles */
Matthew Barthacd737c2021-03-04 11:04:01 -0600505 static std::vector<std::string> _activeProfiles;
506
Matthew Barth4ca87fa2021-04-14 11:31:13 -0500507 /* Subtree map of paths to services of interfaces(with ownership state) */
508 static std::map<
509 std::string,
510 std::map<std::string, std::pair<bool, std::vector<std::string>>>>
Matthew Barth12cb1252021-03-08 16:47:30 -0600511 _servTree;
512
Matthew Barth07fecfc2021-01-29 09:04:43 -0600513 /* Object map of paths to interfaces of properties and their values */
514 static std::map<
515 std::string,
516 std::map<std::string, std::map<std::string, PropertyVariantType>>>
517 _objects;
518
Matthew Barthd9cb63b2021-03-24 14:36:49 -0500519 /* List of timers and their data to be processed when expired */
520 std::vector<std::pair<std::unique_ptr<TimerData>, Timer>> _timers;
521
Matthew Barthebabc042021-05-13 15:38:58 -0500522 /* Map of signal match strings to a list of signal handler data */
523 std::unordered_map<std::string, std::vector<SignalData>> _signals;
524
Matthew Barthacd737c2021-03-04 11:04:01 -0600525 /* List of zones configured */
526 std::map<configKey, std::unique_ptr<Zone>> _zones;
527
Matthew Barth44ab7692021-03-26 11:40:10 -0500528 /* List of events configured */
529 std::map<configKey, std::unique_ptr<Event>> _events;
530
Matt Spinler7787def2021-10-14 16:33:16 -0500531 /* The sdeventplus wrapper around sd_event_add_defer to dump debug
532 * data from the event loop after the USR1 signal. */
533 std::unique_ptr<sdeventplus::source::Defer> debugDumpEventSource;
Matt Spinler2fc0a352021-10-04 15:10:57 -0500534
Matthew Barthacd737c2021-03-04 11:04:01 -0600535 /**
Matt Spinlerd76351b2021-08-05 16:23:09 -0500536 * @brief A map of parameter names and values that are something
537 * other than just D-Bus property values that other actions
538 * can set and use.
539 */
540 static std::unordered_map<std::string, PropertyVariantType> _parameters;
541
542 /**
Matthew Barthb2cd93f2021-06-16 16:37:40 -0500543 * @brief Callback for power state changes
544 *
545 * @param[in] powerStateOn - Whether the power state is on or not
546 *
547 * Callback function bound to the PowerState object instance to handle each
548 * time the power state changes.
549 */
550 void powerStateChanged(bool powerStateOn);
551
552 /**
Matthew Barth4ca87fa2021-04-14 11:31:13 -0500553 * @brief Find the service name for a given path and interface from the
554 * cached dataset
555 *
556 * @param[in] path - Path to get service for
557 * @param[in] intf - Interface to get service for
558 *
559 * @return - The cached service name
560 */
561 static const std::string& findService(const std::string& path,
562 const std::string& intf);
563
564 /**
Matthew Barthf41e9472021-05-13 16:38:06 -0500565 * @brief Find all the paths for a given service and interface from the
566 * cached dataset
567 *
568 * @param[in] serv - Service name to get paths for
569 * @param[in] intf - Interface to get paths for
570 *
571 * @return - The cached object paths
572 */
573 std::vector<std::string> findPaths(const std::string& serv,
574 const std::string& intf);
575
576 /**
Matthew Barthacd737c2021-03-04 11:04:01 -0600577 * @brief Parse and set the configured profiles from the profiles JSON file
578 *
579 * Retrieves the optional profiles JSON configuration file, parses it, and
580 * creates a list of configured profiles available to the other
581 * configuration files. These profiles can be used to remove or include
582 * entries within the other configuration files.
583 */
584 void setProfiles();
Matt Spinler2fc0a352021-10-04 15:10:57 -0500585
586 /**
Matt Spinler7787def2021-10-14 16:33:16 -0500587 * @brief Callback from debugDumpEventSource to dump debug data
Matt Spinler2fc0a352021-10-04 15:10:57 -0500588 */
Matt Spinler7787def2021-10-14 16:33:16 -0500589 void dumpDebugData(sdeventplus::source::EventBase&);
Matt Spinlerb5c21a22021-10-14 16:52:12 -0500590
591 /**
592 * @brief Dump the _objects, _servTree, and _parameters maps to JSON
593 *
594 * @param[out] data - The JSON that will be filled in
595 */
596 void dumpCache(json& data);
Matthew Bartha227a162020-08-05 10:51:45 -0500597};
598
599} // namespace phosphor::fan::control::json