Bernhard Bitsch
2014-10-21 22:41:54 UTC
Hi,
I hope someone reads this. The development isn't really engaged in this project, I suspect from the state of the home page.
I'm using LCD4Linux since a while as part of my IPFire appliance on an ALIX board.
LCD4Linux isn't running continously on my system, because from a while to a while I noticed performance losses with the program active. Of course the display of system parameters on a LCD is just a nice addon to my system, but not really necessary.
In the last days we discussed a new config for the Pearl (DPF) display. Unfortunately this config caused very high load ( CPU usage about 80%-90%! ).
First idea was, the use of exec plugin gives that high load. But just a config with 2 static text rows made the same effect!
Further investigation showed two problems:
1) The high load is produced by the update parameter for the text widget class ( =0 -->static, one shot ). Changing the value to just 10 removes that load. Is this issue known? If yes, does exist a patch for this?
2) Trying to eliminate some exec functions ( they just read some info from a file ) by using the File::readline function did not succeed. The files read do not contain a EOL character, thus the function does return the empty string.
Looking at the sources of the plugin showed, that a EOL is mandatory. Why? Furthermore the maximum line length is set to 80. The rest of the line is eaten up.
This behaviour is not necessary. fgets stops at EOF, also. Thus a one line file without EOL char could be read also.
I found further issues with this code.
The code for reading is:
char value[80], val2[80];
....
fgets(val2, sizeof(val2), fp); <--- read 80 chars at most
size = strcspn(val2, "\r\n"); <--- search for EOL, if not found size is >=80
strncpy(value, val2, size); <--- only valid if size <=80
value[size] = '\0'; <--- only valid for size <80
- Bernhard
I hope someone reads this. The development isn't really engaged in this project, I suspect from the state of the home page.
I'm using LCD4Linux since a while as part of my IPFire appliance on an ALIX board.
LCD4Linux isn't running continously on my system, because from a while to a while I noticed performance losses with the program active. Of course the display of system parameters on a LCD is just a nice addon to my system, but not really necessary.
In the last days we discussed a new config for the Pearl (DPF) display. Unfortunately this config caused very high load ( CPU usage about 80%-90%! ).
First idea was, the use of exec plugin gives that high load. But just a config with 2 static text rows made the same effect!
Further investigation showed two problems:
1) The high load is produced by the update parameter for the text widget class ( =0 -->static, one shot ). Changing the value to just 10 removes that load. Is this issue known? If yes, does exist a patch for this?
2) Trying to eliminate some exec functions ( they just read some info from a file ) by using the File::readline function did not succeed. The files read do not contain a EOL character, thus the function does return the empty string.
Looking at the sources of the plugin showed, that a EOL is mandatory. Why? Furthermore the maximum line length is set to 80. The rest of the line is eaten up.
This behaviour is not necessary. fgets stops at EOF, also. Thus a one line file without EOL char could be read also.
I found further issues with this code.
The code for reading is:
char value[80], val2[80];
....
fgets(val2, sizeof(val2), fp); <--- read 80 chars at most
size = strcspn(val2, "\r\n"); <--- search for EOL, if not found size is >=80
strncpy(value, val2, size); <--- only valid if size <=80
value[size] = '\0'; <--- only valid for size <80
- Bernhard