mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[sancov] introducing symbolized coverage files (.symcov)
Summary: Answering any meaningful questions about .sancov files requires accessing symbol information from the corresponding binary. This change introduces a separate intermediate data structure and format: symbolized coverage. It contains all symbol information that is required to answer common queries: - merging - coverd/uncovered files and functions - line status. Also removing the html report functionality from sancov: generated HTML files are too huge, and a different approach is required. Maintaining this half-working approach in the C++ is painful. Differential Revision: https://reviews.llvm.org/D24947 llvm-svn: 282639
This commit is contained in:
parent
74c97ee568
commit
5d501f4c5e
@ -42,6 +42,10 @@ struct DILineInfo {
|
||||
bool operator!=(const DILineInfo &RHS) const {
|
||||
return !(*this == RHS);
|
||||
}
|
||||
bool operator<(const DILineInfo &RHS) const {
|
||||
return std::tie(FileName, FunctionName, Line, Column) <
|
||||
std::tie(RHS.FileName, RHS.FunctionName, RHS.Line, RHS.Column);
|
||||
}
|
||||
};
|
||||
|
||||
typedef SmallVector<std::pair<uint64_t, DILineInfo>, 16> DILineInfoTable;
|
||||
|
25
test/tools/sancov/Inputs/test-linux_x86_64.0.symcov
Normal file
25
test/tools/sancov/Inputs/test-linux_x86_64.0.symcov
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"covered-points" : ["4e132b", "4e1472", "4e1520", "4e1553", "4e1586"],
|
||||
"binary-hash" : "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5",
|
||||
"point-symbol-info" : {
|
||||
"test/tools/sancov/Inputs/foo.cpp" : {
|
||||
"foo()" : {
|
||||
"4e178c" : "5:0"
|
||||
}
|
||||
},
|
||||
"test/tools/sancov/Inputs/test.cpp" : {
|
||||
"bar(std::string)" : {
|
||||
"4e132b" : "12:0"
|
||||
},
|
||||
"main" : {
|
||||
"4e1472" : "14:0",
|
||||
"4e14c2" : "16:9",
|
||||
"4e1520" : "17:5",
|
||||
"4e1553" : "17:5",
|
||||
"4e1586" : "17:5",
|
||||
"4e1635" : "19:1",
|
||||
"4e1690" : "17:5"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
25
test/tools/sancov/Inputs/test-linux_x86_64.1.symcov
Normal file
25
test/tools/sancov/Inputs/test-linux_x86_64.1.symcov
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"covered-points" : ["4e132b", "4e1472", "4e14c2", "4e1520", "4e1553", "4e1586", "4e178c"],
|
||||
"binary-hash" : "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5",
|
||||
"point-symbol-info" : {
|
||||
"test/tools/sancov/Inputs/foo.cpp" : {
|
||||
"foo()" : {
|
||||
"4e178c" : "5:0"
|
||||
}
|
||||
},
|
||||
"test/tools/sancov/Inputs/test.cpp" : {
|
||||
"bar(std::string)" : {
|
||||
"4e132b" : "12:0"
|
||||
},
|
||||
"main" : {
|
||||
"4e1472" : "14:0",
|
||||
"4e14c2" : "16:9",
|
||||
"4e1520" : "17:5",
|
||||
"4e1553" : "17:5",
|
||||
"4e1586" : "17:5",
|
||||
"4e1635" : "19:1",
|
||||
"4e1690" : "17:5"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
REQUIRES: x86_64-linux
|
||||
RUN: sancov -html-report %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s
|
||||
|
||||
// It's very difficult to test html report. Do basic smoke check.
|
||||
CHECK: {{.*/Inputs/test.cpp}}
|
||||
|
64
test/tools/sancov/merge.test
Normal file
64
test/tools/sancov/merge.test
Normal file
@ -0,0 +1,64 @@
|
||||
REQUIRES: x86_64-linux
|
||||
RUN: sancov -merge %p/Inputs/test-linux_x86_64.0.symcov| FileCheck --check-prefix=MERGE1 %s
|
||||
RUN: sancov -merge %p/Inputs/test-linux_x86_64.0.symcov %p/Inputs/test-linux_x86_64.1.symcov| FileCheck --check-prefix=MERGE2 %s
|
||||
|
||||
MERGE1: {
|
||||
MERGE1-NEXT: "covered-points" : ["4e132b", "4e1472", "4e1520", "4e1553", "4e1586"],
|
||||
MERGE1-NEXT: "binary-hash" : "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5",
|
||||
MERGE1-NEXT: "point-symbol-info" : {
|
||||
MERGE1-NEXT: "test/tools/sancov/Inputs/foo.cpp" : {
|
||||
MERGE1-NEXT: "foo()" : {
|
||||
MERGE1-NEXT: "4e178c" : "5:0"
|
||||
MERGE1-NEXT: }
|
||||
MERGE1-NEXT: },
|
||||
MERGE1-NEXT: "test/tools/sancov/Inputs/test.cpp" : {
|
||||
MERGE1-NEXT: "bar(std::string)" : {
|
||||
MERGE1-NEXT: "4e132b" : "12:0"
|
||||
MERGE1-NEXT: },
|
||||
MERGE1-NEXT: "main" : {
|
||||
MERGE1-NEXT: "4e1472" : "14:0",
|
||||
MERGE1-NEXT: "4e14c2" : "16:9",
|
||||
MERGE1-NEXT: "4e1520" : "17:5",
|
||||
MERGE1-NEXT: "4e1553" : "17:5",
|
||||
MERGE1-NEXT: "4e1586" : "17:5",
|
||||
MERGE1-NEXT: "4e1635" : "19:1",
|
||||
MERGE1-NEXT: "4e1690" : "17:5"
|
||||
MERGE1-NEXT: }
|
||||
MERGE1-NEXT: }
|
||||
MERGE1-NEXT: }
|
||||
MERGE1-NEXT: }
|
||||
|
||||
MERGE2: {
|
||||
MERGE2-NEXT: "covered-points" : ["BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e132b", "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1472", "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e14c2", "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1520", "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1553", "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1586", "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e178c"],
|
||||
MERGE2-NEXT: "point-symbol-info" : {
|
||||
MERGE2-NEXT: "test/tools/sancov/Inputs/foo.cpp" : {
|
||||
MERGE2-NEXT: "foo()" : {
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e178c" : "5:0",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e178c" : "5:0"
|
||||
MERGE2-NEXT: }
|
||||
MERGE2-NEXT: },
|
||||
MERGE2-NEXT: "test/tools/sancov/Inputs/test.cpp" : {
|
||||
MERGE2-NEXT: "bar(std::string)" : {
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e132b" : "12:0",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e132b" : "12:0"
|
||||
MERGE2-NEXT: },
|
||||
MERGE2-NEXT: "main" : {
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1472" : "14:0",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e14c2" : "16:9",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1520" : "17:5",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1553" : "17:5",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1586" : "17:5",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1635" : "19:1",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1690" : "17:5",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1472" : "14:0",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e14c2" : "16:9",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1520" : "17:5",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1553" : "17:5",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1586" : "17:5",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1635" : "19:1",
|
||||
MERGE2-NEXT: "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5:4e1690" : "17:5"
|
||||
MERGE2-NEXT: }
|
||||
MERGE2-NEXT: }
|
||||
MERGE2-NEXT: }
|
||||
MERGE2-NEXT: }
|
||||
|
29
test/tools/sancov/symbolize.test
Normal file
29
test/tools/sancov/symbolize.test
Normal file
@ -0,0 +1,29 @@
|
||||
REQUIRES: x86_64-linux
|
||||
RUN: sancov -symbolize -strip_path_prefix="llvm/" %p/Inputs/test-linux_x86_64 %p/Inputs/test-linux_x86_64.0.sancov | FileCheck %s
|
||||
|
||||
CHECK: {
|
||||
CHECK-NEXT: "covered-points" : ["4e132b", "4e1472", "4e1520", "4e1553", "4e1586"],
|
||||
CHECK-NEXT: "binary-hash" : "BB3CDD5045AED83906F6ADCC1C4DAF7E2596A6B5",
|
||||
CHECK-NEXT: "point-symbol-info" : {
|
||||
CHECK-NEXT: "test/tools/sancov/Inputs/foo.cpp" : {
|
||||
CHECK-NEXT: "foo()" : {
|
||||
CHECK-NEXT: "4e178c" : "5:0"
|
||||
CHECK-NEXT: }
|
||||
CHECK-NEXT: },
|
||||
CHECK-NEXT: "test/tools/sancov/Inputs/test.cpp" : {
|
||||
CHECK-NEXT: "bar(std::string)" : {
|
||||
CHECK-NEXT: "4e132b" : "12:0"
|
||||
CHECK-NEXT: },
|
||||
CHECK-NEXT: "main" : {
|
||||
CHECK-NEXT: "4e1472" : "14:0",
|
||||
CHECK-NEXT: "4e14c2" : "16:9",
|
||||
CHECK-NEXT: "4e1520" : "17:5",
|
||||
CHECK-NEXT: "4e1553" : "17:5",
|
||||
CHECK-NEXT: "4e1586" : "17:5",
|
||||
CHECK-NEXT: "4e1635" : "19:1",
|
||||
CHECK-NEXT: "4e1690" : "17:5"
|
||||
CHECK-NEXT: }
|
||||
CHECK-NEXT: }
|
||||
CHECK-NEXT: }
|
||||
CHECK-NEXT:}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user