diff --git a/tree/ntupleutil/inc/ROOT/RNTupleInspector.hxx b/tree/ntupleutil/inc/ROOT/RNTupleInspector.hxx index 88bf518fd6130..957b1550b9c88 100644 --- a/tree/ntupleutil/inc/ROOT/RNTupleInspector.hxx +++ b/tree/ntupleutil/inc/ROOT/RNTupleInspector.hxx @@ -502,14 +502,16 @@ public: ///////////////////////////////////////////////////////////////////////////// /// \brief Print a string that represents the tree of the (sub)fields and columns of an RNTuple in a format which a /// performance profile visualizer can render - void PrintSchemaProfile(ESchemaProfileFormat format, std::ostream &output = std::cout) const; + void PrintSchemaProfile(std::ostream &output = std::cout, + ESchemaProfileFormat format = ESchemaProfileFormat::kSpeedscopeJSON) const; //////////////////////////////////////////////////////////////////////////// /// \brief Print a string that represents the on-disk storage of the cluster groups, clusters, column ranges, pages, /// header, footer and page lists on an RNTuple in a format which a performance profile visualizer can render /// /// \warning ntuple must have a file-based backend - void PrintDiskProfile(ESchemaProfileFormat format, std::ostream &output = std::cout) const; + void PrintDiskProfile(std::ostream &output = std::cout, + ESchemaProfileFormat format = ESchemaProfileFormat::kSpeedscopeJSON) const; }; } // namespace Experimental } // namespace ROOT diff --git a/tree/ntupleutil/src/RNTupleInspector.cxx b/tree/ntupleutil/src/RNTupleInspector.cxx index f906bbf523a6d..a3287a1d4d2ff 100644 --- a/tree/ntupleutil/src/RNTupleInspector.cxx +++ b/tree/ntupleutil/src/RNTupleInspector.cxx @@ -632,8 +632,8 @@ static void PrintSpeedscopeFrames(const std::vector &frames, st } } // namespace -void ROOT::Experimental::RNTupleInspector::PrintSchemaProfile([[maybe_unused]] ESchemaProfileFormat format, - std::ostream &output) const +void ROOT::Experimental::RNTupleInspector::PrintSchemaProfile(std::ostream &output, + [[maybe_unused]] ESchemaProfileFormat format) const { // There is only one format at the moment assert(format == ESchemaProfileFormat::kSpeedscopeJSON); @@ -693,8 +693,8 @@ void ROOT::Experimental::RNTupleInspector::PrintSchemaProfile([[maybe_unused]] E PrintSpeedscopeFrames(frames, output); } -void ROOT::Experimental::RNTupleInspector::PrintDiskProfile([[maybe_unused]] ESchemaProfileFormat format, - std::ostream &output) const +void ROOT::Experimental::RNTupleInspector::PrintDiskProfile(std::ostream &output, + [[maybe_unused]] ESchemaProfileFormat format) const { // There is only one format at the moment assert(format == ESchemaProfileFormat::kSpeedscopeJSON); @@ -734,7 +734,8 @@ void ROOT::Experimental::RNTupleInspector::PrintDiskProfile([[maybe_unused]] ESc RDiskPageLeaf pageLeaf; pageLeaf.fPosition = locator.GetPosition(); - pageLeaf.fSize = locator.GetNBytesOnStorage(); + pageLeaf.fSize = locator.GetNBytesOnStorage() + + pageInfo.HasChecksum() * ROOT::Internal::RPageStorage::kNBytesPageChecksum; pageLeaf.fName = "[page @" + std::to_string(pageLeaf.fPosition) + "]"; pageLeaf.fAncestors = {groupId, clusterId, columnId}; pageLeaves.push_back(pageLeaf); diff --git a/tree/ntupleutil/test/ntuple_inspector.cxx b/tree/ntupleutil/test/ntuple_inspector.cxx index 8666b212db61f..edc67ee957cf7 100644 --- a/tree/ntupleutil/test/ntuple_inspector.cxx +++ b/tree/ntupleutil/test/ntuple_inspector.cxx @@ -891,7 +891,7 @@ TEST(RNTupleInspector, SchemaProfile) } auto inspector = RNTupleInspector::Create("ntuple", fileGuard.GetPath()); std::ostringstream schemaProfileStream; - inspector->PrintSchemaProfile(ROOT::Experimental::ESchemaProfileFormat::kSpeedscopeJSON, schemaProfileStream); + inspector->PrintSchemaProfile(schemaProfileStream); const std::string schemaProfile = schemaProfileStream.str(); const std::string expected = R"foo({ "$schema":"https://www.speedscope.app/file-format-schema.json", @@ -1129,7 +1129,7 @@ TEST(RNTupleInspector, DiskProfile) auto inspector = RNTupleInspector::Create("shuffled_ntuple", fileGuard.GetPath()); std::ostringstream diskProfileStream; - inspector->PrintDiskProfile(ROOT::Experimental::ESchemaProfileFormat::kSpeedscopeJSON, diskProfileStream); + inspector->PrintDiskProfile(diskProfileStream); const std::string diskProfile = diskProfileStream.str(); const std::string expected = R"foo({ "$schema":"https://www.speedscope.app/file-format-schema.json", @@ -1178,14 +1178,14 @@ TEST(RNTupleInspector, DiskProfile) {"type":"O","frame":2,"at":882}, {"type":"O","frame":3,"at":882}, {"type":"O","frame":4,"at":882}, - {"type":"C","frame":4,"at":1082}, + {"type":"C","frame":4,"at":1090}, {"type":"O","frame":5,"at":1132}, {"type":"C","frame":5,"at":1232}, {"type":"C","frame":3,"at":1232}, {"type":"O","frame":6,"at":1274}, {"type":"O","frame":7,"at":1274}, - {"type":"C","frame":7,"at":1674}, - {"type":"C","frame":6,"at":1674}, + {"type":"C","frame":7,"at":1682}, + {"type":"C","frame":6,"at":1682}, {"type":"O","frame":8,"at":1724}, {"type":"O","frame":9,"at":1724}, {"type":"C","frame":9,"at":1824}, @@ -1194,9 +1194,9 @@ TEST(RNTupleInspector, DiskProfile) {"type":"O","frame":10,"at":1866}, {"type":"O","frame":11,"at":1866}, {"type":"O","frame":12,"at":1866}, - {"type":"C","frame":12,"at":2266}, - {"type":"C","frame":11,"at":2266}, - {"type":"C","frame":10,"at":2266}, + {"type":"C","frame":12,"at":2274}, + {"type":"C","frame":11,"at":2274}, + {"type":"C","frame":10,"at":2274}, {"type":"O","frame":13,"at":2316}, {"type":"O","frame":14,"at":2316}, {"type":"O","frame":15,"at":2316}, @@ -1208,10 +1208,10 @@ TEST(RNTupleInspector, DiskProfile) {"type":"O","frame":17,"at":2758}, {"type":"O","frame":18,"at":2758}, {"type":"O","frame":19,"at":2758}, - {"type":"C","frame":19,"at":3158}, - {"type":"C","frame":18,"at":3158}, - {"type":"C","frame":17,"at":3158}, - {"type":"C","frame":16,"at":3158}, + {"type":"C","frame":19,"at":3166}, + {"type":"C","frame":18,"at":3166}, + {"type":"C","frame":17,"at":3166}, + {"type":"C","frame":16,"at":3166}, {"type":"O","frame":20,"at":3208}, {"type":"O","frame":21,"at":3208}, {"type":"O","frame":22,"at":3208},