Commit 113b91bf authored by Harald Sitter's avatar Harald Sitter 🌹
Browse files

fix line rating for new format when function name is missing

Summary:
previously this supposedly was

`#2  0x00007fefe9ef79e8 in ?? () at /usr/lib/dri/i965_dri.so`

nowadays the ?? is simply empty. the rating mechanism wasn't properly
handling this. treat an empty function name to mean the same as ?? and
rate the line as MissingFunction/Everything depending on whether
libraryName is also missing.

also update test expectations accordingly (could have actually seen that
discrepancy if one had paid attention to the outcoming rating :S)

CCBUG: 418538

Test Plan:
test passes. most lines from 417435 now rate `MissingFunction` and the whole trace is considered useless

```
Rating: 128 out of 364 Usefulness: Useless
90%: 327.6 70%: 254.8 40%: 145.6
```

Reviewers: cfeck, ngraham

Reviewed By: ngraham

Subscribers: ahmadsamir, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28027
parent dd180bb4
......@@ -129,13 +129,13 @@ void BacktraceLineGdb::rate()
if (!fileName().isEmpty()) {
r = Good;
} else if (!libraryName().isEmpty()) {
if (functionName() == QLatin1String("??")) {
if (functionName() == QLatin1String("??") || functionName().isEmpty()) {
r = MissingFunction;
} else {
r = MissingSourceFile;
}
} else {
if (functionName() == QLatin1String("??")) {
if (functionName() == QLatin1String("??") || functionName().isEmpty()) {
r = MissingEverything;
} else {
r = MissingLibrary;
......
......@@ -73,7 +73,7 @@ private Q_SLOTS:
QCOMPARE(line.functionName(), "");
QCOMPARE(line.fileName(), "");
QCOMPARE(line.libraryName(), "/usr/lib/libglib-2.0.so.0");
QCOMPARE(line.rating(), BacktraceLine::MissingSourceFile);
QCOMPARE(line.rating(), BacktraceLine::MissingFunction);
}
{ // library without -2.0 (trips up suffix detection)
BacktraceLineGdb line("#13 0x00007fe6059971b1 in () at /usr/lib/libpackagekit-qt.so.12\n");
......@@ -82,7 +82,7 @@ private Q_SLOTS:
QCOMPARE(line.functionName(), "");
QCOMPARE(line.fileName(), "");
QCOMPARE(line.libraryName(), "/usr/lib/libpackagekit-qt.so.12");
QCOMPARE(line.rating(), BacktraceLine::MissingSourceFile);
QCOMPARE(line.rating(), BacktraceLine::MissingFunction);
}
{ // library without any soversion
BacktraceLineGdb line("#13 0x00007fe6059971b1 in () at /usr/lib/libpackagekit-qt.so\n");
......@@ -91,7 +91,7 @@ private Q_SLOTS:
QCOMPARE(line.functionName(), "");
QCOMPARE(line.fileName(), "");
QCOMPARE(line.libraryName(), "/usr/lib/libpackagekit-qt.so");
QCOMPARE(line.rating(), BacktraceLine::MissingSourceFile);
QCOMPARE(line.rating(), BacktraceLine::MissingFunction);
}
{ // library without any soversion but name suffix
BacktraceLineGdb line("#13 0x00007fe6059971b1 in () at /usr/lib/libpackagekit-1.0.so\n");
......@@ -100,7 +100,7 @@ private Q_SLOTS:
QCOMPARE(line.functionName(), "");
QCOMPARE(line.fileName(), "");
QCOMPARE(line.libraryName(), "/usr/lib/libpackagekit-1.0.so");
QCOMPARE(line.rating(), BacktraceLine::MissingSourceFile);
QCOMPARE(line.rating(), BacktraceLine::MissingFunction);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment