Skip to content

Commit

Permalink
Print page/bank right after address
Browse files Browse the repository at this point in the history
Summary: title

Differential Revision: D64683316

fbshipit-source-id: 0f326ab60386886582128b0a7cba7b14942afbe7
  • Loading branch information
Mohammed Al-Sanabani authored and facebook-github-bot committed Nov 16, 2024
1 parent e69a233 commit ab5de44
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fboss/qsfp_service/module/I2cLogBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ size_t I2cLogBuffer::getHeader(
ss << "If the read transaction failed [Data] may not be accurate.\n";
ss << "mmmuuu: milliseconds microseconds, steadclock_ns: time in ns between log entries \n";
ss << "Header format: \n";
ss << "Month D HH:MM:SS.mmmuuu FIELD_NAME <i2c_address offset len page bank op> F [data] steadyclock_ns"
ss << "Month D HH:MM:SS.mmmuuu FIELD_NAME <i2c_address page bank offset len op> F [data] steadyclock_ns"
<< "\n";

auto str = ss.str();
Expand Down Expand Up @@ -247,10 +247,10 @@ std::pair<size_t, size_t> I2cLogBuffer::dumpToFile() {
ss << " <";
auto& param = entry.param;
getOptional(ss, param.i2cAddress);
ss << std::setfill(' ') << std::setw(3) << param.offset << " ";
ss << std::setfill(' ') << std::setw(3) << param.len << " ";
getOptional(ss, param.page);
getOptional(ss, param.bank);
ss << std::setfill(' ') << std::setw(3) << param.offset << " ";
ss << std::setfill(' ') << std::setw(3) << param.len << " ";
ss << (entry.op == Operation::Read ? "R" : "W");
ss << "> ";
if (entry.success) {
Expand Down Expand Up @@ -287,8 +287,6 @@ TransceiverAccessParameter I2cLogBuffer::getParam(std::stringstream& ss) {
if (token != kEmptyOptional) {
param.i2cAddress = folly::to<uint8_t>(token);
}
ss >> param.offset;
ss >> param.len;
ss >> token;
if (token != kEmptyOptional) {
param.page = folly::to<uint8_t>(token);
Expand All @@ -297,6 +295,8 @@ TransceiverAccessParameter I2cLogBuffer::getParam(std::stringstream& ss) {
if (token != kEmptyOptional) {
param.bank = folly::to<uint8_t>(token);
}
ss >> param.offset;
ss >> param.len;
return param;
}

Expand Down

0 comments on commit ab5de44

Please sign in to comment.