File tree Expand file tree Collapse file tree 4 files changed +28
-6
lines changed
test/tools/llvm-exegesis/X86/latency Expand file tree Collapse file tree 4 files changed +28
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# RUN: llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -snippets-file=%s -execution-mode=subprocess | FileCheck %s
4
4
5
- # CHECK: error: ' The benchmarking subprocess sent unexpected signal: Segmentation fault'
5
+ # CHECK: error: The snippet crashed with signal Segmentation fault at address 10000
6
6
7
- # LLVM-EXEGESIS-DEFREG RBX 0
7
+ # LLVM-EXEGESIS-DEFREG RBX 10000
8
8
movq (%rbx ), %rax
Original file line number Diff line number Diff line change @@ -374,8 +374,8 @@ class SubProcessFunctionExecutorImpl
374
374
}
375
375
376
376
return make_error<SnippetCrash>(
377
- " The benchmarking subprocess sent unexpected signal: " +
378
- Twine ( strsignal ( ChildSignalInfo.si_signo ) ));
377
+ ChildSignalInfo. si_signo ,
378
+ reinterpret_cast < intptr_t >( ChildSignalInfo.si_addr ));
379
379
}
380
380
381
381
[[noreturn]] void prepareAndRunBenchmark (int Pipe,
Original file line number Diff line number Diff line change 8
8
9
9
#include " Error.h"
10
10
11
+ #ifdef LLVM_ON_UNIX
12
+ #include < string.h>
13
+ #endif // LLVM_ON_UNIX
14
+
11
15
namespace llvm {
12
16
namespace exegesis {
13
17
@@ -21,7 +25,18 @@ std::error_code ClusteringError::convertToErrorCode() const {
21
25
22
26
char SnippetCrash::ID;
23
27
24
- void SnippetCrash::log (raw_ostream &OS) const { OS << Msg; }
28
+ void SnippetCrash::log (raw_ostream &OS) const {
29
+ if (SISignalNumber == -1 ) {
30
+ OS << Msg;
31
+ return ;
32
+ }
33
+ #ifdef LLVM_ON_UNIX
34
+ OS << " The snippet crashed with signal " << strsignal (SISignalNumber)
35
+ << " at address " << Twine::utohexstr (SIAddress);
36
+ #else
37
+ OS << " The snippet crashed with a signal" ;
38
+ #endif // LLVM_ON_UNIX
39
+ }
25
40
26
41
std::error_code SnippetCrash::convertToErrorCode () const {
27
42
return inconvertibleErrorCode ();
Original file line number Diff line number Diff line change 12
12
#include " llvm/ADT/Twine.h"
13
13
#include " llvm/Support/Error.h"
14
14
15
+ #include < cstdint>
16
+
15
17
namespace llvm {
16
18
namespace exegesis {
17
19
@@ -41,14 +43,19 @@ class ClusteringError : public ErrorInfo<ClusteringError> {
41
43
class SnippetCrash : public ErrorInfo <SnippetCrash> {
42
44
public:
43
45
static char ID;
44
- SnippetCrash (const Twine &S) : Msg(S.str()) {}
46
+ SnippetCrash (const Twine &S)
47
+ : Msg(S.str()), SIAddress(-1 ), SISignalNumber(-1 ) {}
48
+ SnippetCrash (int SISignalNumber_, intptr_t SIAddress_)
49
+ : Msg(" " ), SIAddress(SIAddress_), SISignalNumber(SISignalNumber_) {}
45
50
46
51
void log (raw_ostream &OS) const override ;
47
52
48
53
std::error_code convertToErrorCode () const override ;
49
54
50
55
private:
51
56
std::string Msg;
57
+ intptr_t SIAddress;
58
+ int SISignalNumber;
52
59
};
53
60
54
61
} // namespace exegesis
You can’t perform that action at this time.
0 commit comments