Blackbox type data recording

In the embedded Linux application that I am developing, it is necessary to record some events that occur from time to time. These records are stored on the MTD flash device, and after they are written, there is no need to change them or perform effective search queries, but access to the data requires read access. The big problem is that power can go away at any time without a proper shutdown sequence. The frequency of these events can be very slow (days / weeks), but some of them will occur immediately. The data that needs to be stored for each event is strictly typified: date, time, a few short text strings and a few integers.

Currently, I have inherited a solution based on jffs2 and SQLite, which is far from optimal, because the DB file is sometimes damaged. When this happens, the whole file becomes unreadable, and there is no way to understand if it was caused by an error in jffs2 or SQLite, or if the flash sector was bad, or if the power was turned off at the wrong time.

Is there a library or file system / library combination that can help me solve this problem? Or should I just use a text file with a CSV-like format?

+3
source share
5 answers

syslogd YAFFS2 NAND, : , (< 100ms), , .

, , , .

+1

, , CSV, , . , , ( ). , ( ). , CSV, , .

, CSV .

+3

( ), . , , - google. , , , , - , , -, GPL.

+1

csv/ . , . , , , .

, , ( ) - .

, - , .

. , , .

0

? , , syslog, SNMP, raw socket . .

, , , . "write/flush" , , . , , , " " ( , , ).

0
source

Source: https://habr.com/ru/post/1697916/


All Articles