Skip to content

Commit 3376f76

Browse files
committedMar 3, 2025
Updated dev resources.
1 parent ebd6db1 commit 3376f76

File tree

2 files changed

+132
-7
lines changed

2 files changed

+132
-7
lines changed
 

‎dev/scripts/launch/magma.mem.sh

+19-7
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cd $BASE/../../../
2222
MAGMA_DIST=`pwd`
2323

2424
MAGMAHIT="no"
25-
MYSQLHIT="no"
25+
SQLHIT="no"
2626
MEMCACHEDHIT="no"
2727
ECLIPSEHIT="no"
2828

@@ -59,18 +59,30 @@ unset VMEM RMEM vmem rmem
5959

6060
# MySQL Memory
6161

62-
VMEM=`ps kstart_time auxw | grep "mysqld" | grep -v grep | awk -F' ' '{print $5}' | tail -1`
63-
RMEM=`ps kstart_time auxw | grep "mysqld" | grep -v grep | awk -F' ' '{print $6}' | tail -1`
62+
VMEM=`ps kstart_time auxw | grep -E "mysqld" | grep -v grep | awk -F' ' '{print $5}' | tail -1`
63+
RMEM=`ps kstart_time auxw | grep -E "mysqld" | grep -v grep | awk -F' ' '{print $6}' | tail -1`
6464

6565
if [ "$VMEM" != '' ] || [ "$RMEM" != '' ]; then
66-
MYSQLHIT="yes"
66+
SQLHIT="yes"
6767
let "vmem = ($VMEM / 1024)"
6868
let "rmem = ($RMEM / 1024)"
6969
printf "%28.23s = %5.5s virtual megabytes %5.5s resident megabytes\n" "mysqld" "$vmem" "$rmem"
7070
fi
7171

7272
unset VMEM RMEM vmem rmem
7373

74+
VMEM=`ps kstart_time auxw | grep -E "mariadbd" | grep -v grep | awk -F' ' '{print $5}' | tail -1`
75+
RMEM=`ps kstart_time auxw | grep -E "mariadbd" | grep -v grep | awk -F' ' '{print $6}' | tail -1`
76+
77+
if [ "$VMEM" != '' ] || [ "$RMEM" != '' ]; then
78+
SQLHIT="yes"
79+
let "vmem = ($VMEM / 1024)"
80+
let "rmem = ($RMEM / 1024)"
81+
printf "%28.23s = %5.5s virtual megabytes %5.5s resident megabytes\n" "mariadbd" "$vmem" "$rmem"
82+
fi
83+
84+
unset VMEM RMEM vmem rmem
85+
7486
# Memcached Memory
7587

7688
VMEM=`ps kstart_time auxw | grep "memcached" | grep -v grep | awk -F' ' '{print $5}' | tail -1`
@@ -99,16 +111,16 @@ fi
99111

100112
unset VMEM RMEM vmem rmem
101113

102-
if [ "$MAGMAHIT" == "no" ] || [ "$MYSQLHIT" == "no" ] || [ "$MEMCACHEDHIT" == "no" ] || [ "$ECLIPSEHIT" == "no" ]; then
114+
if [ "$MAGMAHIT" == "no" ] || [ "$SQLHIT" == "no" ] || [ "$MEMCACHEDHIT" == "no" ] || [ "$ECLIPSEHIT" == "no" ]; then
103115
echo ""
104116
fi
105117

106118
if [ "$MAGMAHIT" == "no" ]; then
107119
printf "%28.23s = $(tput setaf 1)%s$(tput sgr0)\n" "magmad and magmad.check" "not running"
108120
fi
109121

110-
if [ "$MYSQLHIT" == "no" ]; then
111-
printf "%28.23s = $(tput setaf 1)%s$(tput sgr0)\n" "mysqld" "not running"
122+
if [ "$SQLHIT" == "no" ]; then
123+
printf "%28.23s = $(tput setaf 1)%s$(tput sgr0)\n" "mysqld and mariadbd" "not running"
112124
fi
113125

114126
if [ "$MEMCACHEDHIT" == "no" ]; then

‎res/gdb/gdbinit

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Enable execution recording
2+
#target record
3+
4+
set record stop-at-limit off
5+
set record insn-number-max 1000
6+
7+
# Shared libraries
8+
set auto-solib-add on
9+
set debug-file-directory /usr/lib/debug/:/usr/local/lib/debug/
10+
set stop-on-solib-events 0
11+
12+
# Don't stop when a signal is recieved
13+
handle all pass print nostop
14+
handle SIGSEGV pass print stop
15+
16+
# Environment info
17+
#set verbose on
18+
#set trace-commands on
19+
#set schedule-multiple on
20+
#set debug observer 1
21+
22+
# Stringer type constants
23+
set $gdb_constant_t = 1
24+
set $gdb_placer_t = 2
25+
set $gdb_nuller_t = 4
26+
set $gdb_block_t = 8
27+
set $gdb_managed_t = 16
28+
set $gdb_mapped_t = 32
29+
30+
# Stringer print helpers
31+
define pstr_len
32+
33+
set $opts = *((uint32_t *)$arg0)
34+
35+
if ($opts & $gdb_constant_t) == $gdb_constant_t
36+
printf "Length = NULL\n"
37+
end
38+
if ($opts & $gdb_placer_t) == $gdb_placer_t
39+
printf "Length = %u\n", ((placer_t *)$arg0)->length
40+
end
41+
if ($opts & $gdb_nuller_t) == $gdb_nuller_t
42+
printf "Length = NULL\n"
43+
end
44+
if ($opts & $gdb_block_t) == $gdb_block_t
45+
printf "Length = %u\n", ((block_t *)$arg0)->length
46+
end
47+
if ($opts & $gdb_managed_t) == $gdb_managed_t
48+
printf "Length = %u\n", ((managed_t *)$arg0)->length
49+
end
50+
if ($opts & $gdb_mapped_t) == $gdb_mapped_t
51+
printf "Length = %u\n", ((mapped_t *)$arg0)->length
52+
end
53+
54+
end
55+
document pstr_len
56+
Print the data length of a stringer buffer.
57+
end
58+
59+
define pstr_avail
60+
61+
set $opts = *((uint32_t *)$arg0)
62+
63+
if ($opts & $gdb_constant_t) == $gdb_constant_t
64+
printf "Available = NULL\n"
65+
end
66+
if ($opts & $gdb_placer_t) == $gdb_placer_t
67+
printf "Available = NULL\n"
68+
end
69+
if ($opts & $gdb_nuller_t) == $gdb_nuller_t
70+
printf "Available = NULL\n"
71+
end
72+
if ($opts & $gdb_block_t) == $gdb_block_t
73+
printf "Available = NULL\n"
74+
end
75+
if ($opts & $gdb_managed_t) == $gdb_managed_t
76+
printf "Available = %u\n", ((managed_t *)$arg0)->avail
77+
end
78+
if ($opts & $gdb_mapped_t) == $gdb_mapped_t
79+
printf "Available = %u\n", ((mapped_t *)$arg0)->avail
80+
end
81+
82+
end
83+
document pstr_avail
84+
Print the allocated length of a stringer buffer.
85+
end
86+
87+
define pstr_data
88+
89+
set $opts = *((uint32_t *)$arg0)
90+
91+
if ($opts & $gdb_constant_t) == $gdb_constant_t
92+
output *((char *)((constant_t *)$arg0)->data)
93+
end
94+
if ($opts & $gdb_placer_t) == $gdb_placer_t
95+
output *((char *)((placer_t *)$arg0)->data)@((placer_t *)$arg0)->length
96+
end
97+
if ($opts & $gdb_nuller_t) == $gdb_nuller_t
98+
output *((char *)((nuller_t *)$arg0)->data)
99+
end
100+
if ($opts & $gdb_block_t) == $gdb_block_t
101+
output *((char *)((block_t *)$arg0)->data)@((block_t *)$arg0)->length
102+
end
103+
if ($opts & $gdb_managed_t) == $gdb_managed_t
104+
output *((char *)((managed_t *)$arg0)->data)@((managed_t *)$arg0)->length
105+
end
106+
if ($opts & $gdb_mapped_t) == $gdb_mapped_t
107+
output *((char *)((mapped_t *)$arg0)->data)@((mapped_t *)$arg0)->length
108+
end
109+
110+
end
111+
document pstr_data
112+
Print the data stored in a stringer buffer.
113+
end

0 commit comments

Comments
 (0)