Skip to content

Commit

Permalink
reduce floodding debug output
Browse files Browse the repository at this point in the history
suppress debug output for invalid address passed to `memoryRead`
if it is identical to the last recognized invalid one
  • Loading branch information
GitMensch committed Nov 5, 2023
1 parent 2408135 commit 37065ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/perfunwind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ static bool memoryRead(Dwfl *dwfl, Dwarf_Addr addr, Dwarf_Word *result, void *ar

/* Check overflow. */
if (addr + sizeof(Dwarf_Word) < addr) {
qDebug() << "Invalid memory read requested by dwfl" << Qt::hex << addr;
if (ui->lastInvalidAddr != addr) {
qDebug() << "Invalid memory read requested by dwfl" << Qt::hex << addr;
ui->lastInvalidAddr = addr;
}
ui->firstGuessedFrame = ui->frames.length();
return false;
}
Expand Down
1 change: 1 addition & 0 deletions app/perfunwind.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class PerfUnwind : public QObject
QHash<qint32, QHash<quint64, Dwarf_Word>> stackValues;
QVector<qint32> frames;
PerfUnwind *unwind;
Dwarf_Addr lastInvalidAddr;
const PerfRecordSample *sample;
int maxFrames;
int firstGuessedFrame;
Expand Down

0 comments on commit 37065ba

Please sign in to comment.