Commit 7481b2f7 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/snmpd: print old and new value for errors on some objects

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 1cdda7ad
......@@ -166,9 +166,11 @@ static int get_rtu_status(struct ns_pstats *old,
* logs */
ret = 1;
snmp_log(LOG_ERR, "SNMP: " SL_ER " %s: "
"wrsPstatsHCRXDropRTUFull counter for port %i (wri %i) increased by %lld, allowed %d\n",
"wrsPstatsHCRXDropRTUFull counter for port %i (wri %i) increased by %lld, allowed %d "
"old val %lld, new val %lld\n",
slog_obj_name, i + 1, i + 1,
new[i].wrsPstatsHCRXDropRTUFull - old[i].wrsPstatsHCRXDropRTUFull, 0);
new[i].wrsPstatsHCRXDropRTUFull - old[i].wrsPstatsHCRXDropRTUFull, 0,
old[i].wrsPstatsHCRXDropRTUFull, new[i].wrsPstatsHCRXDropRTUFull);
snmp_log(LOG_ERR, "SNMP: " SL_ER " %s: "
"some frames were lost because RTU could not accept new requests\n",
slog_obj_name);
......
......@@ -80,10 +80,12 @@ struct pickinfo {
#define SLOG_IF_COMP_WNSG(_log_type, _obj, _new, _old, _i, _t_delta, _rate, _assign) \
do { if ((_new[_i]._obj - _old[_i]._obj)/_t_delta > _rate) {\
_assign; \
snmp_log(LOG_ERR, "SNMP: " _log_type " %s: " #_obj " for port %i (wri%i) increased by more than %.0f during %.0fs, allowed %.0f\n", \
slog_obj_name, _i + 1, _i + 1, \
(_new[_i]._obj - _old[_i]._obj)/_t_delta, _t_delta, \
_rate); \
snmp_log(LOG_ERR, "SNMP: " _log_type " %s: " #_obj " for port %i " \
"(wri%i) increased by more than %.0f during %.0fs, " \
"allowed %.0f, old value %llu new value %llu\n", \
slog_obj_name, _i + 1, _i + 1, \
(_new[_i]._obj - _old[_i]._obj)/_t_delta, _t_delta, \
_rate, _old[_i]._obj, _new[_i]._obj); \
} \
} while (0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment