-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathFuncTracer.hpp
More file actions
33 lines (27 loc) · 874 Bytes
/
FuncTracer.hpp
File metadata and controls
33 lines (27 loc) · 874 Bytes
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
#ifndef FUNCTRACER_HPP
#define FUNCTRACER_HPP
#include <string>
#include <set>
#include <mutex>
// Determine if function name is relevant to us and if it will be logged
bool func_is_relevant(const std::string_view &func_name)
{
// Ignore functions that are not relevant for coverage
static const std::set<std::string_view> blacklist = {
"main", "_init", "_start", ".plt.got", ".plt"
};
if (blacklist.contains(func_name))
return false;
// Ignore PLT functions and internal functions (usually prefixed with __)
if (func_name.ends_with("@plt") || func_name.starts_with("__"))
return false;
return true;
}
bool image_is_relevant(const std::string_view &image_name)
{
static const std::set<std::string_view> blacklist = {
"[vdso]"
};
return !blacklist.contains(image_name);
}
#endif // FUNCTRACER_HPP