-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.modules
113 lines (91 loc) · 4.31 KB
/
README.modules
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
README for sp-rtrace modules
Copyright (C) 2010,2012 by Nokia Corporation
Contents
--------
1. Introduction
2. New module creation
3. Module details
4. Issues and Limitations
5. License
1. Introduction
---------------
The tracing modules are responsible for the target function interception
and event reporting to the main module. The preload modules achieve it
by being preloaded for the target process and containing their own
(wrapper) implementations of the target functions.
2. New module creation
----------------------
To create new preload module use the rtrace-module-gen script in the
devscripts/ directory (see the devscripts/README file).
3. Module details
-----------------
memory
Memory module is used to analyse memory allocations/frees. It reports
'memory' resource usage by tracking calloc, free, malloc, memalign,
posix_memalign, realloc functions.
memtransfer
Memory transfer module is used to analyse memory transfer operations.
It reports 'memtransfer' resource usage by tracking functions like
bzero, memcpy, strcat, wmemmove etc. See the module source for exact
list, or use [1].
file
File module is used to analyse file usage. It reports the following
resource usage:
'fd' - file descriptor usage, tracked by open, fdopen, socket,
eventfd socketpair etc functions either creating or closing
file descriptors. See the module source for exact list,
or use [1].
'fp' - file pointer usage, tracked by fopen, fclose, fcloseall,
freopen functions.
[1] readelf -s /usr/lib/sp-rtrace/<module>.so | grep FUNC |\
grep -v -e ' UND ' -e ' _fini$' -e ' _init$' -e ' sp_rtrace'
gobject
Gobject module is used to analyse gobject creation, references
and dereferences. It reports 'gobject' resource usage by tracking
g_object_newv, g_object_ref, g_object_unref functions.
shmsysv
Shared memory module is used to analyse shared memory creation/
desctruction and memory attachments/detachments: shmget, shmctl, shmat,
shmdt. It resports the following resource usage:
'segment' - shared memory segment creation/destruction, tracked by
shmget, shmctl, shmdt functions.
'address' - shared memory attachements/detachments, tracked by shmat,
shmdt functions.
qobject
QObject module is used to analyse QObject creation/destruction. It reports
'qobject' resource by tracking QObject constructors/destructors.
shmposix
Posix shared memory object module is used to analyse posix shared memory
object creation/destruction and memory mapping/unmapping. It reports the
following resource usage:
'pshmobj' - posix shared memory object creation/destruction, tracked by
shm_open, shm_unlink functions.
'pshmfd' - posix shared memory object opening/closing, tracked by
shm_open, close() functions.
'pshmmap' - posix shared memory object mapping/unmapping, tracked by
mmap, mmap2, mmap64, munmap functions.
'fshmmap' - file mapping/unmapping, tracked by mmap, mmap2, mmap64, munmap
functions.
'shmmap' - generic shared memory object mapping/unmapping, tracked by
mmap, mmap2, mmap64, munmap functions.
This plugin keeps track of opened file descriptors to determine the
descriptor 'type' for mapping functions. If the descriptor was opened
with shm_open, then 'pshmmap' resource type is reported by mapping
functions. If the descriptor was opened by open, open64, creat functions,
then 'fshmmap' resource type is reported by mapping functions. Otherwise
(when the descriptor source was not determined) 'shmmap' resource type
is reported by mapping functions.
4. Issues and Limitations
-------------------------
- When using multiple preload modules with overlapping functions together
frames from one module will show up in the backtraces of generated by
other module.
- Be careful when using memory module together with other modules.
Some modules allocate memory to keep track on events internally. Such
allocations would be reported by memory module, confusing the end result.
5. License
----------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.