aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2018-04-11 14:12:43 +0100
committerFlorian Mayer <fmayer@google.com>2018-04-11 14:12:43 +0100
commitd9f3913e3874520ac37e9e489dd5ca17c7c4e974 (patch)
tree149db7a7997438305936db4e4a44fd3ef73328d3
parent5e38ea28bcfb3ca98730a1bf8ba2cb79db3eaac0 (diff)
downloadperfetto-d9f3913e3874520ac37e9e489dd5ca17c7c4e974.tar.gz
Write mount points for inodes that were not found.
This allows us to at least know which partition inodes were on even if we cannot find any of them. Bug: 73625480 Change-Id: I12e807d4cfa535a590a9aefe672d255ed059ce4e
-rw-r--r--src/traced/probes/filesystem/inode_file_data_source.cc9
-rw-r--r--src/traced/probes/filesystem/inode_file_data_source.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/traced/probes/filesystem/inode_file_data_source.cc b/src/traced/probes/filesystem/inode_file_data_source.cc
index a66c2a9c9..dac9bf1eb 100644
--- a/src/traced/probes/filesystem/inode_file_data_source.cc
+++ b/src/traced/probes/filesystem/inode_file_data_source.cc
@@ -250,6 +250,7 @@ void InodeFileDataSource::OnInodes(
InodeFileMap* InodeFileDataSource::AddToCurrentTracePacket(
BlockDeviceID block_device_id) {
+ seen_block_devices_.emplace(block_device_id);
if (!has_current_trace_packet_ ||
current_block_device_id_ != block_device_id) {
if (has_current_trace_packet_)
@@ -325,6 +326,14 @@ void InodeFileDataSource::OnInodeScanDone() {
// Finalize the accumulated trace packets.
ResetTracePacket();
file_scanner_.reset();
+ if (!missing_inodes_.empty()) {
+ // At least write mount point mapping for inodes that are not found.
+ for (const auto& p : missing_inodes_) {
+ if (seen_block_devices_.count(p.first) == 0)
+ AddToCurrentTracePacket(p.first);
+ }
+ }
+
if (next_missing_inodes_.empty()) {
scan_running_ = false;
} else {
diff --git a/src/traced/probes/filesystem/inode_file_data_source.h b/src/traced/probes/filesystem/inode_file_data_source.h
index bede1240d..926031cf3 100644
--- a/src/traced/probes/filesystem/inode_file_data_source.h
+++ b/src/traced/probes/filesystem/inode_file_data_source.h
@@ -118,6 +118,7 @@ class InodeFileDataSource : public FileScanner::Delegate {
std::unique_ptr<TraceWriter> writer_;
std::map<BlockDeviceID, std::set<Inode>> missing_inodes_;
std::map<BlockDeviceID, std::set<Inode>> next_missing_inodes_;
+ std::set<BlockDeviceID> seen_block_devices_;
BlockDeviceID current_block_device_id_;
TraceWriter::TracePacketHandle current_trace_packet_;
InodeFileMap* current_file_map_;