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
Loading
Please register or sign in to comment