-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathHEY!
176 lines (122 loc) · 3.98 KB
/
HEY!
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/*
* Copyright 2017 Wade Lawrence Hennessey
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
very useful to keep debuginfo up to date
dnf --enablerepo=updates-debuginfo update
m-x gud-gdb to switch *dedicated* window
c-x c-a c-b to set breakpoint at point line. Who changed this and why?
service sshd start
// to enable sshd at boot time
systemctl enable sshd.service
git clone https://github.com/wadehennessey/rtgc.git
or
git checkout <commit hash>
git commit -am "blah"
# then must push commit
git push
use #define _GNU_SOURCE for weird compile problems not seeing decls
gdb> info signals
use next instead of continue to switch to diff thread break points
# these go in .gdbinit
handle SIGUSR1 nostop
set non-stop on
>set non-stop on
>set non-stop off
>show non-stop
>interrupt will stop the running thread
>break a.c:166 if (j == 1535)
wmctrl -r "emacs" -e 1,-1,-1,770,1010
TODO:
-----
verify:
double linked lists correct - (obj->next)->prev == obj, (obj->prev)->next == obj
verify color in header and color in list are the same
verify all _count fields are correct.
# to limit all threads in ./a to the second core:
taskset 0x10 ./a
# rr traces are stored in /home/wade/.local/share/rr/
gdb tui mode in xterm: c-x a
too see event numbers and start at a specific event number:
rr -M replay -g <event-number>
rr dump
rr dump /home/wade/.local/share/rr/a-0/ 39000000
try gdb cmds:
-------------
checkpoint
info checkpoints
restart <cp-id>
delete <cp-id>
watch -l <location>
when - command shows current event-number
try rr -c and -e options to increase thread interleave
# task switch after every N retired branches
rr record -c 2500 ./a
# I think I recorded "the bug" with this (compile "make debug")
rr record -c 5 ./a
# to see record options
rr help record
rr help replay
From rr/src/Scheduler.h
-c default: enum { DEFAULT_MAX_TICKS = 250000 }; // 50ms time slice
-e default: enum { DEFAULT_MAX_EVENTS = 10 };
To run real-time round-robin:
-----------------
chrt --rr 30 ./a
or
chrt --fifo 30 ./a
ps -Lo pid,tid,class <./a pid #>
To add swap
------------
su
cd /home
dd if=/dev/zero of=bigswapfile bs=1G count=64
chmod 600 /root/bigswapfile
mkswap bigswapfile
swapon bigswapfile
in /etc/fstab add:
/home/bigswapfile swap swap defaults 0 0
flip
-------
200ns for the "null" signal and return time. Includes double the "system" time.
Mean 5000 "null" signal and returns per 1ms.
Time for 1,000,000 "null" kill signal and returns
real 0m0.209s
user 0m0.029s
sys 0m0.389s
---------------------------------------------
try gcc -mcmodel=large to avoid dlopen relocation problems in wcl
change wcl print level to once for lib, once for compiler. Make it easy to change back.
Add IF_COUNTING/DEBUG wrappers
switch *debug-library-config* to *delivery-library-config* when doing build
to speed things up
--------------
add .gdbinit to rtgc, make ~/.gdbinit a link to rtgc version
add .wclinit to wcl, make ~/.wclinit a link
--------------------------------
clang stuff
run "clang -### -c a.c" to see full command line the driver generates,
then append "-ast-dump" to the end and run it.
in build dir "make clang" will just rebuild clang
AST Matcher
-------------
NOTE: clang-query only reads file passed to it *ONCE* at startup. File changes
after file is read are *NOT* seen.
/home/wade/build/bin/clang-query /tmp/w.c --
> set output diag
----------
export C_INCLUDE_PATH=/home/wade/build/lib/clang/4.0.0/include
-----------
Try LIBRARY_PATH env variable to allow removal or librtgc.so from wcl tree