[go: up one dir, main page]

File: .gdbinit

package info (click to toggle)
arla 0.36.2-11
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 13,236 kB
  • ctags: 12,096
  • sloc: ansic: 125,016; sh: 10,590; makefile: 5,533; asm: 1,617; objc: 1,236; yacc: 372; perl: 367; lex: 309; awk: 35; lisp: 14
file content (241 lines) | stat: -rw-r--r-- 5,620 bytes parent folder | download
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
#
# $Id: .gdbinit,v 1.10 2002/04/10 08:56:33 lha Exp $
#

define memoryusage
y
printf "rx bytes: bytes: %d allocations: %d\n", rxi_Allocsize, rxi_Alloccnt
printf "fcache: highvnode: %d usedvnode: %d\n", highvnodes, usedvnodes
printf "conn: nconnections %d\n", nconnections
printf "cred: ncredentials %d\n", ncredentials
end


define listfcachenodes
set $foo = lrulist->head
while $foo != 0
print *(FCacheEntry *) $foo->data
set $foo = $foo->next
end
print 4711
end

document listfcachenodes
List all fcache nodes in the lru-list
end


define listfcachenodes_fid
set $foo = lrulist->head
while $foo != 0
print ((FCacheEntry *) $foo->data)->fid
set $foo = $foo->next
end
print 4711
end

document listfcachenodes_fid
List all fcache nodes's fids in the lru-list
end

define fcache_lru_num_nodes
set $bar = 0
set $foo = lrulist->head
while $foo != 0
set $bar = $bar + 1
set $foo = $foo->next
end
print $bar
end

document fcache_lru_num_nodes
Count number of nodes in the fcache lrulist
end

define fcache_lru_num_used_nodes
set $bar = 0
set $foo = lrulist->head
while $foo != 0
if ((FCacheEntry *) $foo->data)->flags.usedp != 0
set $bar = $bar + 1
end
set $foo = $foo->next
end
print $bar
end

document fcache_lru_num_used_nodes
Count number of USED nodes in the fcache lrulist
end

define lwp_ps_internal
set $lwp_ps_queue = $arg0
set $bf = $arg1
set $lwp_ps_counter = $lwp_ps_queue.count
set $lwp_ps_foo = $lwp_ps_queue->head
while $lwp_ps_counter != 0
  printf " name: %s   index: %d", (char *) $lwp_ps_foo->name, $lwp_ps_foo->index
  if $lwp_ps_foo == lwp_cpptr
    printf "                 RUNNING THREAD"
  end
  printf "\n"
  if $bf == 0
    printf "  eventlist:"
    set $lwp_ps_envcnt = 0
    while $lwp_ps_envcnt < $lwp_ps_foo->eventcnt
      printf " %x",  $lwp_ps_foo->eventlist[$lwp_ps_envcnt]
      set $lwp_ps_envcnt = $lwp_ps_envcnt + 1
    end
    printf "\n"
    if $lwp_ps_foo == lwp_cpptr
      printf "  fp: 0x%x\n", $fp
      printf "  pc: 0x%x\n", $pc
      printf "  pointers on topstack added for completeness\n"
    end
    printf "  fp: 0x%x\n",  ((int *)$lwp_ps_foo->context->topstack)[2]
    printf "  pc: 0x%x\n",  ((int *)$lwp_ps_foo->context->topstack)[3]
  else
    set $foo = ((int *)$lwp_ps_foo->context->topstack)[2]
    backfrom $foo $foo
  end
  set $lwp_ps_foo = $lwp_ps_foo->next
  set $lwp_ps_counter = $lwp_ps_counter - 1
end
end

define lwp_ps_int
set $bf = $arg0
echo Runnable[0]\n
lwp_ps_internal runnable[0] $bf
echo Runnable[1]\n
lwp_ps_internal runnable[1] $bf
echo Runnable[2]\n
lwp_ps_internal runnable[2] $bf
echo Runnable[3]\n
lwp_ps_internal runnable[3] $bf
echo Runnable[4]\n
lwp_ps_internal runnable[4] $bf
echo Blocked\n
lwp_ps_internal blocked $bf
end

define lwp_ps
lwp_ps_int 0
end

document lwp_ps
Print all processes, running or blocked
end

define lwp_backfrom_all
lwp_ps_int 1
end

document lwp_backfrom_all
Traces from all processes, running or blocked
end



define list_count
   set $count = 0
   set $current = ((List *)$arg0)->head
   while $current != 0
     set $count = $count + 1
     set $current = $current->next
   end
   printf "List contains %d entries\n", $count
end

document list_count
Count number of elements on util LIST.
end

define volume_print
   set $current = 'volcache.c'::lrulist->head
   while $current != 0
     set $entry = (VolCacheEntry *)$current->data
     if $entry->refcount != 0
        printf "%p - %s ref: %d\n", $entry, $entry->entry->name, $entry->refcount
     end
     set $current = $current->next
   end
end

document volume_print
Print the volume in the volcache
end

define volume_count
   set $cnt = 0
   set $vol_refs = 0
   set $total_cnt = 0
   set $current = 'volcache.c'::lrulist->head
   while $current != 0
     set $entry = (VolCacheEntry *)$current->data
     if $entry->refcount != 0
	set $cnt = $cnt + 1
        set $total_cnt = $total_cnt + $entry->refcount
     end
     set $vol_refs = $vol_refs + $entry->vol_refs
     set $current = $current->next
   end
   printf "Used volcache: counted: %d count: %d max: %d\n", $cnt, nactive_volcacheentries, nvolcacheentries
   printf "Refcount total: %d, used fcache nodes are: %d\n", $total_cnt, 'fcache.c'::usedvnodes
   printf "Volrefs total to %d\n", $vol_refs
end

document volume_count
Print the number of active entries in volcache, by counting 
them and printing the accounting variables
end

define volume_check
   set $current = 'volcache.c'::lrulist->head
   while $current != 0
     set $entry = (VolCacheEntry *)$current->data
     printf "checking %s\n", $entry->entry->name

     if $entry->refcount != 0
        set $cnt = 0
        printf "  checking fcache\n"
        set $fcur = 'fcache.c'::lrulist->head
        while $fcur != 0
           if ((FCacheEntry *)$fcur->data)->volume == $entry
              set $cnt = $cnt + 1
           end
           set $fcur = $fcur->next
        end
        if $cnt != $entry->refcount
           printf " failed %d fcache entries used, while entry was accounted for %d\n", $cnt, $entry->refcount
        else	   
           printf " ok\n"	   
        end	   
     end

     set $current = $current->next
   end
end

document volume_check
Check volcache consistency WRT fcache usage, too slow to use !
end


define conn_print
set $num = 0
while $num < connhtab->sz
  set $current = connhtab->tab[$num]
  while $current != 0
     set $data = (ConnCacheEntry *)$current->ptr
     print *$data
     printf " Cuid: %lx/%lx\n", $data->connection.epoch, $data->connection.cid
     set $current = $current->next
  end
  set $num = $num + 1
end
end

document conn_print
Print all entries on volcache cache
end