diff options
author | Eran Ben Elisha <eranbe@mellanox.com> | 2019-03-03 09:57:30 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-04 20:00:43 +0100 |
commit | 3167b27a7ded84623f50e4fb4cab846e75c4a210 (patch) | |
tree | 27c059516dae5978ff67f9e64f16ffbd6d598abf /include/trace | |
parent | devlink: Update reporter state to error even if recover aborted (diff) | |
download | linux-3167b27a7ded84623f50e4fb4cab846e75c4a210.tar.xz linux-3167b27a7ded84623f50e4fb4cab846e75c4a210.zip |
devlink: Add support for direct reporter health state update
It is possible that a reporter state will be updated due to a recover flow
which is not triggered by a devlink health related operation, but as a side
effect of some other operation in the system.
Expose devlink health API for a direct update of a reporter status.
Move devlink_health_reporter_state enum definition to devlink.h so it could
be used from drivers as a parameter of devlink_health_reporter_state_update.
In addition, add trace_devlink_health_reporter_state_update to provide user
notification for reporter state change.
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/devlink.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/trace/events/devlink.h b/include/trace/events/devlink.h index 191ddf67d769..6f60a78d9a7e 100644 --- a/include/trace/events/devlink.h +++ b/include/trace/events/devlink.h @@ -140,6 +140,37 @@ TRACE_EVENT(devlink_health_recover_aborted, __entry->time_since_last_recover) ); +/* + * Tracepoint for devlink health reporter state update: + */ +TRACE_EVENT(devlink_health_reporter_state_update, + TP_PROTO(const struct devlink *devlink, const char *reporter_name, + bool new_state), + + TP_ARGS(devlink, reporter_name, new_state), + + TP_STRUCT__entry( + __string(bus_name, devlink->dev->bus->name) + __string(dev_name, dev_name(devlink->dev)) + __string(driver_name, devlink->dev->driver->name) + __string(reporter_name, reporter_name) + __field(u8, new_state) + ), + + TP_fast_assign( + __assign_str(bus_name, devlink->dev->bus->name); + __assign_str(dev_name, dev_name(devlink->dev)); + __assign_str(driver_name, devlink->dev->driver->name); + __assign_str(reporter_name, reporter_name); + __entry->new_state = new_state; + ), + + TP_printk("bus_name=%s dev_name=%s driver_name=%s reporter_name=%s: new_state=%d", + __get_str(bus_name), __get_str(dev_name), + __get_str(driver_name), __get_str(reporter_name), + __entry->new_state) +); + #endif /* _TRACE_DEVLINK_H */ /* This part must be outside protection */ |