From: jbrassow@sourceware.org <jbrassow@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/scripts gdbinit
Date: 10 Apr 2012 23:24:01 -0000 [thread overview]
Message-ID: <20120410232401.1810.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: jbrassow at sourceware.org 2012-04-10 23:24:00
Modified files:
scripts : gdbinit
Log message:
Add a couple new functions to gdbinit file and decode a couple lv->status flags
New functions:
- seg_pvs: Print a list of PVs in a seg_pvs list
- pv_dev_name: print name of a PV
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/gdbinit.diff?cvsroot=lvm2&r1=1.11&r2=1.12
--- LVM2/scripts/gdbinit 2011/09/28 16:32:22 1.11
+++ LVM2/scripts/gdbinit 2012/04/10 23:24:00 1.12
@@ -17,6 +17,7 @@
printf "\n\n"
printf "Loading commands:\n"
printf " - dm_list_size <list ptr>\n"
+printf " - pv_dev_name <PV ptr>\n"
printf " - first_seg <LV ptr>\n"
printf " - lv_status <LV ptr>\n"
printf " - lv_status_r <LV ptr>\n"
@@ -24,12 +25,13 @@
printf " - seg_item <seg ptr> <index>\n"
printf " - seg_status <seg ptr>\n"
printf " - segs_using_this_lv <seg ptr>\n"
+printf " - seg_pvs <list ptr>\n"
printf " - \n"
printf "Use 'help <command>' for more info\n"
printf "\n\n"
printf "Popular breakpoints:\n"
-printf "break _get_udev_flags\n"
-printf "run --splitmirrors 1 -n split vg/lv\n"
+printf "break _alloc_image_components\n"
+printf "run --repair --use-policies vg/lv\n"
printf "\n\n"
set follow-fork-mode child
@@ -41,6 +43,8 @@
# External functions should have a corresponding 'document'
# section. Internal functions should have leading comments
+
+
define dm_list_size
set $_DLS_list_head = (struct dm_list *)$arg0
set $_DLS_list = $_DLS_list_head->n
@@ -60,6 +64,41 @@
Usage: dm_list_size <list ptr>
end
+define pv_dev_name
+ set $_PDN_pv = (struct physical_volume *)$arg0
+ set $_PDN_dev = $_PDN_pv->dev
+ set $_PDN_strl = (struct str_list *)$_PDN_dev->aliases.n
+
+ printf "%s\n", $_PDN_strl->str
+end
+
+document pv_dev_name
+Print the name of the PV for the given PV pointer
+
+ Usage: pv_dev_name <PV ptr>
+end
+
+define seg_pvs
+ set $_SP_list_head = (struct dm_list *)$arg0
+ set $_SP_list = $_SP_list_head->n
+
+ while (($_SP_list != $_SP_list_head) && ($_SP_size < 100))
+ set $_SP_spv = (struct seg_pvs *)$_SP_list
+
+ printf "* Can't print PV list\n"
+
+ set $_SP_list = $_SP_list->n
+ end
+
+ printf "%d list items\n", $_SP_size
+end
+
+document seg_pvs
+Print the elements of a seg_pvs list
+
+ Usage: seg_pvs <list ptr>
+end
+
#
# __first_seg <return> <LV>
define __first_seg
@@ -270,6 +309,16 @@
set $_s_status = $_s_status & ~0x00400000U
printf " CONVERTING"
end
+# if ($_s_status & LV_REBUILD)
+ if ($_s_status & 0x100000U)
+ set $_s_status = $_s_status & ~0x100000U
+ printf " LV_REBUILD"
+ end
+# if ($_s_status & PARTIAL_LV)
+ if ($_s_status & 0x1000000U)
+ set $_s_status = $_s_status & ~0x1000000U
+ printf " PARTIAL_LV"
+ end
# if ($_s_status & MERGING)
if ($_s_status & 0x10000000U)
set $_s_status = $_s_status & ~0x10000000U
next reply other threads:[~2012-04-10 23:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-10 23:24 jbrassow [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-09-28 16:32 LVM2/scripts gdbinit jbrassow
2011-09-13 13:57 jbrassow
2011-09-08 22:19 jbrassow
2011-09-01 21:01 jbrassow
2011-07-01 16:15 jbrassow
2011-03-29 12:53 jbrassow
2011-03-14 18:05 jbrassow
2011-03-11 22:25 jbrassow
2011-03-11 22:16 jbrassow
2011-03-11 18:22 jbrassow
2011-03-10 13:45 jbrassow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120410232401.1810.qmail@sourceware.org \
--to=jbrassow@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.