Ring Daemon
16.0.0
Loading...
Searching...
No Matches
trace-tools.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3
*
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16
*/
17
#pragma once
18
19
#ifdef ENABLE_TRACEPOINTS
20
/*
21
* GCC Only. We use these instead of classic __FILE__ and __LINE__ because
22
* these are evaluated where invoked and not at expansion time. See GCC manual.
23
*/
24
# define CURRENT_FILENAME() __builtin_FILE()
25
# define CURRENT_LINE() __builtin_LINE()
26
#else
27
# define CURRENT_FILENAME() ""
28
# define CURRENT_LINE() 0
29
#endif
30
31
#ifdef HAVE_CXXABI_H
32
#include <cxxabi.h>
33
#include <string>
34
35
template
<
typename
T>
36
std::string
demangle
()
37
{
38
int
err;
39
char
*raw;
40
std::string ret;
41
42
raw = abi::__cxa_demangle(
typeid
(T).name(), 0, 0, &err);
43
44
if
(0 == err) {
45
ret = raw;
46
}
else
{
47
ret =
typeid
(T).name();
48
}
49
50
std::free(raw);
51
52
return
ret;
53
}
54
55
#else
56
template
<
typename
T>
57
std::string
demangle
()
58
{
59
return
typeid
(T).name();
60
}
61
#endif
demangle
std::string demangle()
Definition
trace-tools.h:57
src
jami
trace-tools.h
Generated on Thu Jun 19 2025 15:50:37 for Ring Daemon by
1.9.8