Skip to content

Commit 714e6b4

Browse files
committed
pcm-raw: improve format print for registers
1 parent b4d0abc commit 714e6b4

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/pcm-raw.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,40 +1225,42 @@ const char * getTypeString(uint64 typeID)
12251225
std::string getMSREventString(const uint64 & index, const std::string & type, const PCM::MSRType & msrType)
12261226
{
12271227
std::stringstream c;
1228-
c << type << ":0x" << std::hex << index << ":" << getTypeString(msrType);
1228+
c << type << "/MSR 0x" << std::hex << index << "/" << getTypeString(msrType);
12291229
return c.str();
12301230
}
12311231

12321232
std::string getPCICFGEventString(const PCM::RawEventEncoding & eventEnc, const std::string& type)
12331233
{
12341234
std::stringstream c;
1235-
c << type << ":0x" << std::hex << eventEnc[PCM::PCICFGEventPosition::deviceID] << ":0x" << eventEnc[PCM::PCICFGEventPosition::offset] << ":0x" << eventEnc[PCM::PCICFGEventPosition::width] << ":"
1235+
c << type << "/deviceID 0x" << std::hex << eventEnc[PCM::PCICFGEventPosition::deviceID]
1236+
<< "/offset 0x" << eventEnc[PCM::PCICFGEventPosition::offset]
1237+
<< "/width 0x" << eventEnc[PCM::PCICFGEventPosition::width] << "/"
12361238
<< getTypeString(eventEnc[PCM::PCICFGEventPosition::type]);
12371239
return c.str();
12381240
}
12391241

12401242
std::string getMMIOEventString(const PCM::RawEventEncoding& eventEnc, const std::string& type)
12411243
{
12421244
std::stringstream c;
1243-
c << type << ":0x" << std::hex <<
1245+
c << type << "/deviceID 0x" << std::hex <<
12441246
eventEnc[PCM::MMIOEventPosition::deviceID] <<
1245-
":0x" << eventEnc[PCM::MMIOEventPosition::offset] <<
1246-
":0x" << eventEnc[PCM::MMIOEventPosition::membar_bits1] <<
1247-
":0x" << eventEnc[PCM::MMIOEventPosition::membar_bits2] <<
1248-
":0x" << eventEnc[PCM::MMIOEventPosition::width] <<
1249-
":" << getTypeString(eventEnc[PCM::MMIOEventPosition::type]);
1247+
"/offset 0x" << eventEnc[PCM::MMIOEventPosition::offset] <<
1248+
"/membar_bits1 0x" << eventEnc[PCM::MMIOEventPosition::membar_bits1] <<
1249+
"/membar_bits2 0x" << eventEnc[PCM::MMIOEventPosition::membar_bits2] <<
1250+
"/width 0x" << eventEnc[PCM::MMIOEventPosition::width] <<
1251+
"/" << getTypeString(eventEnc[PCM::MMIOEventPosition::type]);
12501252
return c.str();
12511253
}
12521254

12531255
std::string getPMTEventString(const PCM::RawEventEncoding& eventEnc, const std::string& type)
12541256
{
12551257
std::stringstream c;
1256-
c << type << ":0x" << std::hex <<
1258+
c << type << "/UID 0x" << std::hex <<
12571259
eventEnc[PCM::PMTEventPosition::UID] <<
1258-
":0x" << eventEnc[PCM::PMTEventPosition::offset] <<
1259-
":0x" << eventEnc[PCM::PMTEventPosition::lsb] <<
1260-
":0x" << eventEnc[PCM::PMTEventPosition::msb] <<
1261-
":" << getTypeString(eventEnc[PCM::PMTEventPosition::type]);
1260+
"/offset 0x" << eventEnc[PCM::PMTEventPosition::offset] <<
1261+
"/lsb 0x" << eventEnc[PCM::PMTEventPosition::lsb] <<
1262+
"/msb 0x" << eventEnc[PCM::PMTEventPosition::msb] <<
1263+
"/" << getTypeString(eventEnc[PCM::PMTEventPosition::type]);
12621264
return c.str();
12631265
}
12641266

0 commit comments

Comments
 (0)