question about dyn chip support generic temp print
Hi all,
As said already I'm working on the fintek 71882 driver, I've currently given it a tempX_input tempX_max tempX_max_hyst and a tempX_crit, with the current dyn chip + generic print support this results in:
CPU: +38.0°C (high = +80.0°C, hyst = +4.0°C) sensor = transistor temp1_crit: +81.0°C
This is because currently for max + hyst chips the first line gets printed, and then for chips which have a crit to a sensors_get_label_and_valid is done on the sensors_feature_data describing tempX_crit. Wouldn't it be better to reuse the main temp label and value, resulting in:
CPU: +38.0°C (high = +80.0°C, hyst = +4.0°C) sensor = transistor CPU: +38.0°C (crit = +81.0°C)
Maybe change the label into all whitespace / "CPU (continued)"? The current printout seems very wrong, but my suggested one doesn't feel right either.
Also as already "explained" in my previous question, this chip has one hysteresis for both max and crit, now to make the current code work I would need to put that twice into sysfs, which would result in to both changing if one gets written (I can make only one rw to make this obvious).
Or we need to add a tempX_hyst type, and update the generic temp print code to handle this scenario too.
Regards,
Hans
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 12 lines · Hans de Goede
Hi all,
As said already I'm working on the fintek 71882 driver, I've currently given it a
tempX_inputtempX_maxtempX_max_hystand atempX_crit, with the current dyn chip + generic print support this results in:CPU: +38.0°C (high = +80.0°C, hyst = +4.0°C) sensor = transistor temp1_crit: +81.0°CThis is because currently for max + hyst chips the first line gets printed, and then for chips which have a crit to a
sensors_get_label_and_validis done on thesensors_feature_datadescribingtempX_crit. Wouldn't it be better to reuse the main temp label and value, resulting in:
Quoted 5 lines
CPU: +38.0°C (high = +80.0°C, hyst = +4.0°C) sensor = transistor CPU: +38.0°C (crit = +81.0°C)Maybe change the label into all whitespace / "CPU (continued)"? The current printout seems very wrong, but my suggested one doesn't feel right either.
Hmm... Neither looks right to me. I can see user comments/bug reports flying in...
Isn't there a way to make the print routine collect all the data and print in on a single line?
And our sysfs standard defines hyst to be an absolute value, not relative.
Quoted 4 lines
Also as already "explained" in my previous question, this chip has one hysteresis for both max and crit, now to make the current code work I would need to put that twice into sysfs, which would result in to both changing if one gets written (I can make only one rw to make this obvious).
That should be OK. I did something similar in the vt1211 where a single register was exported twice and one of the attributes was read-only.
...juerg
Quoted 6 lines
Or we need to add a
tempX_hysttype, and update the generic temp print code to handle this scenario too.Regards,
Quoted 8 lines
Hans
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 14 lines · Juerg Haefliger
Quoted 13 lines · Hans de Goede
As said already I'm working on the fintek 71882 driver, I've currently given it a
tempX_inputtempX_maxtempX_max_hystand atempX_crit, with the current dyn chip + generic print support this results in:CPU: +38.0°C (high = +80.0°C, hyst = +4.0°C) sensor = transistor temp1_crit: +81.0°CThis is because currently for max + hyst chips the first line gets printed, and then for chips which have a crit to a
sensors_get_label_and_validis done on thesensors_feature_datadescribingtempX_crit. Wouldn't it be better to reuse the main temp label and value, resulting in:CPU: +38.0°C (high = +80.0°C, hyst = +4.0°C) sensor = transistor CPU: +38.0°C (crit = +81.0°C)
Quoted 5 lines
Quoted 2 lines
Maybe change the label into all whitespace / "CPU (continued)"? The current printout seems very wrong, but my suggested one doesn't feel right either.
Hmm... Neither looks right to me. I can see user comments/bug reports flying in...
At least the current way has been in use for years now. "sensors" prints something like that for the LM90/ADM1032 PC87366 chips already, and I don't remember anybody complaining. OTOH, printing the same value twice seems pretty wrong. So while I agree none of these methods are ideal, the latter seems even worse to me.
Quoted 2 lines
Isn't there a way to make the print routine collect all the data and print in on a single line?
We could do that, the problem is that the list can get quite long. There can be up to 5 limits for each temperature input: min, max, max_hyst, crit and crit_hyst. A chip like the ADM1032 has all of them!
I think that the idea with multiple lines was to make the output fit in 80 columns. If we want to stick to that, this means a maximum of two limits per line. So we could present things that way:
CPU: +38.0°C (high = +80.0°C, hyst = +4.0°C,
crit = +81.0°C) sensor = transistor
The exact algorithm is not trivial because of hysteresis values, which we always want on the same line as the limit they correspond to.
Or maybe we can have "sensors" read the COLUMNS environment variable and print things differently depending on the value, for example on multiple lines if COLUMNS€ and all on one line if COLUMNS>80. This can quickly get complex to implement though, and might also be confusing (COLUMNS isn't exported by default.)
Quoted 1 line
And our sysfs standard defines hyst to be an absolute value, not relative.
True.
Quoted 8 lines
Quoted 4 lines
Also as already "explained" in my previous question, this chip has one hysteresis for both max and crit, now to make the current code work I would need to put that twice into sysfs, which would result in to both changing if one gets written (I can make only one rw to make this obvious).
That should be OK. I did something similar in the vt1211 where a single register was exported twice and one of the attributes was read-only.
Yes, that's the way to go.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors