Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a8b9aa63 authored by Jack He's avatar Jack He
Browse files

GD-HCI: Flush snoop log to kernel buffer on every write

* std::ofstream::flush() pushes user data into kernel memory. The data
  will be written even if this process crashes. However, data will be lost
  if there is a kernel panic, which is out of scope of BT snoop log.
* std::ofstream::write() followed by std::ofstream::flush() has similar
  effect as UNIX write(fd, data, len) as write() syscall dumps data into
  kernel memory directly
* Before this change, btsnoop log data might be partially stored in
  memory when bluetooth stack crashes, causing broken log entries
  or missing packets

Bug: 164973960
Test: make, flash phone, and test pairing
Tag: #gd-refactor
Change-Id: I611e0b9480511b569dadbb023775b0db8159f39d
parent d0ab2373
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment