-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultithread_tracer.cpp
53 lines (46 loc) · 1.11 KB
/
multithread_tracer.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <iostream>
#include "MultiThreadTracer.h"
void usage( void )
{
std::cout << "1. Start capture" << std::endl;
std::cout << "2. Stop capture" << std::endl;
std::cout << "3. Decode" << std::endl;
}
int main( void )
{
pid_t pid;
std::cout << "pid : ";
std::cin >> pid;
ThreadFilterList *_thread_filter = new ThreadFilterList;
//_thread_filter->insert( "input_thread_comm"); // 431182
MultiThreadTracer *mtt = new MultiThreadTracer( pid, _thread_filter );
mtt->InitTracer();
while ( true ) {
usage();
std::cout << ">";
int select;
std::cin >> select;
switch ( select ) {
case -1:
return 0;
case 1:
{
mtt->StartTrace();
break;
}
case 2:
{
mtt->StopTrace();
mtt->SaveAuxData();
mtt->SaveMapsData();
break;
}
case 3:
{
mtt->Decode();
break;
}
}
}
return 0;
}