rvmutl(1)
๐ rvmutl(1) ๐
maintenance utility for RVM log โจ
๐ธ NAME ๐ธ
rvmutl โ maintenance utility for RVM log ๐
๐ฆ SYNOPSIS ๐ฆ
rvmutl log
rvmutl
โจ DESCRIPTION โจ
Okay bestie, so rvmutl is the maintenance utility for RVM log. Its main features are log creation and maintenance, but it also has status and statistic display commands, plus printing commands for log records. Thereโs even a search facility for modifications to segments. You may find rvmutl a great debugging tool. ๐
There are two ways to use rvmutl: you can supply the name of the RVM log on the command line, or you donโt supply the name on the command line but specify the log within rvmutl (see below). ๐ซถ
rvmutl prompts for commands with a * (asterisk) prompt. Most commands have one or more parameters, which are separated by one or more spaces. Some commands have abbreviations, and these will be specified in the command section. ๐
For example, to examine the status of a RVM log (called logfile in the example), you can do:
> rvmutl
* open_log logfile
* status
Status of log: /home/clement/linuxobj8/rvm-src/tests/logfile
log created on: Tue Nov 4 1997 17:31:10.244793
log created with: RVM Interface Version 1.3 7 Mar 1994
(more display omitted ...)
* quit
As another example, suppose you want to create a RVM log device on the partition /dev/hdc7, of size 1 Megabyte, you can do:
> rvmutl
* i /dev/hdc7 1M
* quit
Note that in the preceding example, we use the abbreviation i for the command init_log, and we can use the unit M to stand for Megabyte. ๐
๐ I/O REDIRECTION ๐
You can redirect input and output as in typical Unix shells. For example, the following command will have all display redirected to the file allrec:
* show all > allrec
*
๐ COMMANDS ๐
In the following, I will detail all the available commands: ๐
all_specโ Show all special log records. Special log records are those non-transaction records, such as wrap-around marker and segment dictionary entry. ๐build_seg_dict [all] [clear]seg_dict [all] [clear]โ Build the segment dictionary by scanning through the log. Segment dictionary is an in-memory structure that maps segment code to segment file. Segment code is used in each transaction range as a short hand of the segment file involved. If thealloption is specified, the whole log will be scanned, otherwise the scanning will stop when one segment dictionary entry is found. If theclearoption is specified, the segment dictionary will be cleared before starting the scanning process. ๐close_logโ Close the log file. ๐copy_logโ This provides a handy way to copy an existing log to another file or partition. Since rvm logs start on different offset, depending on whether they are files or partitions, using stock Unix commands such ascporddsometimes is not as nice as using this command. Some meta data (such as name of log) in the log status area in the destination log will also be updated to reflect new meta data after log copying. ๐earliestโ Show the earliest transaction record in the log. โณinit_log [log [length]]โ Initialize a log if it does not exist, or re-initialize it if it does exist. The log will have the namelogand the length of data area will belength. The actual size of the log file or partition will be slightly bigger because: 1. there is a log status area (of size 3 sectors); and 2. for log used on raw partition, there will be an offset (of 16 sectors) to jump off possible disklabel of the partition.
The length parameter is specified as an integer, optionally followed by a single character size code. The following size codes are defined: K or k for kilobytes, M or m for megabytes, S or s for sectors (512 bytes), P or p for pages (which have system dependent sizes) and B or b for bytes (default).
If either parameter is not specified, init_log will prompt for the missing information.
โ ๏ธ RVM maintains the log continuously after creation. If you are going to re-initialize an existing log, make sure the log is empty before the re-initialization, otherwise, the transaction records in the log would be lost (i.e., they would not be applied to the data segment). You can apply all transaction records to the data segments and empty the log (also known as truncate in this manual) by therecovercommand. You can use the commandstatusto check whether a log is empty.
find_earliestโ Print the offset of the earliest transaction record in the log. ๐find_tailโ Print the offset of the tail of the log. ๐headโ Print the transaction record at the head of log. (Note that there could be even earlier than the head record -- smaller record number and smaller time stamp. They are considered truncated from the log and can be overwritten upon them freely. They are still on the log just because it happens that rvm has not yet overwritten on them, and they may be useful for debugging. The commandearliestprints the earliest record.) ๐log [log] [no_tail] [no_update โ update]open_log [log] [no_tail] [no_update โ update]โ Open the rvm log namedlog. You must open a log before you can use most of the rest commands. The optionalno_tailswitch turns of the search of tail of the log (for example, when the log tail is corrupted). The optionalno_updateandupdateswitch controls whether update will be made on the log and segment (they turn on the rvm internal global variablervm_no_update). ๐n [num]next [num]โ Print the nextnumrecords. If the optional argumentnumis not specified, then the next one record will be printed. โญ๏ธns [num]next_sub_rec [num]โ Print the nextnumsub-records. Sub-records are the individual ranges of a transaction. If the optional argumentnumis not specified, then the next one sub-record will be printed. โญ๏ธppeek [file] offset / [csf]โ Peek on (or dump) the content offile. You must specify the argumentfilewhen you first peek or poke on a file, afterward you can omit the argument andrvmutlwill continue using the current file. The argumentoffsetdetermines from where the dump should start. The argumentcsfdetermines how the dump should be done, it comprises of three components:c,sandf; each of them represents the count, size, and format respectively.cis an integer and determines how many units, with size specified bys, should be dumped, andfspecifies what is the dump format.
In the following two examples, the first command dumps, from offset 0, eight bytes in hexadecimal format; the second command dumps two long integers in decimal format. Note that how the same file content can be dumped into different format.
* peek 0 / 8xb
00000000000: 0x18 0000 0000 0000 0x23 0x17 0x14 0x63
* peek 0 / 2dl
00000000000: 24 1662261027
There are seven different possible sizes: b for byte, l for long, s for short, O for offset (two long integers representing the high and low order bits respectively), f for float, D for double and t for time value.
There are nine different possible formats: c for character, d for decimal, o for octal, x for hexadecimal, u for unsigned, f for float, D for double, O for offset (two long integers representing the high and low order bits respectively) and t for time value.
You may omit the arguments c, s and f, and rvmutl will use the defaults, which are 1, d (decimal) and l (long) respectively, for the three arguments respectively. ๐๏ธ
poke [file] offset / cs = val [val ... ]โ Poke on (modify) the content offile. You must specify the argumentfilewhen you first peek or poke on a file, afterward you can omit the argument andrvmutlwill continue using the current file. The argumentoffsetdetermines from where the modification should start. The argumentcsdetermines how the modifications should be done, it comprises of two components:cands; each of them represents the count and size respectively.cis an integer and determines how many units, as specified bys, should be modified.
Examples:
* poke 512 / 4db = 25
* peek 512 / 8db
512: 25 25 25 25 0 0 0 0
* poke 512 / 2xl = 25
* peek 512 / 8db
512: 25 0 0 0 25 0 0 0
* poke 512 / 2b = 0x26 0x27
* peek 512 / 8db
512: 38 39 38 39 25 0 0 0
* poke 512 / b = "abcde"
* peek 512 / 8db
512: 97 98 99 100 101 0 0 0
Note that in the second example, the character x, which indicates hexadecimal format in peek, is silently ignored. To enter a hexadecimal number, you should use prefix 0x as in the third example. Note also that how a pattern is repeated by using the argument c in first and third example.
There are seven different possible sizes: b for byte, l for long, s for short, O for offset (two long integers representing the high and low order bits respectively), f for float, D for double and t for time value.
You can also enter string by using the double-quote mark (โ), as in the last example. โ๏ธ
pr [num]prev [num]โ Print the previousnumrecords. If the optional argumentnumis not specified, then the previous one record will be printed. โฎ๏ธps [num]prev_sub_rec [num]โ Print the previousnumsub-records. Sub-records are the individual ranges of a transaction. If the optional argumentnumis not specified, then the previous one sub-record will be printed. โฎ๏ธquitโ Quitrvmutl. ๐read_statusโ Re-read the log status from on-disk log device (file or partition) to in-memory structure (status). Note that the commandstatusshow the content of the in-memory structure, but not the on-disk device. If you have made changes to the on-disk device, you may want to re-read them into the memory. ๐
monitor [clear] [no_update โ update]
okay bestie, this one lets you stake out memory ranges and get notified whenever something touches them. You can specify memory ranges to be monitored by this command. When a memory range is monitored, there will be message printed out whenever there are modification within the range (E.g. in recover). โจ
- the switch
clearwill clear all the monitor previous set. bye ranges ๐ซถ - the switches
no_updateandupdatecarry the usual meaning (c.f.open_log)
You will be asked, interactively, for the addresses and formats for the ranges you want to monitor, and you should use the syntax similar to poke. The following example shows how to use monitor, show monitor, as well as how recover prints out the modification. ๐
* open_log log3
* monitor update
More ranges (y or n [n])? y
Enter list of addresses/format, terminate with null line
: 0x200d7550/1l
:
* show monitor
Range Address/format Length
1 0x200d7550/1dl 4
* recover
do_nv: data from log record 2101, range 52
monitored range 1, 0x200d7550, length 4 matched by
modified range 0x200d7550, length 4
0x200d7550: 537286660
change_tree_insert: inserting entire range
monitored range 1, 0x200d7550, length 4 matched by
modified range 0x200d7550, length 4
0x200d7550: 537286660
do_nv: data from log record 2101, range 51
monitored range 1, 0x200d7550, length 4 matched by
modified range 0x200ced40, length 8367
0x200d7550: 0
change_tree_insert: inserting entire range
monitored range 1, 0x200d7550, length 4 matched by
modified range 0x200ced40, length 8367
0x200d7550: 0
do_nv: data from log record 2101, range 50
monitored range 1, 0x200d7550, length 4 matched by
modified range 0x200cdcc4, length 16
0x200d7550: 0
change_tree_insert: inserting entire range
monitored range 1, 0x200d7550, length 4 matched by
modified range 0x200cdcc4, length 16
recover [clear] [file] [no_update โ update]
Truncate the log. ๐ชตโ๏ธ Truncation means applying the transaction records, that were logged on the log, to the data segment, and then reclaiming the space on the log used by those records. no cap, that's the whole vibe.
set [seg_dict] field โ addr = val
Set field (or memory location at addr) to val. There are five fields that you can set: head, tail, prev_head, prev_tail and log_start. (You can use prev head and prev tail to represent prev_head and prev_tail respectively.) ๐
Only the in-memory structure of the field is changed by this command โ so if you want it to actually stick, use write_status to write the in-memory structure (status area) to disk. ๐พ
s
(that's the shortcut, iykyk โ same as show)
show
allโ all recordsall_recordsโ all recordsearliestโ earliest recordheadโ record at head of logmods of / cs [= val]modificationss of / cs [= val]
E.g. โจ
* show mods 0x2000005c / 8b
Record number: 40756 modifies specified range:
Modification range: 1 Log offset: 224664
VM address: 0x2000005c Length: 52
Segment code: 1 Offset: 4188
Record length: 108 Back link: 48
0x2000005c: 74 -107 0 0 0 0 0 0
* show mods 0x2000005c / 1b = 74
Record number: 40756 assigns specified values
Modification range: 1 Log offset: 224664
VM address: 0x2000005c Length: 52
Segment code: 1 Offset: 4188
Record length: 108 Back link: 48
0x2000005c: 74
* show mods 0x2000005c / 1b = 75
-- no more records
monitorโ all the range being monitored.nextโ next recordnext_sub_recโ next subrecordnsโ next subrecordnumโ by record numberprevโ previous recordpreviousโ previous recordpsโ previous subrecordprev_sub_recโ previous subrecordrec_numberโ num by record numberremainingโ all remaining recordsseg_dictโ segment dictionaryseg_dictionaryโ segment dictionarystatisticsโ statistics of rvm activitiesstatusโ status area of the loglog_statusโ status area of the logsrโ current subrecordsub_recโ currect subrecordtailโ tail recordtimestampโ by record timestamp (note: no effect) ๐ญ
sizeof struct โ all
Show the size of a the give structure struct, or size of all structure. The unit is byte. ๐
The following structure can be shown: condition, device_t (dev), dev_region_t, FLUSH_BUF_LEN, free_page_t, MAXPATHLEN, int, list_entry_t, log_t (log), log_buf_t, LOG_DEV_STATUS_SIZE, log_dev_status_t, log_seg_t, LOG_SPECIAL_IOV_MAX, LOG_SPECIAL_SIZE, log_special_t, log_status_t (status), log_wrap_t, long, MAX_READ_LEN, mem_region_t, MIN_NV_RANGE_SIZE, MIN_FLUSH_BUF_LEN, MIN_RECOVERY_BUF_LEN, MIN_TRANS_SIZE, mutex, NUM_CACHE_TYPES, NV_LOCAL_MAX, nv_range_t (nv), NV_RANGE_OVERHEAD, page_size, range_t, rec_end_t, rec_hdr_t, RECOVERY_BUF_LEN, region_t, rvm_length_t, rvm_offset_t, rvm_options_t, rvm_region_t, rvm_tid_t, rw_lock_t (rw_lock), rw_lock_mode_t, seg_t, struct_id_t, int_tid_t, timeval, trans_hdr_t, TRANS_SIZE, tree_links_t, tree_node_t, TRUNCATE, ulong, unsigned.
status
log_status
Show the log status area, which is the meta data about the log (include head offset, tail offset, space used by records, total log size, first record number, last record number, log creation time, last truncation time etc). ๐
sr
sub_rec
Show the current subrecord. ๐ธ
statistics
Show the statistics of rvm activities. ๐
tail
Show the transaction record at the tail of log.
update
Turn on update (i.e. set to false the rvm-internal global variable rvm_no_update.) Update will not be made on the log and segment.
yes bestie, that's genuinely what it says โ turn on update, and updates will not be made. the naming here is giving chaos. ๐
no_update
Turn off update (i.e. set to true the rvm-internal global variable rvm_no_update.) Update will be made on the log and segment.
same energy, opposite direction. read twice, then read again. ๐
write_status
Write out the in-memory log status structure to the log status block on disk. ๐พโจ
๐ BUGS ๐
- The command
find_holeis not yet documented. - Peeking using the format or size of time value (
t) does not work. - The way to poke an offset value is not yet documented.
sizeofof some structs (e.g.condition,int) wrongly displays the page size rather than the size of the structure.- The use of
no_updatedoes not quite work.Rvmutleasily crashes when the switch is used. - The exact semantic of
replaycommand is not documented, and the command itself crashes quite easily. - The use of
seg_dictinsetis not yet documented. - The command
show timestamphas no effect.
fr fr, all of the above are real and confirmed. tread carefully, bestie. ๐ซถ
๐ AUTHOR ๐
Yui Wah LEE completely rewrote this man page (Nov. 1997) โจ
and that's the whole page, babe โ footer says rvmutl(1), and the author credit goes back to Nov. 1997. you read the entire thing, which is honestly iconic of you. slay ๐
๐๐ฆ
๐ฆ where this page comes from
- fedora 43: rvm-tools 1.28-2.fc43 ยท GPL-2.0-only
- fedora 44: rvm-tools 1.28-3.fc44 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms