Skip to content

Commit 8cfcc29

Browse files
os/kernel/crashlog_writer: Add crash log flash save
On top of the existing functionality: 1. Added the ability to record the time taken to save the log into a file. 2. Improved code readability. 3. Minimized the use of global variables. 4. Added functionality to read logs saved in a file.
1 parent bfce97c commit 8cfcc29

File tree

2 files changed

+156
-96
lines changed

2 files changed

+156
-96
lines changed

os/include/tinyara/crashlog_writer/crashlog_writer.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ void set_store_to_buffer_flag(int flag);
4343
* If the flag is 1, the log is saved in compressed form; if it is 0, it is saved uncompressed.
4444
*
4545
****************************************************************************/
46-
void save_crash_log(int flag);
46+
char* save_crash_log(int flag);
47+
48+
/*************************************************************************************
49+
* Name: read_crash_log
50+
*
51+
* Description:
52+
* Reads a log from a file and stores it in a buffer. If the log is compresed, it is
53+
* decompressed before being stored.
54+
*************************************************************************************/
55+
int read_crash_log(char *filename, char *buf, int buf_size);
4756

4857
#endif

0 commit comments

Comments
 (0)